ShaoqingRen / faster_rcnn

Faster R-CNN
Other
2.68k stars 1.22k forks source link

A compiling problem with Win10+VS2017+MATLAB R2016b+CUDA9.1: undefined reference #185

Open CrossTalkMan opened 6 years ago

CrossTalkMan commented 6 years ago

Hello guys! I have been troubled in this problem for a long time when I try to run these code on my own computer so I am eager to know if there is anyone who can help me with that. My operating system and MATLAB environment is showed above. The problem is that, when I follow those tutorial given in the README.md and walk to the second step, which is running faster_rcnn_build.m, it throws a error to me like:

Error using **mex**
Warning: corrupt .drectve at end of def file
nms_gpu_mex.o:(.text$mn+0x656): undefined reference to '__security_check_cookie'

nms_gpu_mex.o:(.xdata+0x14): undefined reference to '__GSHandlerCheck'

nms_gpu_mex.o:(.xdata[$unwind$??0?$vector@_KV?$allocator@_K@std@@@std@@QEAA@_KAEBV?$allocator@_K@1@@Z]+0x8): undefined reference to '__CxxFrameHandler3'

nms_gpu_mex.o:(.xdata[$unwind$?catch$0@?0???0?$vector@_KV?$allocator@_K@std@@@std@@QEAA@_KAEBV?$allocator@_K@1@@Z@4HA]+0x8):
undefined reference to '__CxxFrameHandler3'

nms_gpu_mex.o:(.xdata[$unwind$??1?$vector@_KV?$allocator@_K@std@@@std@@QEAA@XZ]+0x8): undefined reference to '__CxxFrameHandler3'

nms_gpu_mex.o:(.xdata[$unwind$??0?$vector@HV?$allocator@H@std@@@std@@QEAA@XZ]+0x8): undefined reference to '__CxxFrameHandler3'

nms_gpu_mex.o:(.xdata[$unwind$??1?$vector@HV?$allocator@H@std@@@std@@QEAA@XZ]+0x8): undefined reference to '__CxxFrameHandler3'

nms_gpu_mex.o:(.xdata[$unwind$?_Reallocate_exactly@?$vector@HV?$allocator@H@std@@@std@@AEAAX_K@Z]+0x8):
more undefined references to '__CxxFrameHandler3' follow
collect2.exe: error: ld returned 1 exit status

Basically, I'm sure that there is no non-English word in my path so I'm curious about those ‘messy code’ as well. But currently the No.1 priority for me is to figure out the reason why it throws the error and how can I fix it. Notice that I made two changes on the source code after several trials:

  1. from CXXFLAGS="\$CXXFLAGS -std=c++11" to COMPFLAGS="\$COMPFLAGS -std=c++11" in order to run codes on Windows properly.

  2. in file 'nvmex.m' I changed Host_Compiler_Location and CUDA_SAMPLES_Location to fit my own software version.

I don't think these two changes can lead to the problem I am facing now but just in case.

Thank all of you!