Why do I get a linker error when compiling MATLAB Coder output?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have generated C++ code for 2 MATLAB functions, and I have made a main file from the 2 examples. I have it compiling against the generated libraries, but I'm getting the following linker error:
/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
I am using g++ version 7.4.0 and ld version 2.30
Using the --no-relax option results in several undefined reference errors to functions that are found in the libraries.
gen/libdata2image_mmw.a(data2image_mmw_initialize.o): In function `data2image_mmw_initialize()':
data2image_mmw_initialize.cpp:(.text+0x1a): undefined reference to `omp_init_nest_lock'
gen/libdata2image_mmw.a(data2image_mmw_terminate.o): In function `data2image_mmw_terminate()':
data2image_mmw_terminate.cpp:(.text+0x8): undefined reference to `omp_destroy_nest_lock'
gen/libdata2image_mmw.a(data2image_mmw.o): In function `data2image_mmw(creal_T const*, double const*, double, double, double, double, double*, double*, emxArray_real_T*, emxArray_creal_T*)':
data2image_mmw.cpp:(.text+0x11e): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x13e): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x14a): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x151): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x1bc): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x1c4): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x1cc): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x1d7): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x20e): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x21b): relocation truncated to fit: R_X86_64_PC32 against `.bss'
data2image_mmw.cpp:(.text+0x222): additional relocation overflows omitted from the output
gen/libdata2image_mmw.a(fft1.o): In function `b_r2br_r2dit_trig(creal_T const*, double const*, double const*, creal_T*) [clone ._omp_fn.0]':
fft1.cpp:(.text+0x218): undefined reference to `omp_get_num_threads'
fft1.cpp:(.text+0x220): undefined reference to `omp_get_thread_num'
gen/libdata2image_mmw.a(fft1.o): In function `r2br_r2dit_trig(creal_T const*, double const*, double const*, creal_T*) [clone ._omp_fn.1]':
fft1.cpp:(.text+0x348): undefined reference to `omp_get_num_threads'
fft1.cpp:(.text+0x350): undefined reference to `omp_get_thread_num'
gen/libdata2image_mmw.a(fft1.o): In function `b_r2br_r2dit_trig(creal_T const*, double const*, double const*, creal_T*)':
fft1.cpp:(.text+0x496): undefined reference to `omp_get_max_threads'
fft1.cpp:(.text+0x4c0): undefined reference to `GOMP_parallel'
gen/libdata2image_mmw.a(fft1.o): In function `r2br_r2dit_trig(creal_T const*, double const*, double const*, creal_T*)':
fft1.cpp:(.text+0x564): undefined reference to `omp_get_max_threads'
fft1.cpp:(.text+0x58e): undefined reference to `GOMP_parallel'
collect2: error: ld returned 1 exit status
4 commentaires
Réponses (1)
Ashrarul Sifat
le 5 Fév 2020
Did you solve this? Also the link from the previous answer is unavailbe now
Voir également
Catégories
En savoir plus sur MATLAB Coder dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!