mex a statisc library error

please help me:when I run
mex enkfgoesrtv.f90 -I/sat7/jzhang/GOES/crtm-2.05_clear/include/ -L/sat7/jzhang/GOES/crtm-2.05_clear/lib -lCRTM
error information:
/usr/bin/ld: /sat7/jzhang/GOES/crtm-2.05_clear/lib/libCRTM.a(crtm_clear.o): relocation R_X86_64_32S against `crtm_clear_$BLK.var$3218' can not be used when making a shared object; recompile with -fPIC /sat7/jzhang/GOES/crtm-2.05_clear/lib/libCRTM.a: could not read symbols: Bad value collect2: ld returned 1 exit status
mex: link of ' "enkfgoesrtv.mexa64"' failed.
??? Error using ==> mex at 208 Unable to complete successfully.

回答(1 个)

Kaustubha Govind
Kaustubha Govind 2012-11-5

0 个投票

MEX-files are essentially shared libraries with a MEX-specific extensions. All shared libraries on Linux can only be linked against other libraries that have been compiled with the -fPIC option. See HOWTO fix -fPIC errors for more information.

类别

帮助中心File Exchange 中查找有关 MATLAB Compiler 的更多信息

产品

标签

提问:

Jie
2012-11-5

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by