Visual Studio 2005 Professional + Allegro
Hansie

My first post!

I installed Allego and am using Visual Studio 2005 Professional + DirectX SDK and all that good stuff. I changed my project / solution settings and made sure everything was done as per other topics on this forum.

I get this when I build sample code:

1>------ Rebuild All started: Project: ProtoType, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'ProtoType', configuration 'Release|Win32'
1>Compiling...
1>Main.cpp
1>c:\allegro\include\allegro\internal/alconfig.h(395) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
1>c:\allegro\include\allegro\internal/alconfig.h(402) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
1>c:\allegro\include\allegro\inline/draw.inl(421) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
1>c:\allegro\include\allegro\inline/draw.inl(435) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
1>c:\allegro\include\allegro\inline/draw.inl(446) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
1>c:\allegro\include\allegro\inline/draw.inl(460) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
1>c:\allegro\include\allegro\inline/draw.inl(471) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
1>c:\allegro\include\allegro\inline/draw.inl(485) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
1>c:\allegro\include\allegro\inline/draw.inl(521) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned int *' of greater size
1>c:\allegro\include\allegro\inline/draw.inl(535) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned int *' of greater size
1>Linking...
1>fatal error C1047: The object or library file 'C:\allegro\lib\alleg_s.lib' was created with an older compiler than other objects; rebuild old objects and libraries
1>LINK : fatal error LNK1257: code generation failed
1>Build log was saved at "file://c:\allegro\Game\ProtoType\ProtoType\Release\BuildLog.htm"
1>ProtoType - 1 error(s), 10 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Forget the warnings; my Allegro is set to c:\allegro. I added the additional dependencies, added the lib folder to additional lib and added includes to additional includes etc. Building RELEASE / STATIC

This is the part that bugs me:

"fatal error C1047: The object or library file 'C:\allegro\lib\alleg_s.lib' was created with an older compiler than other objects; rebuild old objects and libraries"

I downloaded the latest binaries for Win32 on this forum, and am a little confused as to why this happens. I already browsed the forum and tried google, but I know I missed something somewhere! ::) Advice?

Matthew Leverton

The warnings are due to 64-bit portability warnings being enabled. You can disable those in your settings.

Regarding the error, some people get that. The files here were built with VC++ 2005 Express, which must be using a slightly older compiler version than whatever precise version of 2005 you have. But they do work on my copy of 2005 Professional, so it could just be Microsoft playing tricks on us.

Hansie

I downloaded the binary versions of the Allegro; I did not build it myself. I am curious as to why you can make VS2005 work and I not?? are the binary files that can be downloaded built using VC2005 Express, or did I miss on that?

gnolam
Hansie said:

are the binary files that can be downloaded built using VC2005 Express, or did I miss on that?

Matthew Leverton said:

The files here were built with VC++ 2005 Express

Hansie

ah,

so I do need to go through the hassle of performing the "make" process myself. Which is OK as I will need to add / change stuff to the core library anyway.

BAF
Quote:

Which is OK as I will need to add / change stuff to the core library anyway.

Why are you doing that? And if you do, PLEASE don't distribute name it alleg42.dll, please name it something else.

Hansie

We need to make some changes to target an embedded platform that is not commonly used. Still, Allegro saves us bundles of time as opposed to pure DirectX at the end of the day; I just wish it was clear how to build the latest version using the latest source distribution and Cygwin. I did not find a lot on google or the forums that explains VS2005 and Allegro as a pair.

Matthew Leverton
Quote:

"fatal error C1047: The object or library file 'C:\allegro\lib\alleg_s.lib' was created with an older compiler than other objects; rebuild old objects and libraries"

The solution to this is:

  • C/C++ / Optimization / Whole Program Optimization: No

  • Link / Optimization / Link Time Code Generation: Default

  • Link / Input / Ignore Specific Library: MSVCRT (At least when linking with alleg_s_crt.lib)

With the above steps, I was able to use the Allegro.cc alleg_s_crt.lib (/MT) on Visual Studio 2005.

Thread #590727. Printed from Allegro.cc