Author Topic: Yet Another SDL newb  (Read 5080 times)

Offline sj2000

  • Single posting newcomer
  • *
  • Posts: 3
Yet Another SDL newb
« on: June 29, 2006, 02:50:42 pm »
I've just switched to c::b from DevC++ and im trying to compile an SDL_net example from SDLnet (Official).
I've originally installed the C::B with MingW and then installed/copied the nightly build 29062006 over it sucessfully.
I've tried searching the forum for any other solutions to my problem.
It doesn't seem to be picking up the SDLnet libs or anything.
Code
.objs\chatd.o:chatd.c:(.text+0x10): undefined reference to `SDLNet_TCP_Accept'
.objs\chatd.o:chatd.c:(.text+0xaf): undefined reference to `SDLNet_TCP_Send'
.objs\chatd.o:chatd.c:(.text+0xcf): undefined reference to `SDLNet_DelSocket'
.objs\chatd.o:chatd.c:(.text+0xe6): undefined reference to `SDLNet_TCP_Close'
.objs\chatd.o:chatd.c:(.text+0x116): undefined reference to `SDLNet_TCP_Send'
.objs\chatd.o:chatd.c:(.text+0x121): undefined reference to `SDLNet_TCP_Close'
.objs\chatd.o:chatd.c:(.text+0x149): undefined reference to `SDLNet_TCP_GetPeerAddress'
.objs\chatd.o:chatd.c:(.text+0x17a): undefined reference to `SDLNet_AddSocket'
.objs\chatd.o:chatd.c:(.text+0x273): undefined reference to `SDLNet_TCP_Send'
.objs\chatd.o:chatd.c:(.text+0x2a7): undefined reference to `SDLNet_TCP_Recv'
.objs\chatd.o:chatd.c:(.text+0x33c): undefined reference to `SDLNet_TCP_Send'
.objs\chatd.o:chatd.c:(.text+0x366): undefined reference to `SDLNet_DelSocket'
.objs\chatd.o:chatd.c:(.text+0x37d): undefined reference to `SDLNet_TCP_Close'
.objs\chatd.o:chatd.c:(.text+0x4c8): undefined reference to `SDLNet_TCP_Close'
.objs\chatd.o:chatd.c:(.text+0x4e8): undefined reference to `SDLNet_FreeSocketSet'
.objs\chatd.o:chatd.c:(.text+0x4f7): undefined reference to `SDLNet_Quit'
.objs\chatd.o:chatd.c:(.text+0x54f): undefined reference to `SDLNet_Init'
.objs\chatd.o:chatd.c:(.text+0x5cb): undefined reference to `SDLNet_AllocSocketSet'
.objs\chatd.o:chatd.c:(.text+0x621): undefined reference to `SDLNet_ResolveHost'
.objs\chatd.o:chatd.c:(.text+0x647): undefined reference to `SDLNet_TCP_Open'
.objs\chatd.o:chatd.c:(.text+0x698): undefined reference to `SDLNet_AddSocket'
.objs\chatd.o:chatd.c:(.text+0x6ad): undefined reference to `SDLNet_CheckSockets'
collect2: ld returned 1 exit status
I've tried put the SDLnet lib/src directory into the appropriate linker/compiler options but doesn't seem to make any difference. Yes, the SDLnet DLL are within the project plus available in %WINDIR%.
What have I missed?
Using: SDL-1.2.11 nd SDLnet-1.2.6 (SDLnet is same directory as SDL in include etc.)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Yet Another SDL newb
« Reply #1 on: June 29, 2006, 03:01:02 pm »
I've originally installed the C::B with MingW and then installed/copied the nightly build 29062006 over it sucessfully.
This is not possible. Search the forum for how often this caused major trouble and undefined states.
Please, never ever copy a nightly on top of a RCx build.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline sj2000

  • Single posting newcomer
  • *
  • Posts: 3
Re: Yet Another SDL newb
« Reply #2 on: June 30, 2006, 09:13:58 am »
What I should of said is, the problem was occuring so I put the nightly build over it.
The problem still occured even when I didn't have the nightly build. I'll remove it
« Last Edit: June 30, 2006, 09:22:15 am by sj2000 »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Yet Another SDL newb
« Reply #3 on: June 30, 2006, 09:40:56 am »
Since your post does not contain anything like "no such file" (and I trust you would have posted that), we can assume that the linker actually finds the library, so it is not a path problem.

Therefore, it could be a function name problem (Unicode/non-Unicode, etc). Have you made sure you're using the correct build flags (as they would come from sdl-config)?
If nothing helps, it may help to compile your project once more with Dev-CPP and to look at the commandline shown in the log window. Very likely, you will see one or two constants (commandline parameter starting with -D)that aren't in present in the build when you use Code::Blocks. Add them, and you'll very likely be fine.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."