Having trouble Building a Multiple files program - Programmers Heaven

Howdy, Stranger!

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

Categories

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.