compiling MEX unresolved external symbol

13 ビュー (過去 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 Center および File ExchangeMATLAB Compiler についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by