View Full Version : Somebody know about?
09-07-2002, 06:57 PM
while compiling my programme i found the following message,
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/mahmood.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
If someone has idea about it?
thanks for your time.
Rob The Bloke
09-07-2002, 08:29 PM
Yup, I guess you are trying to compile a console application and have used main(), however the project is set up as a Win32 Application and is looking for the windows entry point WinMain().
09-08-2002, 06:35 AM
There is a way round this though... well, if in VisualC++ 6.0.
Place this at the beginning of your win32 app (all in one line that is) and it will let it run with no problems... as main() though.
#pragma comment( linker, "/entry:\"mainCRTStartup\"" )
Then set the entry point to something like the following:
int main(int argc, char **argv)
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Works wonderfully, and whats good is that you can easily port this to a console app later on by just removing the pragma command.
09-08-2002, 10:49 PM
i tried to compile in the console mode and this time i got a new problem, like this
fatal error C1083: Cannot open include file
What might be the possible cause. Any suggestion or help is appreciated.
09-09-2002, 04:40 AM
What include file did it specify? Does this file exist in the include directory of the compiler or listed amongst the directories to use for the include files within the IDE?
I've only known this type of problem to occur when the compiler doesn't know where the file is or the file really isn't there.
Maybe you took an example from a different operating system that has a special set of header files like unix and unistd.h for example.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.