2014-02-27 77 views
0

我是想在自己構建的ImageMagick的添加對閃爍象素格式的支持。爲了實現這一點,我下載的來源libfpx-1.3.1-3.tar.gz從ImageMagick FTP server for delegates,並編制了資源,使2個Debian軟件包:libfpxlibfpx-dev鏈接錯誤與libfpx.so:未定義參考

在配置時的頭文件被看見和可用,然而configtest.cpp彙編返回共享庫libfpx.so(這是一個符號鏈接libfpx.so.1.0.31)內未定義的引用的連接錯誤。它看起來像大多數是在由-lm鏈接。在我的config.log看數學庫定義:

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 

下面是引用conftest.cpp文件:

/* 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告訴我們在Fedora Linux上成功構建。我沒有看到鏈接錯誤的起源。

回答

2

搜索在克而++鏈接共享庫後,我決定跑比libfpx沒有其他鏈接庫的編譯命令行:

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

它編譯沒有錯誤。然後我試圖尋找哪個鏈接的共享庫彈出錯誤。那是libdjvulibre庫......在命令行刪除-ldjvulibre已經沒有錯誤再次編譯conftest.cpp:

$ 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 

給我一個目標文件conftest。

我沒有檢查執行這一djvulibre共享庫的包:這是Official Ubuntu package for Raring 13.04:包名稱libdjvulibre21和版本是3.5.25.3-3

Obviouly這是在ImageMagick configure script一個bug

相關問題