Question:
fatal error LNK1120: 1 unresolved externals!!!!!?
Len
2011-08-27 19:04:01 UTC
I recently bought microsoft visual studio 2008 but when I try to compile my code (in c++) using win32 console application it says, "fatal error LNK1120: 1 unresolved externals!!!!!"The problem is I knew my code is totally right as it works with my code::blocks. Probably it was on the linker but I don't know how to solve it.Your help would be appreciated.
Six answers:
samofcalifornia
2011-08-27 23:08:21 UTC
The most important information that is needed if you want a more precise answer is the complete and accurate error message; in this situation, it is actually the complete and accurate LNK2001 message. You did not provide that.



Somewhere in the error message it says what is not resolved. Assuming that it is a Windows API function, you need to look at the documentation of that function in the MSDN; it will tell you what library you need. If it is a Windows API function then you probably do not need to add a directroy to the list of external library directories, but you will need to add a library to the list of libraries to be used for the project.
sunseri
2016-09-30 10:30:26 UTC
Fatal Error Lnk1120 1 Unresolved Externals
nadem
2016-12-26 20:59:05 UTC
Lnk1120 1 Unresolved Externals
2015-08-12 02:21:36 UTC
This Site Might Help You.



RE:

fatal error LNK1120: 1 unresolved externals!!!!!?

I recently bought microsoft visual studio 2008 but when I try to compile my code (in c++) using win32 console application it says, "fatal error LNK1120: 1 unresolved externals!!!!!"The problem is I knew my code is totally right as it works with my code::blocks. Probably it was on the...
Yuko
2011-08-27 22:24:26 UTC
It probably is a problem with the linker. Go to project - properties - configuration properties - linker to see the linker settings. Modify General - Additional Library Directories if you need to add a directory where your libraries to be included are located. Modify Input - Additional Dependencies to include libraries you need to link to. Make sure that all libraries and library directories have been incorporated into your project.



If this doesn't solve the problem, it might help to see the code. :)

good luck.
2016-03-17 03:25:45 UTC
You need to write the above program as a Console or DOS application. (Not Win32) A Console or DOS application has a main() whereas a Windows Application has a WinMain() Since you made it a Win32 application it is looking for WinMain. Make it console application and it will run.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...