[Verse-dev] Building Verse on Win32 (gcc)

Florian Eggenberger florian.eggenberger at gmail.com
Tue Apr 19 13:41:52 CEST 2005


Hi TJay,

I've done this successfully some time ago.
Linker errors on Cygwin often occur when you mix up Cygwin linked apps
and native Win32 linked apps.
Try to use the following switches to compile without that cygwin1.dll
-mno-cygwin
-mwindows
... and probably...
-mconsole

I can't remember all the details right now and the sources are at home.. :-)
There are some more minor issues but it is definitely possible.

Do not forget that your application that will be linked against
verselib must also be compiled with those switches.

Yes, I can remember some winsock issues but not the details.

Florian

On 4/19/05, TJay <tjay.dreaming at gmail.com> wrote:
> Hi it's me again :) I've tried to compile Verse by typing "make" at
> the shell, but the linker always gives me "undefined references"
> errors when linking the v_network.c file. I've tried this on Cygwin
> and MinGW's MSYS, as well as from the Windows Command Prompt. None of
> them worked. I get a "libverse.a" file which is 800-900KB in size, but
> linking it with my test Verse app gives me "undefined references" for
> all Verse API functions that I call, so I assume that the library did
> not compile correctly.
> 
> Using Dev-Cpp I can compile it without any errors being reported, by
> creating a new "Static Lib" project and importing all the verse source
> files and compiling. However the compiled libverse.a file is only
> ~150KB in size, and it also does not work.
> 
> I thought gcc might be forgetting to link in the libwsock32.a file, so
> I tried editing the Verse makefile and placing "-lwsock32" to the CC
> line, but that didn't work. I then proceeded to add all kinds of
> libraries to that same line, like "libws2_32", etc etc. I even tried
> replacing winsock.h in the source file with winsock2.h and linking
> with the Winsock2 library. Nothing worked.
> 
> Has anyone built Verse successfully on windows with gcc? Can you tell
> me how? Or is there a pre-compiled verse library that I could use?
> 
> Sorry if this seems like a really silly question, I'm terrible at this...
> 
> Anyways cheers! ;)
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Here are the errors gcc reported: (there were several warnings like
> "enum not used in switch statement..." before this point, but I don't
> think they really matter.)
> 
> libverse.a(v_network.o)(.text+0x57): In function `v_n_socket_create':
> C:/msys/1.0/home/TJay/verse/v_network.c:70: undefined reference to
> `WSAStartup at 8'
> libverse.a(v_network.o)(.text+0xa5):C:/msys/1.0/home/TJay/verse/v_network.c:79:
> undefined reference to `socket at 12'
> libverse.a(v_network.o)(.text+0xee):C:/msys/1.0/home/TJay/verse/v_network.c:84:
> undefined reference to `ioctlsocket at 12'
> libverse.a(v_network.o)(.text+0x119):C:/msys/1.0/home/TJay/verse/v_network.c:92:
> undefined reference to `htons at 4'
> libverse.a(v_network.o)(.text+0x143):C:/msys/1.0/home/TJay/verse/v_network.c:94:
> undefined reference to `bind at 12'
> libverse.a(v_network.o)(.text+0x1b7): In function `v_n_socket_destroy':
> C:/msys/1.0/home/TJay/verse/v_network.c:105: undefined reference to
> `closesocket at 4'
> libverse.a(v_network.o)(.text+0x239): In function `v_n_set_network_address':
> C:/msys/1.0/home/TJay/verse/v_network.c:125: undefined reference to
> `gethostbyname at 4'
> libverse.a(v_network.o)(.text+0x277):C:/msys/1.0/home/TJay/verse/v_network.c:128:
> undefined reference to `htonl at 4'
> libverse.a(v_network.o)(.text+0x2d3): In function `v_n_send_data':
> C:/msys/1.0/home/TJay/verse/v_network.c:142: undefined reference to `htons at 4'
> libverse.a(v_network.o)(.text+0x2e7):C:/msys/1.0/home/TJay/verse/v_network.c:143:
> undefined reference to `htonl at 4'
> libverse.a(v_network.o)(.text+0x33f):C:/msys/1.0/home/TJay/verse/v_network.c:150:
> undefined reference to `sendto at 24'
> libverse.a(v_network.o)(.text+0x3ed): In function `v_n_wait_for_incoming':
> C:/msys/1.0/home/TJay/verse/v_network.c:170: undefined reference to `select at 20'
> libverse.a(v_network.o)(.text+0x446): In function `v_n_receive_data':
> C:/msys/1.0/home/TJay/verse/v_network.c:185: undefined reference to `htons at 4'
> libverse.a(v_network.o)(.text+0x487):C:/msys/1.0/home/TJay/verse/v_network.c:187:
> undefined reference to `recvfrom at 24'
> libverse.a(v_network.o)(.text+0x49b):C:/msys/1.0/home/TJay/verse/v_network.c:188:
> undefined reference to `ntohl at 4'
> libverse.a(v_network.o)(.text+0x4af):C:/msys/1.0/home/TJay/verse/v_network.c:189:
> undefined reference to `ntohs at 4'
> collect2: ld returned 1 exit status
> make: *** [verse] Error 1
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> ~ TJay in Trouble ~
> _______________________________________________
> Verse-dev mailing list
> Verse-dev at projects.blender.org
> http://projects.blender.org/mailman/listinfo/verse-dev
>


More information about the Verse-dev mailing list