mex_assess_one_sel.o: relocation R_X86_64_32 against
`.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/tmp/mex_2366922350995321_500/mex_assess_one_sel.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
I don't exactly know what it is, but as it prompted, I go on add -fPIC to the CXXFLAGS:
gcc_string = ['GCC=''', gcc_compiler, ''' ', 'CXXFLAGS=''', '-std=c++11 -fPIC', ''' '];
everything works well after this, hope this experience helps somebody else.
I compiled COB on my computer, the environment is: Ubuntu14 with g++4.8.4.
The origin mex compile option is:
GCC='g++'
inbuild.m
line64:gcc_string = ['GCC=''' gcc_compiler ''' '];
.A error occured when I compile with this option which said:
Obviously c++11 is not on, so I add '-std=c++11' to the option:
gcc_string = ['GCC=''', gcc_compiler, ''' ', 'CXXFLAGS=''', '-std=c++11', ''' '];
Error resolved but another occurs:
I don't exactly know what it is, but as it prompted, I go on add
-fPIC
to the CXXFLAGS:gcc_string = ['GCC=''', gcc_compiler, ''' ', 'CXXFLAGS=''', '-std=c++11 -fPIC', ''' '];
everything works well after this, hope this experience helps somebody else.