Sigil-Ebook / flightcrew

Automatically exported from code.google.com/p/flightcrew
GNU General Public License v3.0
33 stars 11 forks source link

Shared library fails to build on linux #35

Closed GoogleCodeExporter closed 12 months ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cmake -G "Unix Makefiles" -DBUILD_SHARED_FC=1 /path/to/extracted/folder
2. make

What is the expected output? What do you see instead?
[ 87%] Building CXX object 
src/FlightCrew/CMakeFiles/FlightCrew.dir/Misc/DetermineMimetype.cpp.o
Linking CXX shared library libFlightCrew.so
/usr/bin/ld: ../../lib/libzipios.a(zipextraction.cpp.o): relocation R_X86_64_32 
against `zipios::IOException::~IOException()' can not be used when making a 
shared object; recompile with -fPIC
../../lib/libzipios.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [src/FlightCrew/libFlightCrew.so] Error 1
make[1]: *** [src/FlightCrew/CMakeFiles/FlightCrew.dir/all] Error 2
make: *** [all] Error 2

What version of the product are you using? On what operating system?
7.2
Ubuntu 10.04 LTS

My solution isn't very elegant, but for each of these files:
src/zipios/CMakeLists.txt
src/BoostParts/CMakeLists.txt
src/XercesExtensions/CMakeLists.txt
src/zlib/CMakeLists.txt
src/Xerces/CMakeLists.txt

after the add_library line, I add this line:

if ( UNIX AND BUILD_SHARED_FC AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
    set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
endif()

then delete the build directory and build again.

Original issue reported on code.google.com by bmaupinc...@gmail.com on 10 Oct 2012 at 11:11

kevinhendricks commented 12 months ago

Closed as this repo is being archived.