Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED] undefined reference to `socket@12'|  (Read 9075 times)

0 Members and 1 Guest are viewing this topic.

Spellbreaker

  • Newbie
  • *
  • Posts: 33
    • ICQ Messenger - 287156171
    • MSN Messenger - spellbreaker@live.de
    • Yahoo Instant Messenger - Spellbreaker1979
    • View Profile
    • http://www.apeironstudios.com
[SOLVED] undefined reference to `socket@12'|
« on: September 22, 2010, 09:18:05 am »
Hi there!

I just downloaded SFML 2 SVN, built the libs, and when I want to compile my little network test, the following Error appears:

...undefined reference to `socket@12'|


and a bunch of other undefined references.

I am linking statically to system, network and wsock32, using mingw/gcc 4.5

Thanks in Advance.


Spellbreaker

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED] undefined reference to `socket@12'|
« Reply #1 on: September 22, 2010, 09:38:42 am »
You must link to ws2_32 instead of wsock32. You can also use the batch-build or CMake, both will integrate the external dependencies directly into the SFML static libraries.
Laurent Gomila - SFML developer

Spellbreaker

  • Newbie
  • *
  • Posts: 33
    • ICQ Messenger - 287156171
    • MSN Messenger - spellbreaker@live.de
    • Yahoo Instant Messenger - Spellbreaker1979
    • View Profile
    • http://www.apeironstudios.com
[SOLVED] undefined reference to `socket@12'|
« Reply #2 on: September 22, 2010, 09:47:56 am »
Ah okay.

I have problems with batch-build ( codeblocks ). Sometimes it simply hangs, so I compiled sfml using the codeblocks workspace. But now it works, thanks :)

Spellbreaker

  • Newbie
  • *
  • Posts: 33
    • ICQ Messenger - 287156171
    • MSN Messenger - spellbreaker@live.de
    • Yahoo Instant Messenger - Spellbreaker1979
    • View Profile
    • http://www.apeironstudios.com
[SOLVED] undefined reference to `socket@12'|
« Reply #3 on: September 22, 2010, 09:49:52 am »
sorry, doesn't work with ws2_32 either :| Do I have to use a specific order for the libs?

Spellbreaker

  • Newbie
  • *
  • Posts: 33
    • ICQ Messenger - 287156171
    • MSN Messenger - spellbreaker@live.de
    • Yahoo Instant Messenger - Spellbreaker1979
    • View Profile
    • http://www.apeironstudios.com
[SOLVED] undefined reference to `socket@12'|
« Reply #4 on: September 22, 2010, 10:12:34 am »
Seems to be a C::B problem, I inserted a "pause" after every code::blocks call, now it compiles without problems.

Don't know why....

Thanks again :)

 

anything