Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Having trouble Building a Multiple files program

Iv been reading a book called "Game Programming All In One". Iv just gotten into using multiple files togather like headers and source and such. I can't figure out whats wrong and I can't go any further in the book till I get this figured out. The error IM getting reads as follows.

--------------------Configuration: Multiple Files Program - Win32 Debug--------------------
Compiling...
Source.cpp
Source 02.cpp
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Multiple Files Program.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Multiple Files Program.exe - 2 error(s), 0 warning(s)

Anyone have any Idia what wrong with this please help??

Comments

  • Binesh AndrewsBinesh Andrews Posts: 5Member
    : Iv been reading a book called "Game Programming All In One". Iv just gotten into using multiple files togather like headers and source and such. I can't figure out whats wrong and I can't go any further in the book till I get this figured out. The error IM getting reads as follows.
    :
    : --------------------Configuration: Multiple Files Program - Win32 Debug--------------------
    : Compiling...
    : Source.cpp
    : Source 02.cpp
    : Linking...
    : LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
    : Debug/Multiple Files Program.exe : fatal error LNK1120: 1 unresolved externals
    : Error executing link.exe.
    :
    : Multiple Files Program.exe - 2 error(s), 0 warning(s)
    :
    : Anyone have any Idia what wrong with this please help??
    :
    In c++ the program will compile if there is exactly one main() in the program. The program execution starts at the main() and can have any number of end points. The error may be due to the presence of more than one main in the program or due to the absence of one.
    A simple method to resolve this problem is:
    if you want to link source.cpp and source02.cpp; strip of the main part of one of these programs and save the program as a .h file. # include this file in the other and use the routines defined in the first.

    Wish you all the best,
    Binesh Andrews
    :

Sign In or Register to comment.