[solved]OgreFreeImageCodec give unresolved error on 32 bit version of Ogre library, while on 64 bit compile.

Problems building or running the engine, queries about how to use features etc.
Post Reply
Bady
Halfling
Posts: 52
Joined: Sun Mar 16, 2014 1:47 am
x 3

[solved]OgreFreeImageCodec give unresolved error on 32 bit version of Ogre library, while on 64 bit compile.

Post by Bady »

Ogre Version: 13.2.4 (32 bit release)
Operating System: window 10 x64
Render System: DirectX 9,DirectX 11
Visual studio 2017
Hi.

After I successfully built the 64 bit version of Ogre3d library I started to build the 32 bit version too.
When I built Ogre3d library 64 bit version with freeimage, it compiled seamlessly, but with the 32 bit version, it give me 31 unresolved error at FreeImageCodec, but everything else compiled succesfully in the library.
I tried to link the freeimage.lib directly in Codec_freeimage solution(includes/dependencies folder, additional dependencies ,etc.) , but the result was the same.
I linked the Freeimage for Cmake as the wiki recommended: https://wiki.ogre3d.org/Building+Dependencies
I use the 3.18.0 version of freeimage from here: https://freeimage.sourceforge.io/download.html
I tried with the Compiled version from the page, and I tried to compile by myself too (both libs are the same size, 68,1 kb) but no use.
I didn't changed anything in the base Cmake configuration, neither in the Ogre project properties (Exept the include directories/dependencies after I got the error).

Some error message(I will post all if necesary, but I think it's suffice enough to see what is the problem):

Code: Select all

 
Error	LNK2019	unresolved external symbol _FreeImage_Initialise referenced in function "public: static void __cdecl Ogre::FreeImageCodec::startup(void)" (?startup@FreeImageCodec@Ogre@@SAXXZ)	

Error	LNK2019	unresolved external symbol _FreeImage_DeInitialise referenced in function "public: static void __cdecl Ogre::FreeImageCodec::shutdown(void)" (?shutdown@FreeImageCodec@Ogre@@SAXXZ)	

Error	LNK2019	unresolved external symbol _FreeImage_CloseMemory referenced in function "public: virtual struct std::pair<class Ogre::SharedPtr<class Ogre::MemoryDataStream>,class Ogre::SharedPtr<class Ogre::ImageCodec::ImageData> > __thiscall Ogre::FreeImageCodec::decode(class Ogre::SharedPtr<class Ogre::DataStream> const &)const " (?decode@FreeImageCodec@Ogre@@UBE?AU?$pair@V?$SharedPtr@VMemoryDataStream@Ogre@@@Ogre@@V?$SharedPtr@VImageData@ImageCodec@Ogre@@@2@@std@@ABV?$SharedPtr@VDataStream@Ogre@@@2@@Z)	

Error	LNK2019	unresolved external symbol _FreeImage_ConvertTo32Bits referenced in function "public: virtual struct std::pair<class Ogre::SharedPtr<class Ogre::MemoryDataStream>,class Ogre::SharedPtr<class Ogre::ImageCodec::ImageData> > __thiscall Ogre::FreeImageCodec::decode(class Ogre::SharedPtr<class Ogre::DataStream> const &)const " (?decode@FreeImageCodec@Ogre@@UBE?AU?$pair@V?$SharedPtr@VMemoryDataStream@Ogre@@@Ogre@@V?$SharedPtr@VImageData@ImageCodec@Ogre@@@2@@std@@ABV?$SharedPtr@VDataStream@Ogre@@@2@@Z)
Sorry for my terrible english, I hope it's understandable the problem.
Last edited by Bady on Sat Jan 29, 2022 6:54 pm, edited 1 time in total.
The last sceneblender
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 450
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 156

Re: OgreFreeImageCodec give unresolved error on 32 bit version of Ogre library, while on 64 bit compile successfully.

Post by sercero »

Do you have the 64-bit and 32-bit versions properly separated?

Perhaps you got some mixing going on there...
Bady
Halfling
Posts: 52
Joined: Sun Mar 16, 2014 1:47 am
x 3

Re: OgreFreeImageCodec give unresolved error on 32 bit version of Ogre library, while on 64 bit compile successfully.

Post by Bady »

Hi. Thanks for ansvering.

Yes, I generated the 32 bit version and the 64 bit version of Ogre3d in a separated folder(named as "ogre-13.2.4lib-win32" and "ogre-13.2.4lib-x64"), and I did it with freeimage as well(I mean compiled in separated folder). I even generated Ogre from a separated source for the 32 bit version for testing, to make sure I filter it out every mixing possibilities.
The last sceneblender
Bady
Halfling
Posts: 52
Joined: Sun Mar 16, 2014 1:47 am
x 3

Re: OgreFreeImageCodec give unresolved error on 32 bit version of Ogre library, while on 64 bit compile successfully.

Post by Bady »

I figured it out, but I have no idea why work edlike this.
Probably in 64 the bit version or in cMake something got configured differently, because in 64 bit, It accepted the "simple" freeimage.lib, but in the 32 version only the "freeimagelib target" works what is generate freeimagelib.lib what is wery misleading. (I tried two times with 64 bit version and both times compiled successfully)
Yes it was mentioned in the wiki, That was my bad , but if the 64 bit thow exeption about it, I would notice it immediately. (Actually I tought The "|" between "Build|BatchBuild" means I can choose both options)
Last edited by Bady on Sat Jan 29, 2022 6:33 pm, edited 1 time in total.
The last sceneblender
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: OgreFreeImageCodec give unresolved error on 32 bit version of Ogre library, while on 64 bit compile successfully.

Post by paroj »

if you just want to load some images, you can also try using Codec_STBI
Bady
Halfling
Posts: 52
Joined: Sun Mar 16, 2014 1:47 am
x 3

Re: OgreFreeImageCodec give unresolved error on 32 bit version of Ogre library, while on 64 bit compile successfully.

Post by Bady »

Hi.

I use freeimage so the "Texture" recognise the jpg/png formats.

Menawhile I figured out, I was the idiot again(partly). I explained above what was my mitake(Maybe I sould relax more or something :? ).
But thanks for the advice, I appreciate it. It sounds a good alternative for image loading.
The last sceneblender
Post Reply