compiling MEX unresolved external symbol

조회 수: 14 (최근 30일)
Ginaz Almus
Ginaz Almus 2020년 10월 29일
편집: Jan 2023년 3월 13일
When i try to compile some file with mex function in matlab, i get this error:
compile_command =
mex -DCOMPILE_VISUALIZATION -I"C:\local\boost_1_59_0" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -L"./lib/" -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64" -L"C:\local\boost_1_59_0\lib64-msvc-14.0" -L"./lib/" -llibParallelFDTD -lVoxelizer -lcudart -lcuda -lfreeglut -lglew32 -llibboost_thread-vc140-mt-1_59 -llibboost_system-vc140-mt-1_59 -llibboost_chrono-vc140-mt-1_59 -llibboost_date_time-vc140-mt-1_59 -llibmx -llibut
Building with 'Microsoft Visual C++ 2015 Professional'.
Error using mex
Creating library mex_FDTD.lib and object mex_FDTD.exp
mex_FDTD.obj : error LNK2019: unresolved external symbol "public: void __cdecl FDTD::App::runVisualization(void)"
(?runVisualization@App@FDTD@@QEAAXXZ) referenced in function mexFunction
mex_FDTD.mexw64 : fatal error LNK1120: 1 unresolved externals
Error in compileWIN (line 39)
eval([compile_command ' mex_FDTD.cpp']);
I found that problem is related to runVisualization function but i could not find the reason. When this function is commented in mex_FDTD.cpp file,
eval([compile_command ' mex_FDTD.cpp'])
is working but some errors occurs than when running main project file in matlab.
I've been stuck with this problem, I'll be thankful for any suggestions and comments.

채택된 답변

Aman Vyas
Aman Vyas 2020년 11월 4일
Hi,
You can have a look at similar question and follow the steps as shared:
You mention a library file FDTD.lib but I don't see you use it. Try including it in the mex command so it gets linked in (have all files in the current directory):
mex FDTT.lib and other files too.
Hope it helps !

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by