# error LNK2019 & fatal error LNK1120 - SOLVED!

## Recommended Posts

Okay. Just a quick background. I'm in school currently for game design. My strongest coding knowledge lays with VB, and that is pretty weak in itself. So please, when answering try to use simple terms? ^^; (be gentle, i'm still learning) Problem Info (enough about me) I have only added two lines of code to a demo file brought in from the Ogre SDK folder. At first, I had the error where it couldn't find windows.h. I fixed that by installing Platform SDK and ended up having to move the bin, include, and lib folders from there into the Virtual Studio directory. Here's the full error I'm getting now. I have cleaned and rebuilt the file ----------------- 1>Linking... 1>Terrain.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function __catch$_WinMain@16$0 1>..\..\bin\Debug/Demo_Terrain.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\OgreSDK\samples\obj\Debug\BuildLog.htm" 1>Demo_Terrain - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ----------------- Please help if able. I'm already behind. If I can't get it fixed I'll have to wait till next week and I'll be even more behind. Thanks! [Edited by - Winterborne on March 25, 2008 10:05:46 AM]

##### Share on other sites
have you included Msgbox.lib to you libraries?

Peter Wraae Marino

##### Share on other sites
hmmm... that would be a no. How or where do I get this file and where do I need to put it exactly?

##### Share on other sites
Usually you would let the platform sdk where it's installed by default and set the path in Visual Studio under tools > options > project and solution > vc++ directories for both include and lib files. Then, if the paths are ok it should find windows.h and the necessary lib files for the messagebox function.

Note that for me the platform sdk went automatically under
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
and added the paths correctly in the settings by itself. I wonder what you did with yours..

And I don't think there's any msgbox.lib...

##### Share on other sites
I just let it install where it did as a default. The place where yours is is where those files are now, i just had to create it. I have 2005 Express and I found the fix to do it like that on the msdn webside, which i might add had been useless up until that point.

I've noticed that a lot of people have problems with Express versions, and i would get the real version if I weren't a poor, broke student. XD So until I get a job that pays more than what I have (preferably in my field) then I just have to make do with what I have.

##### Share on other sites
The remaining instructions here should fix your problem, or if you upgrade to 2008 Express, which (at least for the web installer version) Microsoft was smart enough to include the platform SDK into.

It's not named msgbox.lib, but it should be one of the libraries you deal with in Step 4 of those linked instructions, which should fix your problem.

##### Share on other sites
Thanks for the help. I'd upgrade, but unfortunately, Ogre SDK hasn't made a compatible version. ^^;

EDIT: OMG! it worked! so far anyway, now to fix the other problems i have elsewhere lol! Thanks!

[Edited by - Winterborne on March 25, 2008 10:17:14 AM]

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627700
• Total Posts
2978695

• 21
• 14
• 12
• 10
• 12