Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Problem installing allegro in VC++url2005

Credits go to Matthew Leverton and ReyBrujo for helping out!
This thread is locked; no one can reply to it. rss feed Print
Problem installing allegro in VC++url2005
superstar4410
Member #926
January 2001
avatar

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.

11>------ Build started: Project: please, Configuration: Debug Win32 ------
21>Compiling...
31>main.cpp
41>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
51>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
61>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
71>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
81>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
91>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
101>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
111>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
121>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
131>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
141>Linking...
151>main.obj : error LNK2019: unresolved external symbol __imp__allegro_message referenced in function "int __cdecl _mangled_main(void)" (?_mangled_main@@YAHXZ)
161>main.obj : error LNK2019: unresolved external symbol __imp___install_allegro_version_check referenced in function "int __cdecl _mangled_main(void)" (?_mangled_main@@YAHXZ)
171>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
181>C:\Users\Wala-Neh\Documents\Visual Studio 2005\Projects\please\Debug\please.exe : fatal error LNK1120: 3 unresolved externals
191>Build log was saved at "file://c:\Users\Wala-Neh\Documents\Visual Studio 2005\Projects\please\please\Debug\BuildLog.htm"
201>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.

Don't take yourself too seriously, but do take your responsibilities very seriously.

ReyBrujo
Moderator
January 2001
avatar

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.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Matthew Leverton
Supreme Loser
January 1999
avatar

Make sure you are using the Windows Subsystem (linker settings).

superstar4410
Member #926
January 2001
avatar

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.

Don't take yourself too seriously, but do take your responsibilities very seriously.

ReyBrujo
Moderator
January 2001
avatar

My guess is that you did not add Allegro to the list of libraries to link against.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

superstar4410
Member #926
January 2001
avatar

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. :)

Don't take yourself too seriously, but do take your responsibilities very seriously.

Matthew Leverton
Supreme Loser
January 1999
avatar

Setting "C/C++ / Detect 64-bit Portability Issues" to "No" might help.

superstar4410
Member #926
January 2001
avatar

Wow you are good, that was it.
Thanks again ;D

Don't take yourself too seriously, but do take your responsibilities very seriously.

ReyBrujo
Moderator
January 2001
avatar

Hah, I was close :P

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Go to: