Compiling CUDA files with mex -v mexGPUExample.cu
Show older comments
Im trying to compile CUDA files into mex.
Matlab ships with an example CUDA file located in matlabfolder\toolbox\distcomp\gpu\extern\src\mex, but when I try to compile it by typing:
mex -v mexGPUExample.cu
I get:
Error using mex
Creating library mexGPUExample.lib and object mexGPUExample.exp
MSVCRT.lib(atonexit.obj) : error LNK2019: unresolved external
symbol __imp_EncodePointer referenced in function __atonexitinit
MSVCRT.lib(crtdll.obj) : error LNK2001: unresolved external symbol
__imp_EncodePointer
MSVCRT.lib(atonexit.obj) : error LNK2019: unresolved external
symbol __imp_DecodePointer referenced in function _onexit
MSVCRT.lib(crtdll.obj) : error LNK2001: unresolved external symbol
__imp_DecodePointer
MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external
symbol __imp_QueryPerformanceCounter referenced in function
__security_init_cookie
MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external
symbol __imp_GetCurrentProcessId referenced in function
__security_init_cookie
MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external
symbol __imp_GetCurrentThreadId referenced in function
__security_init_cookie
MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external
symbol __imp_GetSystemTimeAsFileTime referenced in function
__security_init_cookie
MSVCRT.lib(dllmain.obj) : error LNK2019: unresolved external symbol
__imp_DisableThreadLi
braryCalls referenced in function DllMain
mexGPUExample.mexw64 : fatal error LNK1120: 7 unresolved externals
Im using the VS2013 cuda7.5 and Windows SDK 8.1A ,why have this problem?
Answers (1)
Joss Knight
on 6 Sep 2017
0 votes
2 Comments
weller
on 6 Sep 2017
Joss Knight
on 8 Sep 2017
No, because that compiler isn't supported by the CUDA compiler. Can you give me the verbose output from mexcuda? I need to see why it's not picking up your Visual Studio installation.
Categories
Find more on GPU Computing 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!