configure script fails at FreeImage_GetVersion

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

PaddyMac
Just popping in
Just popping in
Posts: 7
Joined: Sun Feb 19, 2012 23:59

configure script fails at FreeImage_GetVersion

Postby PaddyMac » Mon Feb 20, 2012 03:02

I am trying to compile cegui 0.7.6 from source on Gentoo an build the FreeImage ImageCodec module. I have freeimage 3.15.1 installed via Portage. I'll just show teh relevant part of configure's output when I run "./configure --enable-freeimage"

checking for library containing FreeImage_GetVersion... no
checking FreeImage.h usability... yes
checking FreeImage.h presence... yes
checking for FreeImage.h... yes
configure: FreeImage based ImageCodec module disabled.

These are the files installed by Freeimage

/usr
/usr/include
/usr/include/FreeImage.h
/usr/include/FreeImagePlus.h
/usr/lib
/usr/lib/debug
/usr/lib/debug/usr
/usr/lib/debug/usr/lib
/usr/lib/debug/usr/lib/libfreeimage-3.15.1.so.debug
/usr/lib/debug/usr/lib/libfreeimageplus-3.15.1.so.debug
/usr/lib/libfreeimage-3.15.1.so
/usr/lib/libfreeimage.a
/usr/lib/libfreeimage.so -> libfreeimage.so.3
/usr/lib/libfreeimage.so.3 -> libfreeimage-3.15.1.so
/usr/lib/libfreeimageplus-3.15.1.so
/usr/lib/libfreeimageplus.a
/usr/lib/pkgconfig
/usr/lib/pkgconfig/freeimage.pc
/usr/share
/usr/share/doc
/usr/share/doc/freeimage-3.15.1
/usr/share/doc/freeimage-3.15.1/README.linux.bz2
/usr/share/doc/freeimage-3.15.1/Whatsnew.txt.bz2

And the contents of /usr/lib/pkgconfig/freeimage.pc

prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib

Name: FreeImage
Description: Image library supporting many formats
Version: 3.15.1
Requires: OpenEXR libpng
Libs: -lfreeimage -lfreeimageplus
Libs.private: -ljpeg -lmng -ltiff -lopenjpeg -lz

I've checked everything I know to. Why will the configure script not detect FreeImage_GetVersion and thus enable Freeimage's module?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: configure script fails at FreeImage_GetVersion

Postby CrazyEddie » Mon Feb 20, 2012 11:57

I don't know why it's failing.
What does:

Code: Select all

nm -D /usr/lib/libfreeimage.so | grep GetVersion

say?

Could you find / post the part of config.log that shows the failed test(s)? Perhaps there is more info in there?

CE.

PaddyMac
Just popping in
Just popping in
Posts: 7
Joined: Sun Feb 19, 2012 23:59

Re: configure script fails at FreeImage_GetVersion

Postby PaddyMac » Mon Feb 20, 2012 16:29

"nm -D /usr/lib/libfreeimage.so | grep GetVersion" results in:
0003a950 T FreeImage_GetVersion

This appears to be the relevant part of config.log:

Code: Select all

configure:17179: checking for library containing FreeImage_GetVersion
configure:17210: g++ -o conftest -g -O2   conftest.cpp -lpthread -ldl  >&5
/tmp/.private/patrick/cc9fPffj.o: In function `main':
/home/patrick/CEGUI-0.7.6/conftest.cpp:42: undefined reference to `FreeImage_GetVersion'
collect2: ld returned 1 exit status
configure:17210: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "CEGUI"
| #define PACKAGE_TARNAME "CEGUI"
| #define PACKAGE_VERSION "0.7.6"
| #define PACKAGE_STRING "CEGUI 0.7.6"
| #define PACKAGE_BUGREPORT "http://mantis.cegui.org.uk/"
| #define PACKAGE_URL ""
| #define PACKAGE "CEGUI"
| #define VERSION "0.7.6"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_LIBDL 1
| #define HAVE_LIBPTHREAD 1
| #define CEGUI_HAS_FREETYPE /**/
| #define CEGUI_HAS_PCRE_REGEX /**/
| #define CEGUI_TINYXML_HAS_2_6_API 1
| #define CEGUI_DEFAULT_XMLPARSER XercesParser
| #define CEGUI_TINYXML_H <tinyxml.h>
| #define CEGUI_TINYXML_NAMESPACE /**/
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char FreeImage_GetVersion ();
| int
| main ()
| {
| return FreeImage_GetVersion ();
|   ;
|   return 0;
| }
configure:17210: g++ -o conftest -g -O2   conftest.cpp -lfreeimage  -lpthread -ldl  >&5
/usr/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../libfreeimage.so: undefined reference to `TIFFFindFieldInfo'
collect2: ld returned 1 exit status
configure:17210: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "CEGUI"
| #define PACKAGE_TARNAME "CEGUI"
| #define PACKAGE_VERSION "0.7.6"
| #define PACKAGE_STRING "CEGUI 0.7.6"
| #define PACKAGE_BUGREPORT "http://mantis.cegui.org.uk/"
| #define PACKAGE_URL ""
| #define PACKAGE "CEGUI"
| #define VERSION "0.7.6"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_LIBDL 1
| #define HAVE_LIBPTHREAD 1
| #define CEGUI_HAS_FREETYPE /**/
| #define CEGUI_HAS_PCRE_REGEX /**/
| #define CEGUI_TINYXML_HAS_2_6_API 1
| #define CEGUI_DEFAULT_XMLPARSER XercesParser
| #define CEGUI_TINYXML_H <tinyxml.h>
| #define CEGUI_TINYXML_NAMESPACE /**/
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char FreeImage_GetVersion ();
| int
| main ()
| {
| return FreeImage_GetVersion ();
|   ;
|   return 0;
| }
configure:17227: result: no
configure:17243: checking FreeImage.h usability
configure:17243: gcc -c -g -O2  conftest.c >&5
configure:17243: $? = 0
configure:17243: result: yes
configure:17243: checking FreeImage.h presence
configure:17243: gcc -E  conftest.c
configure:17243: $? = 0
configure:17243: result: yes
configure:17243: checking for FreeImage.h
configure:17243: result: yes
configure:17260: FreeImage based ImageCodec module disabled.


Edit: Ah! Now that I've posted this and viewed the log, maybe it is the result of this bug in Freeimage: http://sourceforge.net/tracker/?func=de ... tid=111504

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: configure script fails at FreeImage_GetVersion

Postby CrazyEddie » Tue Feb 21, 2012 08:32

Thanks for posting the information

Edit: Ah! Now that I've posted this and viewed the log, maybe it is the result of this bug in Freeimage: http://sourceforge.net/tracker/?func=de ... tid=111504

Yeah, almost certainly. Your log contains this line:

Code: Select all

/usr/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../libfreeimage.so: undefined reference to `TIFFFindFieldInfo'

which seems to match that bug exactly.

CE.

PaddyMac
Just popping in
Just popping in
Posts: 7
Joined: Sun Feb 19, 2012 23:59

Re: configure script fails at FreeImage_GetVersion

Postby PaddyMac » Mon Feb 27, 2012 18:29

OK. I think I solved *why* CEGUI wasn't finding the FreeImage installation, and it has nothing to do with the bug I suspected earlier. But it leads to another question. I'm sure you know Freeimage can be compiled two ways - as FreeImage or as FreeImagePlus.

If you run "make" && "make install" you get

Code: Select all

install -d //usr/include //usr/lib
install -m 644 -o root -g root Source/FreeImage.h //usr/include
install -m 644 -o root -g root libfreeimage.a //usr/lib
install -m 755 -o root -g root libfreeimage-3.15.2.so //usr/lib
ln -sf libfreeimage-3.15.2.so //usr/lib/libfreeimage.so.3
ln -sf libfreeimage.so.3 //usr/lib/libfreeimage.so

so you have
56K -rw-r--r-- 1 root root 53K Feb 27 12:15 /usr/include/FreeImage.h
3.4M -rwxr-xr-x 1 root root 3.4M Feb 27 12:15 /usr/lib/libfreeimage-3.15.2.so
5.3M -rw-r--r-- 1 root root 5.3M Feb 27 12:15 /usr/lib/libfreeimage.a
   0 lrwxrwxrwx 1 root root   17 Feb 27 12:15 /usr/lib/libfreeimage.so -> libfreeimage.so.3
   0 lrwxrwxrwx 1 root root   22 Feb 27 12:15 /usr/lib/libfreeimage.so.3 -> libfreeimage-3.15.2.so


But if you do "make -f Makefile.fip" && "make -f Makefile.fip install" you get

Code: Select all

install -d //usr/include //usr/lib
install -m 644 -o root -g root Source/FreeImage.h //usr/include
install -m 644 -o root -g root Wrapper/FreeImagePlus/FreeImagePlus.h //usr/include
install -m 644 -o root -g root libfreeimageplus.a //usr/lib
install -m 755 -o root -g root libfreeimageplus-3.15.2.so //usr/lib

so you have
56K -rw-r--r-- 1 root root 53K Feb 27 12:24 /usr/include/FreeImage.h
56K -rw-r--r-- 1 root root 53K Feb 27 12:24 /usr/include/FreeImagePlus.h
3.4M -rwxr-xr-x 1 root root 3.4M Feb 27 12:24 /usr/lib/libfreeimageplus-3.15.2.so
5.4M -rw-r--r-- 1 root root 5.4M Feb 27 12:24 /usr/lib/libfreeimageplus.a


Aside from any quirks that Gentoo's Freeimage installation may have, this is how it happens if you install Freeimage by hand, and CEGUI will find the regular FreeImage installation but not the FreeImagePlus installation. So I suppose my question is this: "Is CEGUI compatible with FreeImagePlus, and, if so, can it's confugure script be updated to find its installation also?"

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: configure script fails at FreeImage_GetVersion

Postby CrazyEddie » Tue Feb 28, 2012 07:37

I'm not sure if you deliberately blanked me when I spoke of this on IRC or not, but I'll give you the benefit of the doubt (just this once).

The config.log error clearly shows that the library itself was present, but contained undefined references when linked into the test program built by configure for that test. This indicates either that something is very wrong with the freeimage library you have, or that some dependent library is missing from it's list of link libraries (in this case most likely LibTIFF).

Of course one major thing we must consider is that the FreeImage as packaged by Gentoo (and others) is heavily modified from the original source - in order to remove the bundled dependency libs (bundling those libs is horrible, but then so is doing a massive hatchet job to remove them, I'm not sure which I dislike the most :lol:).

With regards to the situation with CEGUI in general, as mentioned on IRC, there is unlikely to be any further releases in the 0.7.x series, as all our efforts now go towards getting CEGUI 1.0.0 (currently 0.8.x) finished and out the door - this version of CEGUI has a completely new build system using cmake. For these reasons, 0.7.x transitions to a new state where - for things that affect v0-7 code only - I am willing to look at and consider any patches that would be applied in the v0-7 stable branch, but it's somewhat unlikely I will find the time to actually make any v0-7 specific patches myself.

CE.

PaddyMac
Just popping in
Just popping in
Posts: 7
Joined: Sun Feb 19, 2012 23:59

Re: configure script fails at FreeImage_GetVersion

Postby PaddyMac » Tue Feb 28, 2012 15:59

I didn't see anything on IRC. I'm sorry I missed it. FreeImage 3.15.2 should be patched and ready for Gentoo soon, so I can see if that fixes it. If it doesn't, maybe I can find a solution to pass along.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 5 guests