Archived

This topic is now archived and is closed to further replies.

Tempest

Linker error

Recommended Posts

Tempest    138
Guys, I''m having a hard time figuring out a linker error. I started out just trying to write a program to display some text on a screen, and when I couldn''t figure that out, I tried a simple Hello World, and still didn''t work. Now I''m down to trying to get this to work: #include <iostream> int main() { return 0; } I keep getting this error: --------------------Configuration: ProgramThatWontWork - Win32 Debug-------------------- Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/ProgramThatWontWork.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. ProgramThatWontWork.exe - 2 error(s), 0 warning(s) I''ve even tried to get the #include <iostream> to link by itself. I also tried it with the .h, among other things. It''s got to be something stupid I''m missing. Why shouldn''t this work? I created a new Win32 application, surely I don''t have to add anything to it to get it work, right? I figure the libraries should already be included for a program this simple. I''m using MSVC 6 Thanks

Share this post


Link to post
Share on other sites
Martee    476
Try creating a new Win32 console application. WinMain is the entry point for normal Win32 apps, and that''s what the linker is looking for. Console apps have an entry point of main(), which is exactly what you want.

Share this post


Link to post
Share on other sites