Thread: Linking error I don't understand

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    4

    Linking error I don't understand

    I am working on a program for a class, it compiles but when I try and run it it gives me a compile error. Anybody know what I am doing wrong. By the way, I haven't yet put in the fuction call to the output function yet, I want to get the imput an the sort function working first.

    I have attached the code

  2. #2
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    What I do not understand is that you say it compiles and gives you a compile error. It is either one or the other...
    Blue

  3. #3
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    I do not get a compile, link, or runtime error with the code as written using Borland Turbo 5.5.1,

    You should allow the user to quit after entering a name and semester grades so that if they do not want to keep entering students, they do not have to....
    Blue

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    4

    I meant linking error

    Thanks for replying to my post. I am using MS Visual C++ and although it compiles, I get a linking error. Here is what I get:

    Compiling...
    Skipping... (no relevant changes detected)
    Assignment 3a.cpp

    Assignment 3a.obj - 0 error(s), 0 warning(s)

    Linking...
    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
    Debug/Assingment 3a.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    Assingment 3a.exe - 2 error(s), 0 warning(s)

  5. #5
    Registered User
    Join Date
    Jan 2002
    Posts
    559
    Maybe you have some of your libraries in a different spot than the linker is looking for. I use MSVC++ 6.0 and it compiled, linked and ran fine on my machine. I'm not sure where the default libraries are supposed to be, but check the documentation.

  6. #6
    It works perfectly for me in Microsoft Visual C++ 6.0.

    Try compiling it as a console program rather than as a Win32 application. "LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 " usually indicates it is looking for the function "WinMain()" which is equivalent to "main()" in a console application.
    What will people say if they hear that I'm a Jesus freak?
    What will people do if they find that it's true?
    I don't really care if they label me a Jesus freak, there is no disguising the truth!

    Jesus Freak, D.C. Talk

    -gnu-ehacks

  7. #7
    Registered User
    Join Date
    Feb 2002
    Posts
    4

    Talking Found the problem

    Thanks for all the help you guys gave me. It looks like I FUBARed my compiler. That's what I get for trying to upgrade my compiler using Bearshare

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems linking with g++
    By Just in forum Linux Programming
    Replies: 11
    Last Post: 07-24-2006, 01:35 AM
  2. strange linking error -- can not find shared library
    By George2 in forum C Programming
    Replies: 2
    Last Post: 07-10-2006, 10:51 PM
  3. Replies: 8
    Last Post: 04-27-2006, 10:39 AM
  4. Grrr.... SDL Linking Problem
    By 7EVEN in forum Game Programming
    Replies: 5
    Last Post: 08-12-2005, 08:44 PM
  5. Linking error with DirectDrawCreateEx
    By jjj93421 in forum Game Programming
    Replies: 6
    Last Post: 04-06-2004, 03:57 PM