DlibDotNet icon indicating copy to clipboard operation
DlibDotNet copied to clipboard

Error while building debug DlibDotNet.Native.Dnn on Windows 10

Open KinyaIwamoto opened this issue 4 years ago • 3 comments

Summary of your issue

I was building "DlibDotNet.Native.Dnn" on the command line, referring to the web page "Tutorial for Windows". When I do a debug build, I get an error as shown below and the build stops.

net0.cpp net1.cpp net2.cpp net3.cpp net4.cpp net5.cpp output.cpp adam.cpp sgd.cpp tensor.cpp validation.cpp D:\GitHub\DlibDotNet\src\DlibDotNet.Native.Dnn\dlib\dnn\loss\multiclass_log_per_pixel\defines\net4.cpp(2): error C2471: プログラム データベース 'D:\GitHub\DlibDotNet\src\DlibDotNet.Native.Dnn\build_win_desktop_cpu_x64\DlibDotNetNativeDnn.dir\Debug\vc141.pdb' を更新できません。 [D:\GitHub\DlibDotNet\src\DlibDotNet.Native.Dnn\build_win_desktop_cpu_x64\DlibDotNetNativeDnn.vcxproj] D:\GitHub\DlibDotNet\src\DlibDotNet.Native.Dnn\dlib\dnn\loss\multiclass_log_per_pixel\defines\net2.cpp(2): error C2471: プログラム データベース 'D:\GitHub\DlibDotNet\src\DlibDotNet.Native.Dnn\build_win_desktop_cpu_x64\DlibDotNetNativeDnn.dir\Debug\vc141.pdb' を更新できません。 [D:\GitHub\DlibDotNet\src\DlibDotNet.Native.Dnn\build_win_desktop_cpu_x64\DlibDotNetNativeDnn.vcxproj]

The release build will be completed successfully.

Environment

Write your environment.

What did you do when you faced the problem?

I opened "DlibDotNetNativeDnn.sln" in "DlibDotNet.Native.Dnn\build_win_desktop_cpu_x64" using "Visual Studio2017 IDE" and did a rebuild. And I confirmed that I get the same error. I checked the obj files in "DlibDotNet.Native.Dnn\build_win_desktop_cpu_x64\DlibDotNetNativeDnn.dir\Debug" and manually compiled the corresponding cpp files one by one for the obj files that had not been created.When "error C2471" occurred, I deleted "vc141.pdb" and then compiled again.After all the obj files were created, the build completed successfully, and the DLL and lib files were created.

Example code:

paste your core code

Output:

paste your output

What did you intend to be?

KinyaIwamoto avatar Aug 31 '21 04:08 KinyaIwamoto

@KinyaIwamoto

It could be restriction of VisualStudio. Debug build contains numerous code and pdb file should be huge size. Basically, we can not build DlibDotNet.Native as debug. However, we may be able to build after rid of unnecessary code; e.g. except for code you want to debug.net0.cpp

takuya-takeuchi avatar Aug 31 '21 05:08 takuya-takeuchi

Thank you for your response. Immediately after the error, the vc141.pdb file was 2.74GB. Except for the debug build of "DlibDotNet.Native.Dnn", I was able to build using the Wiki method. "DlibDotNet.Native.Dnn" was able to debug-build by specifying the "/ Z7" option and setting "Generate debug information" to "No" from the Visual Studio 2017 IDE.

KinyaIwamoto avatar Aug 31 '21 08:08 KinyaIwamoto

thank you for your good information!!

"DlibDotNet.Native.Dnn" was able to debug-build by specifying the "/ Z7" option and setting "Generate debug information" to "No" from the Visual Studio 2017 IDE.

Ok, I will add option to CMakeLists.txt

takuya-takeuchi avatar Aug 31 '21 09:08 takuya-takeuchi