13

I am getting following error while building my vc++ project (Using visual studio 2010)

RC : fatal error RC1107: invalid usage; use RC /? for

I know there is some issue while building resources but how to get the exact problem area?

Thanks

6
  • Are you using Visual Studio 2005? If that's the case, this question on the MSDN forums might apply to you. Commented Jan 18, 2012 at 15:03
  • Sorry I didn't mentioned about the Visual Studio version, it's VS 2010.
    – Rahul
    Commented Jan 18, 2012 at 15:05
  • Where do you get the error? While the program is running or when you compile? Commented Jan 18, 2012 at 15:56
  • There's an rc.command.x.tlog file in the build directory that shows the arguments passed to rc.exe. Post it here if you can't sort it out. Commented Jan 18, 2012 at 18:05
  • @Александър Александров I am getting this error building my vc++ project. It's not at runtime.
    – Rahul
    Commented Jan 19, 2012 at 5:29

8 Answers 8

28

Solution: Add a slash to the last include path will do the trick. If your last include path already contain a slash at the end, delete it will also work.

Note: Some other include paths can cause this too; it doesn't have to be the very last include path. In particular, check the last include path that you add (in addition to the built-in ones) in your project/properties file.

9
  • particularly amazing!
    – Unicorn
    Commented Jan 19, 2017 at 9:29
  • 3
    Still true and fix works years later in VS 2017. Thank you
    – zzz
    Commented Jul 14, 2017 at 2:41
  • I so much love this solution!
    – goldstar
    Commented Apr 2, 2018 at 13:44
  • 3
    January 24, 2021 This is still a bug in Visual C++ 2019. Thanks. Commented Jan 24, 2021 at 16:57
  • 2
    I added to the VS dev community site: RC : fatal error RC1107: invalid usage; use RC /? for Help. A day later, MS VS closed it un-fixed and no plans to fix it or even address it. Commented Jun 9, 2022 at 13:07
8

I had a similar problem. I solved it removing the trailing backslash from the last path in Include Directories (from Project Properties | Configuration Properties | VC++ Directories).

1
  • In my case this issue started to occur on a newly-created project, after I had added BOOST environment variable to the include paths of Visual Studio (tools->options->Projects and Solutions->VC++ Directories). As I was using a variable, I just added \. to the end, which seemed to work.
    – icabod
    Commented Apr 9, 2013 at 13:24
2

I got this when upgrading from VS2008 to VS2010. None of the suggested solutions worked for me.
What worked for me was deleting all the files in the configuration build folder (e.g. Release) and rebuilding the solution.

2

I also solved this problem by removing VS include path "\" from last entry.

1

My solution for VS2010: click menu "Project","Properties" to open Property pages. click "Configuration properties", "general" to change Output Directory from "$(Configuration)\ \" to "$(Configuration)\" ,change interminably directory from "$(SolutionDir)$(Configuration)\ \" to "$(SolutionDir)$(Configuration)\".recompile and it's OK.

1

I had this issue with VS 2017. The problem was that I did not notice that I had the build configuration set to Release and there was a string in one of the controls that was too long and needed to be truncated by the resource editor when the resources were loaded. Putting the build configuration back to Debug and attempting to open the Resource file fixed it. I got a different message this time: string too long - truncated, and the resources could be viewed now.

1
  • Switching between Debug and Release solved the problem for me
    – yacsha
    Commented Jul 26 at 1:08
1

I experienced that both with VS2015 and VS2017 . Pls look in 1, at the answer of AH214.

In some cases the Resource Compiler fails to understand the options of the RC command line created by Visual Studio .

To find the problematic option do:

  1. In VS2015, as described by AH214, copy the command line options listed in Project -> properties -> Configuration Properties -> Resources -> Command Line .

  2. Find some *.rc file on your machine.

  3. Open Visual Studio command prompt.
  4. Issue the command

    RC [the options copied in (1)] [the path to the rc file in (2)] .

    You should get the same RC1107 error.

  5. Check in this property page the contents of ...Resources -> All
    Options . Look for a suspicious option and fix or remove it.

  6. Repeat (4) and (5) till you do not get the RC1107 error in (4).

    Once you found the culprit, check if you can change it or even remove
    it.

0

the backslash trick didnt work for me. but i just added a new icon to the RC file and then it worked all fine for me.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.