Newbie with problem getting stuff to link.

Howdy. I’ve been given a bunch of code from someone else and I’ve never been able to get it to link. I guess that means that it can compile okay, but when it comes time to linking, no dice.

I’ve used a whole bunch of different compilers, most notably g++ (through Cygwin) and Visual Studio 6.0, both on Windows 2000. When I try to link, Visual Studio spits out the error messages at the bottom of this posting.

I did a text search for _fontLoad on my hard drive, and it turned up in glTexFont.lib. Can Visual Studio use this file? I tried putting the parent directory of glTexFont.lib in Tools --> Options --> Directories --> Library Files, but that still didn’t make any difference. I still get the same output below.

Any idea of what I’m doing wrong? Please help! Thanks very much!

--------------------Configuration: Client1 - Win32 Debug--------------------
Linking…
display.obj : error LNK2001: unresolved external symbol _fontLoad
graphics.obj : error LNK2001: unresolved external symbol _fontLoad
pics.obj : error LNK2001: unresolved external symbol _fontDrawString
pics.obj : error LNK2001: unresolved external symbol _fontShadow
pics.obj : error LNK2001: unresolved external symbol _fontShadowColorp
pics.obj : error LNK2001: unresolved external symbol _fontColorp
pics.obj : error LNK2001: unresolved external symbol _fontSize
user.obj : error LNK2001: unresolved external symbol __imp__connect@12
user.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
user.obj : error LNK2001: unresolved external symbol __imp__htons@4
user.obj : error LNK2001: unresolved external symbol __imp__socket@12
user.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8
user.obj : error LNK2001: unresolved external symbol __imp__recv@16
user.obj : error LNK2001: unresolved external symbol __imp__send@16
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/ORFClient1.exe : fatal error LNK1120: 14 unresolved externals
Error executing link.exe.

ORFClient1.exe - 16 error(s), 0 warning(s)

it appears you are missing a few things. first, in Project->Settings under the Link tab, put the name of your font .lib file in there with the other libraries. you also need to add the library with all the socket calls in them. search the VC++ help for that lib. finally, if this program has a main(), then you need to recreate your project as a Win32 Console Application instead of Win32 Application. if this is the case, do that then add the libraries to the project.

jebus

The library for the Winsock stuff is ws2_32.lib if I recall correctly.

Awesome! It worked! Thanks! You guys were right – I had to make some changes in the project settings.

But now, when I run the .exe, I get the stuff at the bottom. Any idea if it’s because some image files and so forth are in the wrong place? Is it possible to tell whether I just need to tweak some more project settings? I copied over the image files and font file that were sitting in the same directory as an already-built version of the program (which I received already built, I didn’t compile and link it myself), but that didn’t make any difference. Still this same error. And

str != NULL

isn’t anywhere in the source code.

Debug Assertion Failed!

Program: blah blah blah\ORFClient2.exe
File: fseeki64.c
Line: 104

Expression: str != NULL

For more information, blah blah blah…
Abort Retry Ignore

Just click retry and select appropriate context from drop down list at variables window. Then you’ll know where’s your problem is.

Okay, I think that solved it. The pictures the client was trying to load were not in the right place. Thanks very much for everyone’s help!