CUDA error MSB3191 - c++

I tried to do the two new steps manually in my older project (CUDA Link Error (Lib to Dll)) to get my CUDA kernel running (just added the structure to the Lib part of the project). The steps are:
1: Project's 'Build Customization' to use CUDA 7.0(.targets, .props)
2: TestKernel.cu I've changed it's type to CUDA C/C++ in the Class Property Page.
Now I'm getting the following error message from CUDA 7.0.targets:
Error 1 error MSB3191: Unable to create directory
"SourceLib.dir\Debug\C:\Users\Matthieu\Desktop\Project\src\SourceLib\Helpers\".
The given path's format is not supported. C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA
7.0.targets 412 9 SourceLib
I've searched for a solution but I can't find any. Everyone is talking about this part "SourceLib.dir\Debug\C:\Users.......", which obviously looks wrong, but I can't find the setting in Visual Studio or CMake. Where can I adjust this?
It's similar to this question (CUDA 6.5: error MSB3191 Unable to create directory and LNK2001 Unresolved External symbol), but I can't fix it by copying the .cu file.
If I don't set the .targets file it won't build. I'll get the older error. Any help?
And alternative for getting the setup running using Cmake is also welcome :)
Thx!

The issue was that the CMake file was filling "SourceLib.dir\Debug" into the Intermediate Directory property (Project Properties -> General). Deleting it resolved the issue with the CUDA 7.0 target

Related

LNK1181 Error while compiling the core after adding a module

I'm trying to compile my core with some modules but i'm getting the following error when building worldserver:
cannot open input file '..\..\..\modules\RelWithDebInfo\modules.lib' worldserver
This error only happens when compiling with the mod-gain-honor-guard module. I've installed a repack before that came with this module pre-installed, which makes me think that i'm the one missing something.
Any ideas?
Thanks!
I've compiled the core succesfully with only one module, then i've added the one mentioned before and that error came up. CMake didn't show me any error when i regenerated the source for building after adding the module
You always need to regenerate the source in CMake when you add or remove any files to the source.
Did you get the module via git clone? If not, and it's a direct download, you need to remove the -master or any other branch name from the folder name.

Issu using startMATLAB in C++ with "MatlabEngine.hpp" in r2017b

In its new version 2017b, Matlab has released a new MATLAB Engine API for C++: https://fr.mathworks.com/help/matlab/calling-matlab-engine-from-cpp-programs.html
When I try to use this API, (only to start Matlab at the beginning !!), I have an issue using :
std::unique_ptr<MATLABEngine> matlabPtr = startMATLAB();
The compilation is ok, but at the execution :
Here is the call stack:
matlab::engine::initSession --> matlab::engine::startMATLAB -->
matlab::engine::startMATLABAsync --> engine_create_session
Now, I use a different way to do my job, but I don't want to let an issue without a solution. Can someone spot the problem with this API?
My configuration :
Matlab 2017b
Visual Studio 2017
Windows 10
Just a few days back, I had the same issue: here
So, I had raised a ticket in MATLAB for technical support. And they suggested to build the project in the following manner which works for me:
Create a project and add the source file.
Go to the project properties, and do the following changes(Make sure to change the architecture to X64):
Under C/C++ General, add the following directory to the field
ADDITIONAL INCLUDE DIRECTORIES: C:\Program Files\MATLAB\\extern\include
Under C/C++ Precompiled Headers, select "Not Using Precompiled
Headers".
Under Linker General, add the directory to the field ADDITIONAL
LIBRARY DIRECTORIES: C:\Program
Files\MATLAB\\extern\lib\win64\microsoft
e. Under Configuration Properties ->Debugging Add the following 2
Target paths in the Environment: PATH=C:\Program
Files\MATLAB\\bin\win64; PATH=C:\Program
Files\MATLAB\\extern\bin\win64;
Under Linker Input, add the following names to the field marked ADDITIONAL DEPENDENCIES:
libmat.lib
libMatlabEngine.lib
libMatlabDataArray.lib
Make sure that the following directory is in the Windows system
environment PATH: C:\Program Files\MATLAB\\bin\win64;
C:\Program Files\MATLAB\\extern\bin\win64
Now, build the project and run your application.
Like in the comment, I solved the issue by upgrading Matlab from R2017b to R2018b!
I noticed the same issue testing R2020b
while it worked fine with R2020a, a run-time error occurs with R2020b when running
std::unique_ptr matlabPtr = startMATLAB();

New to LibVLC - Trying out libVLC on VS2010

I downloaded vlc-2.2.4-win32.7z and extracted the files. I created an empty project in VS2010 and create a cpp file using the code I found on https://wiki.videolan.org/LibVLC_Tutorial/
On VS2010 project property, I added the include file folder and added Linker library folder and libvlc.lib, libvlccore.lib, vlc.lib, vlccore.lib to additional dependencies.
I got this build error --> D:\VLC\vlc-2.2.4\sdk\lib\vlccore.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x16.
I have re-downloaded the file and still having the same error. Is there anything that I had done wrong .
Thanks,
Alex
For some reasons, the later versions do not work. I downloaded 2.1.3 and it worked.

Error running Opencv sample code

I am starting with OpenCV on my new laptop, but there are some errors. I followed all the steps mentioned in the OpenCV tutorials in doc directory. But the sample code just does not work. This is the error:
">c:\users\ankit\documents\visual studio 2010\projects\test\test\test.cpp(7):
fatal error C1083: Cannot open include file: 'opencv2/imgproc/imgproc.hpp':
No such file or directory
1>
1>Build FAILED."
I am working on Win7 64 bit machine. I have already included Additional directories and libraries in Property Page. Still it gives me this error. Help.
You obviously entered a wrong include directory. Navigate to included directory and make sure that it contains file opencv2/imgproc/imgproc.hpp.
Update:
Here's error doc. See all the causes.
Update #2:
About your new issue.

VC2008 compiler errors opening sbr files (C2418 C1903 C2471)

EDIT: See my answer below for the hotfix.
ORIGINAL QUESTION:
In setting up for our boat-programming adventure I have to set up source control and fix project files for a team to use them. (the project was previously only being worked on by one person who took shortcuts with setting up the project includes, etc)
I am fixing those SLN and Proj files. When trying to do a build on an external USB drive (I have not tried it on the primary hard drive) I am getting odd errors (lots of them for various files):
fatal error C1083: Cannot open
compiler generated file:
'.\Debug\.sbr': Permission
denied
These files are referenced in the vcproj file with relative paths in double quotes:
RelativePath="..\..\Source\.cpp"
I get the same errors form within a sln file in the IDE or if I call msbuild with the sln file.
The files are kind of "shared" for a few sln files (projects).
The person who originally created the SLN files is not known for being a wizard at configuring MSDev or making things work for teams.
Is this an issue with the way the source files are referenced? Any suggestions on how to fix these?
This URL does not seem to have helpful information:
Fatal Error C1083 on MSDN
Note - there were/are still hardcoded paths in the proj file, but i don;t see them for these files. They were mostly for the include and lib dirs. I think I removed them all.
I also get these errors:
..\..\Source\.cpp : error C2471:
cannot update program database '\debug\vc90.pdb'
..\..\Source\.cpp(336) : fatal
error C1903: unable to recover from
previous error(s); stopping
compilation
..\..\Source\.cpp(336) : error
C2418: cannot delete browser file:
.\Debug\.sbr
Title: You may receive a "PRJ0008" or "C2471" or "C1083" or "D8022" or "LNK1103" or similar error message when you try to build a solution in Visual C++
Symptoms:
D8022 : Cannot open 'RSP00000215921192.rsp'
PRJ0008 : Could not delete file 'vc90.idb'.
C1083 : Cannot open program database file 'vc90.pdb'
C2471 : Cannot update program database 'vc90.pdb'
LNK1103 : debugging information corrupt.
Cause:
This problem occurs when all of the following conditions are true:
You have a solution with more than one project in it.
Two or more of the projects are not dependent on each other.
You have parallel builds enabled. (Tools -> Options: Projects and Solutions, Build and Run: "maximum number of parallel project builds" is set to a value greater than 1)
You are building on a system with multiple CPUs (cores).
Two or more of the non-dependent projects are configured to use the same Intermediate and/or Output directory.
A specific race condition in mspdbsrv.exe remains uncorrected.
Resolution:
To resolve the problem do one or more of the following:
Reconfigure the non-dependent projects to specify an Intermediate and Output directory that is different from one another, e.g. Output Directory = "$(SolutionDir)$(ProjectName)\$(ConfigurationName)", Intermediate Directory = "$(OutDir)".
Adjust your solution's project dependencies (Project -> Project Dependencies...) so that each is dependent on another.
Disable parallel builds.
Add the "/onecpu" boot option to your boot.ini file.
Change you BIOS settings to enable/use only one CPU.
File a problem report with Microsoft Technical Support and keep bugging the crap out of them until they eventually fix mspdbsrv.
Status:
The problem is a combination of both a user project configuration error as well as a race condition in Microsoft's "mspdbsrv.exe" utility that does not properly handle more than one thread calling it at the same time for the same file resulting in the file's HANDLE being left open.
Additionally Visual Studio itself and/or its build system (VCBUILD and/or MSBUILD) (or all three!) should be made smart enough to detect and alert the user of such user errors so that corrective action can be taken.
This problem has been around for a LOOOOOONG time.
Applies to:
Microsoft Visual C++ 2005
Microsoft Visual C++ 2008
Others?
Respectfully submitted:
"Fish" (David B. Trout)
fish#infidels.org
p.s:
You're welcome. :)
Hmmm.
Perhaps:
http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/0ceac3c6-62f6-4fdf-82e1-d41e1b4fcd20/
there is a hotfix from MS
http://code.msdn.microsoft.com/KB946040
http://support.microsoft.com/kb/946040
That might be my problem. I think it might only be on one machine I have.
EDIT:
I downloaded and ran the hotfix installer. It seems to have fixed it.
I get this same error when I physically remove a file from disk, but leave it in VS. In VS2005 it would give a much better : fatal error file not found. I think this is a bug in VS2008. The hotfix mentioned above didn't help me.
In my case it was my virus package (Trend Micro) causing all the problems. I added my Dev folders to the Ignore/White lists to solve the problem
delete your debug folder and build your project agian.
Occastionally my Visual Studio will suddenly decide something like this. I have found it maybe help to toggle to release, do a full rebuild, then toggle back to debug.