I’ve been working on a CUDA project for a while now…working in MSVS with no problems, building, editing, building again, running, editing, building, etc. For months…no problems.
Today, all of a sudden, I get this error when i try to build today:
LINK : fatal error LNK1181: cannot open input file '.\Debug\myFile.obj
Now I can’t build the file at all. What happened and how do I fix this? I remember when it happened i was building changing one or two TINY things in my code and then within seconds building again. This happened two or three times. And then, on the last attempt at buliding, this error popped up.
Could it be something I hit accidentally?
I found another thread briefly discussing this and someone suggested to try to right click on the actual .cu file and compile it. I did this. but when I try to run the program, it says the solution needs to be built, which then brings about the same error.
I had already tried cleaning the solution b4 posting. I cleaned, rebooted, tryed again…same error.
What’s weird is that when i compile ONLY the .cu file by right clicking on that file and clicking compile, it does successfully compile that file. In doing so, shouldn’t an obj file be created from that file?
Cause when I go to check the directory where it expects to see this file, C:\ProgramData\NVIDIA Corporation\NVIDIA CUDA SDK\bin\win32\Debug, that file is not found.
Just so you know, since i was (and still am) new at this, I took the advice on a previous thread and simply copied the template project/solution and used it to make my simulator.
As a result, my project has three items in it: mySimulator.cu, template_gold.cpp, and template_kernel.cu. Those last two files are from the template project and really don’t need to be there (I think)…because my kernel is actually just coded into the same file as the rest of my program…into mySimulator.cu. But I’ve never deleted those other two files cause i wasn’t sure if that would mess something up. So that is a side question, can I delete those files, KNOWING that this was originally copied from the template solution, and knowing that in my main mySimulator.cu (which was previously template.cu), I deleted any and all references to the other two files.
Okay, to answer your question…
When you say command line arguments, since I’m using MSVS 2008, I guess you mean the “command line” stuff seen when i click the .cu file and click on properties. When I do this, I come to configuration properties, one of which is the command line property, which has this:
Again, that is the command line specifically for the mySimulator.cu file. And to be honest, i’m not sure what all that is trying to say. But again, it is the command line from the template file. I’ve never changed it.
You said check the output of the .obj file. How do I do that? Again, i can’t build the solution. However, as mentioned, I can right click on JUST the mySimulator.cu file and compile it. And when doing so, shouldn’t it create an obj file? But i can’t locate it.
Anyway, hopefully this gives you something to work with to help formulate what i’m doing wrong.
Sorry, I should have been a little bit more clear…
From what I see in my projects, I have two source files inside of ‘My Documents\SVM_Project\SVM\SVM_BlockPerTestPt’:
When I right click on the cu file and select compile, I get SVMClassify_kernels.obj output file in ‘My Documents\SVM_Project\SVM\SVM_BlockPerTestPt\EmuDebug’:
The fact that you are getting an error looking for ‘myFile.obj’ suggests to me that your linker is looking for a compiled myFile.cu/cpp/c file. If this doesn’t exist anywhere, I don’t know why it would be looking for this.
Could you have somehow added the dependency for the project?
Does a Release build work for you?
Are you using the CUDA VS Wizard? If not, I would suggest looking into it…