niuzhiheng / caffe

Caffe
http://caffe.berkeleyvision.org/
BSD 2-Clause "Simplified" License
317 stars 129 forks source link

"too many characters in constant" error with concrt.h in VC11 #84

Open johnhany opened 8 years ago

johnhany commented 8 years ago

I'm using VS2012 with CUDA 7.5 and have already changed CUDA version number in MainBuilder.vcxproj so that I can open the project properly. But I have encountered the following errors while building the solution, no matter how I switch the build configuraion (Release or Debug, Win32 or x64):

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\concrt.h(5762): error C2015: too many characters in constant C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\concrt.h(5762): error C2146: syntax error : missing ')' before identifier 'q' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\concrt.h(5762): error C2059: syntax error : ')' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\concrt.h(5762): error C2001: newline in constant

... and so on...

The codes that cause these errors are like this:

extern "C" const __declspec(selectany) GUID ConcRT_ProviderGuid = { 0xF7B697A3, 0x4DB5, 0x4d3b, { 0xBE, 0x71, 0xC4, 0xD2, 0x84, 0xE6, 0x59, 0x2F } };

It looks like the hex values have been interpreted into ASCII and parsed as characters, but I'm not even sure how to describe this kind of error so that I can google it myself. Anyone has any idea how to solve this problem, perhaps?