I'm trying to install allegro on VC++ using these instructions
http://wiki.allegro.cc/Visual_C%2B%2B_Express_2005
This is the error I'm getting.
| 1 | 1>------ Build started: Project: please, Configuration: Debug Win32 ------ |
| 2 | 1>Compiling... |
| 3 | 1>main.cpp |
| 4 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\internal\alconfig.h(395) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size |
| 5 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\internal\alconfig.h(402) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size |
| 6 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(421) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size |
| 7 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(435) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size |
| 8 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(446) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size |
| 9 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(460) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size |
| 10 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(471) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size |
| 11 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(485) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size |
| 12 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(521) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned int *' of greater size |
| 13 | 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(535) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned int *' of greater size |
| 14 | 1>Linking... |
| 15 | 1>main.obj : error LNK2019: unresolved external symbol __imp__allegro_message referenced in function "int __cdecl _mangled_main(void)" (?_mangled_main@@YAHXZ) |
| 16 | 1>main.obj : error LNK2019: unresolved external symbol __imp___install_allegro_version_check referenced in function "int __cdecl _mangled_main(void)" (?_mangled_main@@YAHXZ) |
| 17 | 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup |
| 18 | 1>C:\Users\Wala-Neh\Documents\Visual Studio 2005\Projects\please\Debug\please.exe : fatal error LNK1120: 3 unresolved externals |
| 19 | 1>Build log was saved at "file://c:\Users\Wala-Neh\Documents\Visual Studio 2005\Projects\please\please\Debug\BuildLog.htm" |
| 20 | 1>please - 4 error(s), 10 warning(s) |
| 21 | ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
I searched the forums and found someone that had the exact same problem in 2005 but it didn't look like the answer was given to the problem.
My code is
#include <allegro.h> int main(void) { allegro_init(); allegro_message("Hello World!"); return 0; } END_OF_MAIN();
Thanks.
If you ask me, you would need to configure the VC project to be a 32-bit code instead of 64. However, I don't use VC++ 2005, so it is just a supposition based on a previous comment I recall.
Make sure you are using the Windows Subsystem (linker settings).
Thanks, errors are getting less it changed from what I have above to
1>------ Build started: Project: ohhh, Configuration: Debug Win32 ------ 1>Linking... 1>code.obj : error LNK2019: unresolved external symbol __imp__allegro_message referenced in function "int __cdecl _mangled_main(void)" (?_mangled_main@@YAHXZ) 1>code.obj : error LNK2019: unresolved external symbol __imp___install_allegro_version_check referenced in function "int __cdecl _mangled_main(void)" (?_mangled_main@@YAHXZ) 1>code.obj : error LNK2019: unresolved external symbol __imp___WinMain referenced in function _WinMain@16 1>C:\Users\Wala-Neh\Documents\Visual Studio 2005\Projects\ohhh\Debug\ohhh.exe : fatal error LNK1120: 3 unresolved externals
Which was at the bottom of the first error. Any ideas, thanks.
My guess is that you did not add Allegro to the list of libraries to link against.
Thanks verrrry much.
Yea when I start every new program it looks like I have to make sure I set the linking options to what is noted below.
Under Configuration Properties / Linker / Input, add alld.lib to Additional Dependencies.
That took away the winmain error. I'm still getting the warnings concerning
conversion from int to char.
1>c:\program files\microsoft visual studio 8\vc\include\allegro\internal\alconfig.h(395) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size 1>c:\program files\microsoft visual studio 8\vc\include\allegro\internal\alconfig.h(402) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(421) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(435) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(446) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(460) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(471) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(485) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(521) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned int *' of greater size 1>c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(535) : warning C4312:
But I'm not going to worry about it because it allowed my program to compile and I was able to execute my code. Hopefully those warnings don't come back to haunt me. I hope not, anyways thanks alot, yea I can successfully compile code and run it, I thought I was stuck on Vista without allegro. I'm soo excited I can now resume my programming, yess.
Setting "C/C++ / Detect 64-bit Portability Issues" to "No" might help.
Wow you are good, that was it.
Thanks again
Hah, I was close