-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking problem: relocation R_X86_64_PC32 against symbol `_ZN5QJson13ParserPrivateC1Ev' #24
Comments
Please try again following these instructions. |
What exactly I'm missing from instructions? Do you mean these lines? mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=... |
Just the
part |
I tried this - got the same error. Here's full output: vsapronov@vsapronov-HP-Z620:~/Projects/own/qjson$ git status
# On branch master
nothing to commit, working directory clean
vsapronov@vsapronov-HP-Z620:~/Projects/own/qjson$ mkdir build
vsapronov@vsapronov-HP-Z620:~/Projects/own/qjson$ cd build
vsapronov@vsapronov-HP-Z620:~/Projects/own/qjson/build$ cmake ..
-- The C compiler identification is GNU 4.7.3
-- The CXX compiler identification is GNU 4.7.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Qt5 found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vsapronov/Projects/own/qjson/build
vsapronov@vsapronov-HP-Z620:~/Projects/own/qjson/build$ make
Scanning dependencies of target qjson_automoc
[ 11%] Automoc for target qjson
Generating moc_parserrunnable.cpp
Generating moc_qobjecthelper.cpp
/home/vsapronov/Projects/own/qjson/src/qobjecthelper.h:0: Note: No relevant classes found. No output generated.
Generating moc_serializerrunnable.cpp
[ 11%] Built target qjson_automoc
Scanning dependencies of target qjson
[ 22%] Building CXX object src/CMakeFiles/qjson.dir/parser.cpp.o
[ 33%] Building CXX object src/CMakeFiles/qjson.dir/qobjecthelper.cpp.o
[ 44%] Building CXX object src/CMakeFiles/qjson.dir/json_scanner.cpp.o
[ 55%] Building CXX object src/CMakeFiles/qjson.dir/json_parser.cc.o
[ 66%] Building CXX object src/CMakeFiles/qjson.dir/parserrunnable.cpp.o
[ 77%] Building CXX object src/CMakeFiles/qjson.dir/serializer.cpp.o
[ 88%] Building CXX object src/CMakeFiles/qjson.dir/serializerrunnable.cpp.o
[100%] Building CXX object src/CMakeFiles/qjson.dir/qjson_automoc.cpp.o
Linking CXX shared library ../lib/libqjson.so
/usr/bin/ld: CMakeFiles/qjson.dir/parser.cpp.o: relocation R_X86_64_PC32 against symbol `_ZN5QJson13ParserPrivateC1Ev' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libqjson.so.0.8.1] Error 1
make[1]: *** [src/CMakeFiles/qjson.dir/all] Error 2
make: *** [all] Error 2
|
Ok, I see you are using Qt5. Please provide the following details:
|
I'm running Ubuntu 13.04 x64. Qt is 5.0.1. As I mentioned I installed Qt SDK through package-manager (ubuntu-sdk). I noticed you recommended this ppa in bug 19. This ppa now says the phrase below. That's why I'm using ubuntu-sdk package. == Ubuntu 13.04 == |
Ok, I'll take a look at it using a virtual machine. |
Please, take a look. I have tried on my both work and home machines. Both the same Ubuntu 13.04 x64 and the same Qt SDK package (ubuntu-sdk). Both giving the same error. |
This is a nasty bug, I've been able to reproduce it but I need some time to fix it. |
That version of compiller you have? (Ubuntu 13.xx seems to have gcc 4.7...) I have like this error compiling other libs (written with qt5) with gcc < 4.8. Currently I am working on "some" shared library with qt5 and if I try compile one of my library with g++ 4.6 o 4.7 I get this error. But if I compile it with g++ 4.8 or clang 3.2, all works properly. I tried to compile qjson with clang++ 3.2 or g++ 4.8 and compiles properly! This seems qt5 bug with "old compillers", not qjson bug. |
Error is due to 'SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")' |
relocation R_X86_64_PC32 against symbol `ff_pw_9' can not be used when making a shared object; recompile with -fPIC |
HI,
I'm trying to build your library with ubuntu-sdk package on Ubuntu 13.04 x64
I'm doing in qjson folder:
cmake -G "Unix Makefiles" make
I'm getting this error:
Linking CXX shared library ../lib/libqjson.so /usr/bin/ld: CMakeFiles/qjson.dir/parser.cpp.o: relocation R_X86_64_PC32 against symbol `_ZN5QJson13ParserPrivateC1Ev' can not be used when making a shared object; recompile with -fPIC
The text was updated successfully, but these errors were encountered: