Skip to content
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

/usr/bin/ld: ../tron.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC #58

Open
PapaMadeleine2022 opened this issue May 18, 2018 · 0 comments

Comments

@PapaMadeleine2022
Copy link

hello, when I run make under the dir external/liblinear-1.93_multicore/matlab, I get this error:
make -C .. tron.o make[1]: Entering directory 'xxx/SPP_net/external/liblinear-1.93_multicore' g++ -c -o tron.o tron.cpp make[1]: Leaving directory 'xxx/SPP_net/external/liblinear-1.93_multicore' make -C .. linear.o make[1]: Entering directory 'xxx/SPP_net/external/liblinear-1.93_multicore' g++ -c -o linear.o linear.cpp make[1]: Leaving directory 'xxx/SPP_net/external/liblinear-1.93_multicore' g++-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c linear_model_matlab.cpp linear_model_matlab.cpp: In function ‘const char* models_to_matlab_structure(mxArray**, std::vector<model*>&)’: linear_model_matlab.cpp:118:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] linear_model_matlab.cpp: In function ‘const char* matlab_matrix_to_models(std::vector<model*>&, const mxArray*)’: linear_model_matlab.cpp:205:48: warning: conversion to ‘int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion] make -C ../blas OPTFLAGS='-Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I..' CC='gcc-4.7'; make[1]: Entering directory '/home/ztgong/work/image/detection-recognition/SPPNet/SPP_net/external/liblinear-1.93_multicore/blas' gcc-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c dnrm2.c gcc-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c daxpy.c gcc-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c ddot.c gcc-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c dscal.c ar rcv blas.a dnrm2.o daxpy.o ddot.o dscal.o a - dnrm2.o a - daxpy.o a - ddot.o a - dscal.o ranlib blas.a make[1]: Leaving directory '/home/ztgong/work/image/detection-recognition/SPPNet/SPP_net/external/liblinear-1.93_multicore/blas' /usr/local/MATLAB/R2014b/bin/mex train.cpp ../tron.o ../linear.o linear_model_matlab.o ../blas/blas.a Building with 'g++'. /usr/bin/ld: ../tron.o: relocation R_X86_64_32S against.text' can not be used when making a shared object; recompile with -fPIC
../tron.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

Makefile:33: recipe for target 'train.mexa64' failed
make: *** [train.mexa64] Error 255
`
how to fix it? can you give some advises?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant