SDL and PDCourses
  #1 (permalink)  
Unread 10-30-2009, 02:30 AM
drFdooch drFdooch is offline
Junior Member
 
Join Date: Oct 2009
Posts: 1
Default SDL and PDCourses

Mac Os X 10.6.1 GCC 4.2
Guten Abend Profis!
I am using SDL lib for my project. It has a port for sdl. But the result is
Code:
Ld build/___PROJECTNAME___.build/Debug/___PROJECTNAME___.build/Objects-normal/i386/___PROJECTNAME___ normal i386
cd /Users/***********/c++/macosx/Client/ver1sdl
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/******/c++/macosx/Client/ver1sdl/build/Debug -F/Users/*******/c++/macosx/Client/ver1sdl/build/Debug -F/Users/Fdooch/Library/Frameworks -F/Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks -filelist /Users/***************/c++/macosx/Client/ver1sdl/build/___PROJECTNAME___.build/Debug/___PROJECTNAME___.build/Objects-normal/i386/___PROJECTNAME___.LinkFileList -mmacosx-version-min=10.6 -lobjc -lpdcurses -lcurses -framework SDL -framework GLUT -framework Cocoa -framework OpenGL -framework SDL_ttf -o /Users/*******/c++/macosx/Client/ver1sdl/build/___PROJECTNAME___.build/Debug/___PROJECTNAME___.build/Objects-normal/i386/___PROJECTNAME___

ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/lib/libpdcurses.a, file is not of required architecture
Undefined symbols:
  "_pdc_yoffset", referenced from:
      _pdc_yoffset$non_lazy_ptr in main.o
  "_pdc_screen", referenced from:
      _pdc_screen$non_lazy_ptr in main.o
  "_PDC_set_title", referenced from:
      _SDL_main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Can anyone help me to solve this problem?

Code:
#include <curses.h>
#include <SDL/SDL.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
//#include "pdcsdl.h"

/* You could #include pdcsdl.h, or just add the relevant declarations 
 here: */


PDCEX SDL_Surface *pdc_screen;
PDCEX int pdc_yoffset;

int main(int argc, char **argv)
{
    char inp[60];
    int i, j, seed;
	
    seed = time((time_t *)0);
    srand(seed);
	
    /* Initialize SDL */
	
    if (SDL_Init(SDL_INIT_VIDEO) < 0)
        exit(1);
	
    atexit(SDL_Quit);
	
    pdc_screen = SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE|SDL_ANYFORMAT);
	
    /* Initialize PDCurses */
	
    pdc_yoffset = 416;  /* 480 - 4 * 16 */
	
    initscr();
    start_color();
    scrollok(stdscr, TRUE);
	
    PDC_set_title("PDCurses for SDL");
	
    /* Do some SDL stuff */
	
    for (i = 640, j = 416; j; i -= 2, j -= 2)
    {
        SDL_Rect dest;
		
        dest.x = (640 - i) / 2;
        dest.y = (416 - j) / 2;
        dest.w = i;
        dest.h = j;
		
        SDL_FillRect(pdc_screen, &dest, 
                     SDL_MapRGB(pdc_screen->format, rand() % 256,
                                rand() % 256, rand() % 256));
    }
	
    SDL_UpdateRect(pdc_screen, 0, 0, 640, 416);
	
    /* Do some curses stuff */
	
    init_pair(1, COLOR_WHITE + 8, COLOR_BLUE);
    bkgd(COLOR_PAIR(1));
	
    addstr("This is a demo of ");
    attron(A_UNDERLINE);
    addstr("PDCurses for SDL");
    attroff(A_UNDERLINE);
    addstr(".\nYour comments here: ");
    getnstr(inp, 59);
    addstr("Press any key to exit.");
	
    getch();
    endwin();
	
    return 0;
}
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT. The time now is 11:10 PM.


vBulletin skin developed by: eXtremepixels
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28