0

I was trying to add support for the FlashPIX format in my own build of ImageMagick. In order to achieve this I downloaded the sources libfpx-1.3.1-3.tar.gz from the ImageMagick FTP server for delegates, and compiled the sources to make 2 Debian packages : libfpx and libfpx-dev.

At configure time the header files are seen and usable:

configure:28755: checking for FlashPIX
configure:28755: checking for FlashPIX
configure:28757: result: 
configure:28768: checking fpxlib.h usability
configure:28768: g++ -c -O3 -g3 -pthread   -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16  conftest.cpp >&5
configure:28768: $? = 0
configure:28768: result: yes
configure:28768: checking fpxlib.h presence
configure:28768: g++ -E   -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16      conftest.cpp
configure:28768: $? = 0
configure:28768: result: yes
configure:28768: checking for fpxlib.h
configure:28768: result: yesconfigure:28757: result: 
configure:28768: checking fpxlib.h usability
configure:28768: g++ -c -O3 -g3 -pthread   -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16  conftest.cpp >&5
configure:28768: $? = 0
configure:28768: result: yes
configure:28768: checking fpxlib.h presence
configure:28768: g++ -E   -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16  conftest.cpp
configure:28768: $? = 0
configure:28768: result: yes
configure:28768: checking for fpxlib.h
configure:28768: result: yes

However the configtest.cpp compilation returns a linking error for undefined references within the shared library libfpx.so (which is a symlink to libfpx.so.1.0.31). It looks like most are defined in the math library which is linked by -lm . Although I don't see where the declaration #include <math.h> is in header files.

In the config.log I see:

checking for FPX_OpenImageByFilename in -lfpx

$ g++ -o conftest -O3 -g3 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 conftest.cpp -lfpx -lfftw3 -ldjvulibre -lz -lXext -lXt -lSM -lICE -lX11 -lbz2 -lgomp -lm    >&5
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `operator delete(void*)'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `operator new[](unsigned long)'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `atan2'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `std::ios_base::Init::~Init()'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `__cxa_pure_virtual'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `operator delete[](void*)'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `__gxx_personality_v0'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `std::ios_base::Init::Init()'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `pow'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `operator new(unsigned long)'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `sqrt'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `sincosf'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `vtable for __cxxabiv1::__class_type_info'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libfpx.so: undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info'
collect2: ld returned 1 exit status

Here is the conftest.cpp file for reference:

/* confdefs.h */
#define PACKAGE_NAME "ImageMagick"
#define PACKAGE_TARNAME "ImageMagick"
#define PACKAGE_VERSION "6.8.6-10"
#define PACKAGE_STRING "ImageMagick 6.8.6-10"
#define PACKAGE_BUGREPORT "http://www.imagemagick.org"
#define PACKAGE_URL ""
#define MAGICK_TARGET_CPU x86_64
#define MAGICK_TARGET_VENDOR unknown
#define MAGICK_TARGET_OS linux-gnu
#define PACKAGE "ImageMagick"
#define VERSION "6.8.6-10"
#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 __EXTENSIONS__ 1
#define _ALL_SOURCE 1
#define _GNU_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define _TANDEM_SOURCE 1
#define HAVE___ATTRIBUTE__ 1
#define HAVE_PTHREAD_PRIO_INHERIT 1
#define HAVE_PTHREAD 1
#define THREAD_SUPPORT 1
#define HAVE_PTHREAD_PRIO_INHERIT 1
#define HAVE_PTHREAD 1
#define HAVE_FSEEKO 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define INSTALLED_SUPPORT 1
#define CIPHER_SUPPORT 1
#define HDRI_ENABLE_OBSOLETE_IN_H 1
#define QUANTUM_DEPTH_OBSOLETE_IN_H 16
#define STDC_HEADERS 1
#define HAVE_DIRENT_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_COMPLEX_H 1
#define HAVE_ERRNO_H 1
#define HAVE_FCNTL_H 1
#define HAVE_LIMITS_H 1
#define HAVE_LINUX_UNISTD_H 1
#define HAVE_LOCALE_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_STDARG_H 1
#define HAVE_SYS_IPC_H 1
#define HAVE_SYS_MMAN_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMEB_H 1
#define HAVE_SYS_TIMES_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_WCHAR_H 1
#define HAVE_XLOCALE_H 1
#define HAVE__BOOL 1
#define HAVE_STDBOOL_H 1
#define HAVE_STRINGIZE 1
#define TIME_WITH_SYS_TIME 1
#define HAVE_STRUCT_TM_TM_ZONE 1
#define HAVE_TM_ZONE 1
#define restrict __restrict
#define HAVE_UNSIGNED_LONG_LONG_INT 1
#define HAVE_LONG_LONG_INT 1
#define HAVE_INTMAX_T 1
#define HAVE_INTPTR_T 1
#define HAVE_LONG_DOUBLE 1
#define HAVE_LONG_DOUBLE_WIDER 1
#define HAVE_LONG_LONG_INT 1
#define HAVE_MBSTATE_T 1
#define HAVE_UINTMAX_T 1
#define HAVE_UINTPTR_T 1
#define HAVE_UNSIGNED_LONG_LONG_INT 1
#define HAVE_FLOAT_T 1
#define HAVE_DOUBLE_T 1
#define SIZEOF_FLOAT_T 4
#define SIZEOF_DOUBLE_T 8
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#define SIZEOF_LONG_DOUBLE 16
#define SIZEOF_SIGNED_SHORT 2
#define SIZEOF_UNSIGNED_SHORT 2
#define SIZEOF_SIGNED_INT 4
#define SIZEOF_UNSIGNED_INT 4
#define SIZEOF_SIGNED_LONG 8
#define SIZEOF_UNSIGNED_LONG 8
#define SIZEOF_SIGNED_LONG_LONG 8
#define SIZEOF_UNSIGNED_LONG_LONG 8
#define SIZEOF_OFF_T 8
#define SIZEOF_SIZE_T 8
#define SIZEOF_SSIZE_T 8
#define SIZEOF_UNSIGNED_INTP 8
#define HAVE_STDLIB_H 1
#define HAVE_UNISTD_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_GETPAGESIZE 1
#define HAVE_MMAP 1
#define HAVE_FORK 1
#define HAVE_VFORK 1
#define HAVE_WORKING_VFORK 1
#define HAVE_WORKING_FORK 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SOCKET_H 1
#define SELECT_TYPE_ARG1 int
#define SELECT_TYPE_ARG234 (fd_set *)
#define SELECT_TYPE_ARG5 (struct timeval *)
#define RETSIGTYPE void
#define HAVE_DECL_STRERROR_R 1
#define HAVE_STRERROR_R 1
#define STRERROR_R_CHAR_P 1
#define HAVE_VPRINTF 1
#define HAVE_SOCKET 1
#define HAVE_ACOSH 1
#define HAVE_ASINH 1
#define HAVE_ATANH 1
#define HAVE_ATOLL 1
#define HAVE_ATEXIT 1
#define HAVE_CABS 1
#define HAVE_CARG 1
#define HAVE_CIMAG 1
#define HAVE_CREAL 1
#define HAVE_CLOCK 1
#define HAVE_CTIME_R 1
#define HAVE__EXIT 1
#define HAVE_EXECVP 1
#define HAVE_FCHMOD 1
#define HAVE_FLOOR 1
#define HAVE_FORK 1
#define HAVE_FTIME 1
#define HAVE_FTRUNCATE 1
#define HAVE_GETC_UNLOCKED 1
#define HAVE_GETCWD 1
#define HAVE_GETPID 1
#define HAVE_GETDTABLESIZE 1
#define HAVE_GETPAGESIZE 1
#define HAVE_GETRLIMIT 1
#define HAVE_GETRUSAGE 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GMTIME_R 1
#define HAVE_ISNAN 1
#define HAVE_J0 1
#define HAVE_J1 1
#define HAVE_LOCALTIME_R 1
#define HAVE_LSTAT 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMSET 1
#define HAVE_MKSTEMP 1
#define HAVE_MUNMAP 1
#define HAVE_NANOSLEEP 1
#define HAVE_NEWLOCALE 1
#define HAVE_PCLOSE 1
#define HAVE_POLL 1
#define HAVE_POPEN 1
#define HAVE_POSIX_FADVISE 1
#define HAVE_POSIX_FALLOCATE 1
#define HAVE_POSIX_MADVISE 1
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_POSIX_SPAWNP 1
#define HAVE_POW 1
#define HAVE_PREAD 1
#define HAVE_PWRITE 1
#define HAVE_QSORT_R 1
#define HAVE_RAISE 1
#define HAVE_RAND_R 1
#define HAVE_READLINK 1
#define HAVE_READDIR_R 1
#define HAVE_REALPATH 1
#define HAVE_SELECT 1
#define HAVE_SEEKDIR 1
#define HAVE_SETLOCALE 1
#define HAVE_SOCKET 1
#define HAVE_SQRT 1
#define HAVE_SETVBUF 1
#define HAVE_STAT 1
#define HAVE_STRCHR 1
#define HAVE_STRERROR_R 1
#define HAVE_STRRCHR 1
#define HAVE_STRCSPN 1
#define HAVE_STRDUP 1
#define HAVE_STRPBRK 1
#define HAVE_STRSPN 1
#define HAVE_STRSTR 1
#define HAVE_STRTOD 1
#define HAVE_STRTOD_L 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_SYMLINK 1
#define HAVE_SYSCONF 1
#define HAVE_SIGEMPTYSET 1
#define HAVE_SIGACTION 1
#define HAVE_STRERROR 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_TELLDIR 1
#define HAVE_TEMPNAM 1
#define HAVE_TIMES 1
#define HAVE_USELOCALE 1
#define HAVE_USLEEP 1
#define HAVE_UTIME 1
#define HAVE_VFPRINTF 1
#define HAVE_VSPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_WAITPID 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOCK_REALTIME 1
#define HAVE_DECL_PREAD 1
#define HAVE_DECL_PWRITE 1
#define HAVE_DECL_STRLCPY 0
#define HAVE_DECL_VSNPRINTF 1
#define HAVE_BOOL /**/
#define HAVE_NAMESPACES /**/
#define HAVE_NAMESPACE_STD /**/
#define HAVE_STD_LIBS /**/
#define X11_CONFIGURE_PATH ""
#define BZLIB_DELEGATE 1
#define X11_DELEGATE 1
#define HAVE_SHARED_MEMORY 1
#define HAVE_SHAPE 1
#define ZLIB_DELEGATE 1
#define DJVU_DELEGATE 1
#define FFTW_DELEGATE 1
/* 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 FPX_OpenImageByFilename ();
int
main ()
{
return FPX_OpenImageByFilename ();
  ;
   return 0;
}

ImageMagicks told me they built successfuly on a Fedora Linux. As well they are unable to provide support. I don't see where the linking error originate.

1 Answer 1

0

After searching for a while on g++ linking shared libraries, I decided to run the compilation command line with no other linked libraries than libfpx :

$ g++ -o conftest -O3 -g3 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 conftest.cpp -lfpx

It compiled without errors. Then I try to look for which linked shared libraries the error popped. That was the libdjvulibre library ... Removing the -ldjvulibre from the command line had the conftest.cpp compiled again without errors:

$ g++ -o conftest -O3 -g3 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 conftest.cpp -lfpx -lfftw3 -lz -lXext -lXt -lSM -lICE -lX11 -lbz2 -lgomp -lm

gives me an object file conftest.

I did check on the package implementing this djvulibre shared library : It's the Official Ubuntu package for Raring 13.04: Package name is libdjvulibre21 and version is 3.5.25.3-3 .

Obviouly this is a bug in the ImageMagick configure file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .