Linker error when using SLD2 with MEXCUDA

2 次查看(过去 30 天)
Hi,
I want to use SDL in my CUDA code, but I'm having issues with compiling my code. To simplify, I'm just trying to initizlize SDL with "SDL_Init(SDL_INIT_VIDEO);" in my cuda code. I use the followings to compile the main code (TUI_Main.cu):
ipath2 = ['-I' fullfile('E:\compilers\SDL2-devel-2.0.16-mingw\SDL2-2.0.16\i686-w64-mingw32\include\SDL2')];
ipath3 = ['-L' fullfile('E:\compilers\SDL2-devel-2.0.16-mingw\SDL2-2.0.16\i686-w64-mingw32\lib ') '-lSDL2 ' '-lSDL2main'];
Flags=['NVCCFLAGS=-gencode=arch=compute_50,code=sm_50 -Xptxas -dlcm=cg'];
mexcuda('-R2018a','TUI_Main.cu',ipath2,ipath3,Flags );
here is the error:
Error using mex
Creating library TUI_Main.lib and object TUI_Main.exp
TUI_Main.obj : error LNK2019: unresolved external symbol SDL_Init referenced in function mexFunction
TUI_Main.mexw64 : fatal error LNK1120: 1 unresolved externals
could you please let me know what is it that I'm missing?
Moein.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 GPU CUDA and MEX Programming 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by