B
Bruce Schechter
I am quite experienced with vs.net 2003 and c# but fairly new to c++. I
have a test app in c++ that I need to compile for a c#/c++ interop
evaluation I'm doing.
But first, I simply need to compile some straightforward, non-managed,
console based c++ code. I created a win32 console c++ project. Then I
added several "existing" c++ .cpp and .h files. When I try to compile, I
get this error...
LIBCD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main
referenced in function _mainCRTStartup
Debug/player-cpp-only.exe : fatal error LNK1120: 1 unresolved externals
My player-cpp-only.cpp file contains "main()". The error above leads me to
believe something is going wrong in or near the file containing main(), so I
have included the contents of that file below.
Recommendations for debugging will be greatly appreciated.
Thanks, Bruce
// player-cpp-only.cpp
#include "player.h"
namespace nsPlayer
{
int main()
{
Player player( "Test Player", false );
DiskCollection disks( "disks.dat", "Bruce's Disk Collection" );
player.attachAC(true);
return 0;
}
}
have a test app in c++ that I need to compile for a c#/c++ interop
evaluation I'm doing.
But first, I simply need to compile some straightforward, non-managed,
console based c++ code. I created a win32 console c++ project. Then I
added several "existing" c++ .cpp and .h files. When I try to compile, I
get this error...
LIBCD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main
referenced in function _mainCRTStartup
Debug/player-cpp-only.exe : fatal error LNK1120: 1 unresolved externals
My player-cpp-only.cpp file contains "main()". The error above leads me to
believe something is going wrong in or near the file containing main(), so I
have included the contents of that file below.
Recommendations for debugging will be greatly appreciated.
Thanks, Bruce
// player-cpp-only.cpp
#include "player.h"
namespace nsPlayer
{
int main()
{
Player player( "Test Player", false );
DiskCollection disks( "disks.dat", "Bruce's Disk Collection" );
player.attachAC(true);
return 0;
}
}