Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Newbie with problem getting stuff to link.

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    3

    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)

  2. #2
    Junior Member Regular Contributor
    Join Date
    Oct 2002
    Location
    King George, Virginia
    Posts
    138

    Re: Newbie with problem getting stuff to link.

    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

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: Newbie with problem getting stuff to link.

    The library for the Winsock stuff is ws2_32.lib if I recall correctly.
    Deiussum
    Software Engineer and OpenGL enthusiast

  4. #4
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    3

    Re: Newbie with problem getting stuff to link.

    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
    Code :
    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

  5. #5
    Junior Member Regular Contributor
    Join Date
    Nov 2001
    Location
    Malaysia
    Posts
    112

    Re: Newbie with problem getting stuff to link.

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

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    3

    Re: Newbie with problem getting stuff to link.

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •