- Open the "compute_correspondences.cpp" file and verify that the "compute_correspondences_mex" function is defined correctly. It should be checked that the function signature matches the declaration, and that the implementation is correct.
- Check that the necessary header files are included in the "compute_correspondences.cpp" file and ensure that any required dependencies or libraries are properly included and linked.
- Double-check that the "compute_correspondences_mex" function is being compiled and linked correctly. Ensure that it is included in the build process and that the appropriate compiler and linker flags are set.
- If external libraries or dependencies are being used, ensure they are installed and configured.
- Verify that the version of the compiler being used is compatible with the libraries and dependencies. Incompatibilities between different versions of the compiler and libraries can sometimes cause undefined reference errors.
Mex bail out when compiling meshmonk when it get this warnings
1 view (last 30 days)
Show older comments
Mex bail out when compiling meshmonk when it get this warnings
Building with 'g++'.
/usr/bin/g++ -c -DMATLAB_DEFAULT_RELEASE=R2017b -DUSE_MEX_CMD -D_GNU_SOURCE -DMATLAB_MEX_FILE -I"/usr/local/include" -I"/usr/local/MATLAB/R2023a/extern/include" -I"/usr/local/MATLAB/R2023a/simulink/include" -fexceptions -fPIC -fno-omit-frame-pointer -pthread -O2 -fwrapv -DNDEBUG "/extra_space2/sources/meshmonk/matlab/mex/compute_correspondences.cpp" -o /tmp/mex_201858686456805_1416650/compute_correspondences.o
/usr/bin/g++ -c -DMATLAB_DEFAULT_RELEASE=R2017b -DUSE_MEX_CMD -D_GNU_SOURCE -DMATLAB_MEX_FILE -I"/usr/local/include" -I"/usr/local/MATLAB/R2023a/extern/include" -I"/usr/local/MATLAB/R2023a/simulink/include" -fexceptions -fPIC -fno-omit-frame-pointer -pthread -O2 -fwrapv -DNDEBUG "/usr/local/MATLAB/R2023a/extern/version/cpp_mexapi_version.cpp" -o /tmp/mex_201858686456805_1416650/cpp_mexapi_version.o
{
"bundle.symbolic_name" : "dd3450b1-d866-4bb8-9747-c25cb2ef8e62",
"mw" :
{
"mex" :
{
"apiVersion" : 0,
"release" : "R2023a",
"threadpoolSafe" : 0
}
}
}
/usr/local/MATLAB/R2023a/bin/glnxa64/usResourceCompiler3 --manifest-add /tmp/mex_201858686456805_1416650//mw_mex_tempmex_manifest.json --bundle-name mexVersioning --out-file /tmp/mex_201858686456805_1416650//mw_mex_tempmex_bundle.zip
/usr/bin/g++ -pthread -Wl,--no-undefined -shared -O -Wl,--version-script,"/usr/local/MATLAB/R2023a/extern/lib/glnxa64/c_exportsmexfileversion.map" /tmp/mex_201858686456805_1416650/compute_correspondences.o /tmp/mex_201858686456805_1416650/cpp_mexapi_version.o -lmeshmonk -lstdc++ -Wl,--as-needed -Wl,-rpath-link,/usr/local/MATLAB/R2023a/bin/glnxa64 -L"/usr/local/MATLAB/R2023a/bin/glnxa64" -Wl,-rpath-link,/usr/local/MATLAB/R2023a/extern/bin/glnxa64 -L"/usr/local/MATLAB/R2023a/extern/bin/glnxa64" -lMatlabDataArray -lmx -lmex -lm -lmat -o compute_correspondences.mexa64 -Wl,--format=binary -Wl,/tmp/mex_201858686456805_1416650//mw_mex_tempmex_bundle.zip -Wl,--format=default
/usr/bin/ld: warning: /tmp/mex_201858686456805_1416650//mw_mex_tempmex_bundle.zip: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: /tmp/mex_201858686456805_1416650/compute_correspondences.o: in function `mexFunction':
compute_correspondences.cpp:(.text+0x354): undefined reference to `compute_correspondences_mex'
collect2: error: ld returned 1 exit status
0 Comments
Answers (1)
Ashutosh
on 18 Aug 2023
The error message with "ld” indicates that it is a linker error where after the compilation the linker is unable to find the reference or definition of the "compute_correspondences_mex" function in the "compute_correspondences.cpp" file.
To resolve this issue, please ensure that the "compute_correspondences_mex" function is properly defined and implemented in the "compute_correspondences.cpp" file. You can follow these steps:
0 Comments
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!