Click here to Skip to main content
16,022,219 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
1>c1 : fatal error C1007: unrecognized flag '-scanDependenciesx64\Debug\' in 'c1'

is the error I got when building my project,

What I have tried:

I think 'c1' meant command line

so I looked into the command line and 'All Options' but I couldn't find the flag, also the error just popped up since I didn't add an options.

(Config: Debug, Platform: x64)

Does anyone know how to fix this?
Posted
Comments
jeron1 15-Aug-24 10:42am    
Is 'scanDependenciesx64' a valid flag?
Symynn 15-Aug-24 11:05am    
probably not, I think unrecognized means that it is not valid
jeron1 15-Aug-24 11:06am    
I would agree.
jeron1 15-Aug-24 11:09am    
I read "You normally shouldn't set the /scanDependencies option in the Visual Studio development environment. The compiler doesn't generate object files when you set this option, which makes the link step fail and report an error." at the following link

https://learn.microsoft.com/en-us/cpp/build/reference/scandependencies?view=msvc-170

I would scour this, and the other compiler options, and see where it takes you.
[no name] 15-Aug-24 11:07am    
The name "c1" refers to a phase of the compiler, so there is something in your project settings that is causing a problem. Please use the Improve question link above, and add the settings from your prject to see if there is something incorrectly set.

1 solution

The MS C/C++ compiler is called "cl", not "c1".

There is no such switch as "/scanDependenciesx64\Debug\". It looks like you added a messed up switch to your project or edited the project file and messed it up.

The switch should be "/scanDependencies x64\Debug\". Notice the space after "/scanDependencies".

Go into the Project menu and click Properties. In the dialog that shows up, expand the C/C++ node, then look for "Output Files" under that. There's an option for "Module Dependencies File Name". By default, it should have the value "$(IntDir)".

Further down, there's another option for "Source Dependencies File Name" and it should have the exact same value, "$(IntDir)".

Immediately about that option, you'll find "Generate Source Dependencies File". The default is "No" but is probably turned on in your case. It'll say "Yes (/sourceDependencies )" if it is. Just turn this off and the error will go away.
 
Share this answer
 
Comments
[no name] 15-Aug-24 12:03pm    
c1 is, as I mentioned above, a phase of the compiler. It's executed from cl.exe via the c1.dll.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900