Reputation: 565
I have been trying for several hours now to link allegro 4.4 with visual studio 2010. I am using microsoft visual C++ 2010 express edition. Here is what I did:
I downloaded the windows binaries from http://www.allegro.cc/files/?v=4.4 (I downloaded the MSVC 2010 one)
I extracted the three folders in the zip archive to the following location "C:\allegro"
I launched MSVC and created a new windows console application
I created a main.cpp file
In the project properties I went to VC++ directories and set Include Directories to "C:\allegro\include"
In VC++ directories I set Library Directories to "C:\allegro\lib"
In Linker->Input I added "allegro-4.4.2-md.lib" to the additional dependencies.
In Configuration Properties->Debugging I set 'enviorment' to "PATH=c:\allegro\bin;%PATH%"
I applied all the changes and entered this simple program into main.cpp
#include <allegro.h>
int main()
{
return 0;
}
END_OF_MAIN();
When I tried to debug it I got two errors Error 1 error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
and Error 2 error LNK1120: 1 unresolved externals
I've been pulling my hair out in frustration! Can someone please help me out or point me in the right direction?
Upvotes: 3
Views: 3936
Reputation: 10971
You need to add this Project Properties->Linker->Input->Additional Dependencies: edit and add the following alld.lib
Upvotes: 1
Reputation: 565
Well I feel like an idiot now but I figured it out after reading http://www.allegro.cc/manual/4/miscellaneous/frequently-asked-questions-(faq)/windows-problems/d4cf0624ded68003a11b4892102bbc66. I realized the problem is that I created a console application rather than a window application. I fixed this by going to Configuration Properties -> Linker -> System and setting SubSystem to "Windows (/SUBSYSTEM:WINDOWS)" I hope this helps any else who runs into this problem.
Upvotes: 1