kakwa / libemf2svg

Microsoft (MS) EMF to SVG conversion library
GNU General Public License v2.0
95 stars 32 forks source link

Compilation problems #24

Open lxkurko opened 6 years ago

lxkurko commented 6 years ago

Operating system: Debian 9 "Stretch", x86-64.

If -DSTATIC is enabled, a bunch of error messages appears during linking. Console output is here: https://bpaste.net/show/0d2221fe7b89

If -DDEBUG is changed from on to off or vice versa, the following message is printed. It does not appear if cmake is run again without changing the option.

-- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project:

DEBUG

-- Build files have been written to:

simevo commented 5 years ago

the paste bin is gone anyway the issue is reproducible on Debian 10 "Buster" x86-64 using master branch with: cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ -DSTATIC=1 && make I get:

[100%] Linking CXX executable emf2svg-conv
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): in function `FcConfigMessage':
(.text+0x335): undefined reference to `XML_GetCurrentLineNumber'
/usr/bin/ld: (.text+0x3b1): undefined reference to `XML_GetCurrentLineNumber'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): in function `FcConfigParseAndLoadFromMemoryInternal':
(.text+0x14dd): undefined reference to `XML_ParserCreate'
/usr/bin/ld: (.text+0x1561): undefined reference to `XML_SetUserData'
/usr/bin/ld: (.text+0x1577): undefined reference to `XML_SetDoctypeDeclHandler'
/usr/bin/ld: (.text+0x158d): undefined reference to `XML_SetElementHandler'
/usr/bin/ld: (.text+0x159c): undefined reference to `XML_SetCharacterDataHandler'
/usr/bin/ld: (.text+0x15a9): undefined reference to `XML_GetBuffer'
/usr/bin/ld: (.text+0x160c): undefined reference to `XML_ParseBuffer'
/usr/bin/ld: (.text+0x1618): undefined reference to `XML_GetErrorCode'
/usr/bin/ld: (.text+0x161f): undefined reference to `XML_ErrorString'
/usr/bin/ld: (.text+0x166f): undefined reference to `XML_ParserFree'
/usr/bin/ld: (.text+0x1707): undefined reference to `XML_ParseBuffer'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libstdc++.a(eh_alloc.o): in function `(anonymous namespace)::pool::free(void*) [clone .constprop.2]':
(.text._ZN12_GLOBAL__N_14pool4freeEPv.constprop.2+0x1d): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZN12_GLOBAL__N_14pool4freeEPv.constprop.2+0xc8): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libstdc++.a(eh_alloc.o): in function `(anonymous namespace)::pool::allocate(unsigned long) [clone .constprop.3]':
(.text._ZN12_GLOBAL__N_14pool8allocateEm.constprop.3+0x1d): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZN12_GLOBAL__N_14pool8allocateEm.constprop.3+0x81): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libstdc++.a(c++locale.o): in function `__gnu_cxx::__scoped_lock::~__scoped_lock()':
(.text._ZN9__gnu_cxx13__scoped_lockD2Ev[_ZN9__gnu_cxx13__scoped_lockD5Ev]+0x12): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libstdc++.a(c++locale.o): in function `std::Catalogs::_M_erase(int)':
(.text._ZNSt8Catalogs8_M_eraseEi+0x1b): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt8Catalogs8_M_eraseEi+0x82): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: (.text._ZNSt8Catalogs8_M_eraseEi+0xf3): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libstdc++.a(c++locale.o): in function `std::Catalogs::_M_get(int) const':
(.text._ZNKSt8Catalogs6_M_getEi+0x1c): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNKSt8Catalogs6_M_getEi+0x87): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libstdc++.a(c++locale.o): in function `std::Catalogs::_M_add(char const*, std::locale)':
(.text._ZNSt8Catalogs6_M_addEPKcSt6locale+0x28): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt8Catalogs6_M_addEPKcSt6locale+0xbc): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libstdc++.a(locale_init.o): in function `std::locale::locale()':
(.text._ZNSt6localeC2Ev+0x4b): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt6localeC2Ev+0x70): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libstdc++.a(locale_init.o): in function `std::locale::global(std::locale const&)':
(.text._ZNSt6locale6globalERKS_+0x31): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt6locale6globalERKS_+0x9a): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libstdc++.a(locale.o): in function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned long)':
(.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEm+0x3d): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEm+0xc0): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_bases.part.5':
(.text+0x16a8): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_table_bases':
(.text+0x17a8): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__deregister_frame_info_bases':
(.text+0x185e): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text+0x18e5): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: (.text+0x191d): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
(.text+0x1a4c): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text+0x1b88): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: (.text+0x1bc9): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_bases.part.5':
(.text+0x16db): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_table_bases':
(.text+0x17db): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fcfreetype.o): in function `FcFreeTypeQueryFaceInternal':
(.text+0xfd2): undefined reference to `FT_Get_MM_Var'
/usr/bin/ld: (.text+0x2492): undefined reference to `FT_Get_PS_Font_Info'
/usr/bin/ld: (.text+0x28c4): undefined reference to `FT_Get_BDF_Property'
/usr/bin/ld: (.text+0x28f8): undefined reference to `FT_Get_BDF_Property'
/usr/bin/ld: (.text+0x29fb): undefined reference to `FT_Get_BDF_Property'
/usr/bin/ld: (.text+0x2a58): undefined reference to `FT_Get_BDF_Property'
/usr/bin/ld: (.text+0x2aaf): undefined reference to `FT_Get_BDF_Property'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fcfreetype.o):(.text+0x2ac9): more undefined references to `FT_Get_BDF_Property' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fcfreetype.o): in function `IA__FcFreeTypeQueryAll':
(.text+0x356f): undefined reference to `FT_Get_MM_Var'
/usr/bin/ld: (.text+0x35aa): undefined reference to `FT_Set_Var_Design_Coordinates'
/usr/bin/ld: (.text+0x361a): undefined reference to `FT_Set_Var_Design_Coordinates'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fchash.o): in function `FcHashUuidCopy':
(.text+0x221): undefined reference to `uuid_copy'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `FcDirCacheBasenameUUID':
(.text+0x847): undefined reference to `uuid_unparse'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `lock_cache.part.2':
(.text+0xa98): undefined reference to `pthread_mutex_init'
/usr/bin/ld: (.text+0xaae): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text+0xacf): undefined reference to `pthread_mutex_destroy'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `FcCacheInsert':
(.text+0xc4b): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `IA__FcDirCacheCreateUUID':
(.text+0x1657): undefined reference to `uuid_generate_random'
/usr/bin/ld: (.text+0x169a): undefined reference to `uuid_unparse'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `FcCacheObjectReference':
(.text+0x19ec): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `FcDirCacheMapFd':
(.text+0x1c4f): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: (.text+0x1d28): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `FcCacheAllocate':
(.text+0x21f6): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `FcCacheFini':
(.text+0x225c): undefined reference to `pthread_mutex_destroy'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `FcDirCacheReference':
(.text+0x22d3): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `IA__FcDirCacheLoad':
(.text+0x248d): undefined reference to `uuid_parse'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `FcDirCacheWrite':
(.text+0x2b44): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `lock_cache.part.2':
(.text+0xaca): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libfontconfig.a(fccache.o): in function `FcCacheObjectDereference':
(.text+0x1a64): undefined reference to `pthread_mutex_unlock'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/emf2svg-conv.dir/build.make:89: emf2svg-conv] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: CMakeFiles/emf2svg-conv.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

can be fixed manually by tweaking the command in CMakeFiles/emf2svg-conv.dir/link.txt from:

/usr/lib/ccache/c++   -DE2S_VERSION='"1.1.0"' -std=c++11 -Wall  -static -rdynamic CMakeFiles/emf2svg-conv.dir/src/conv/emf2svg.cpp.o  -o emf2svg-conv  -L/home/paolog/Sviluppo/libemf2svg/build_static  -L/usr/local/lib -Wl,-rpath,/home/paolog/Sviluppo/libemf2svg/build_static:/usr/local/lib: -lm libemf2svg.a -lm -lpng -lz -lfreetype -lfontconfig 

to:

/usr/lib/ccache/c++   -DE2S_VERSION='"1.1.0"' -std=c++11 -Wall  -static -rdynamic CMakeFiles/emf2svg-conv.dir/src/conv/emf2svg.cpp.o  -o emf2svg-conv  -L/home/paolog/Sviluppo/libemf2svg/build_static  -L/usr/local/lib -Wl,-rpath,/home/paolog/Sviluppo/libemf2svg/build_static:/usr/local/lib: -lm libemf2svg.a -lm -lpng -lz -lfreetype -lfontconfig -lexpat -lpthread -lfreetype -luuid

i.e. adding -lexpat -lpthread -lfreetype -luuid

I'm not so proficient in cmake to be able to propose a fix ...