CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13
  1. #1
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    869

    [RESOLVED] Unable to compile

    I am having a similar problem with Visual Studio 2013.
    Yesterday after windows 7 update when I try to compile any project I get:
    "Error 2 error C1041: cannot open program database ''; if multiple CL.EXE write to the same .PDB file, please use /FS E:\CProgs\GenEdit50Cust\GenEditG20\stdafx.cpp 1 1 GenEditG50" The project name and folder changes when I try to compile another project but I still get this C1041 error. I tried adding /FS and it has no effect?
    Verere testudinem! (Fear the turtle)

    Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein

    Robots are trying to steal my luggage.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,097

    Re: Unable to compile

    Quote Originally Posted by Tom Frohman View Post
    I am having a similar problem with Visual Studio 2013.
    Yesterday after windows 7 update when I try to compile any project I get:
    "Error 2 error C1041: cannot open program database ''; if multiple CL.EXE write to the same .PDB file, please use /FS E:\CProgs\GenEdit50Cust\GenEditG20\stdafx.cpp 1 1 GenEditG50" The project name and folder changes when I try to compile another project but I still get this C1041 error. I tried adding /FS and it has no effect?
    Did you try to "Rebuild all"?
    Victor Nijegorodov

  3. #3
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    869

    Re: Unable to compile

    Quote Originally Posted by VictorN View Post
    Did you try to "Rebuild all"?
    Rebuild All isn't one of the options. I've cleaned the project. It still errs out after rebuilding.

    I've tried to create a new solution with a new project and then I get the error
    "Error 2 error C1083: Cannot open source file: 'stdafx.cpp': No such file or directory E:\CProgs\GenEdit50Cust\GenEditG20\c1xx GenEditG50
    "
    Even though stdafx.cpp is in the solution.
    No project will compile.
    Verere testudinem! (Fear the turtle)

    Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein

    Robots are trying to steal my luggage.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,624

    Re: Unable to compile

    Quote Originally Posted by Tom Frohman View Post
    Rebuild All isn't one of the options. I've cleaned the project. It still errs out after rebuilding.

    I've tried to create a new solution with a new project and then I get the error
    "Error 2 error C1083: Cannot open source file: 'stdafx.cpp': No such file or directory E:\CProgs\GenEdit50Cust\GenEditG20\c1xx GenEditG50
    "
    Even though stdafx.cpp is in the solution.
    No project will compile.
    And does it actually exist?

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,097

    Re: Unable to compile

    Quote Originally Posted by Tom Frohman View Post
    Rebuild All isn't one of the options. I've cleaned the project. It still errs out after rebuilding.

    I've tried to create a new solution with a new project and then I get the error
    "Error 2 error C1083: Cannot open source file: 'stdafx.cpp': No such file or directory E:\CProgs\GenEdit50Cust\GenEditG20\c1xx GenEditG50
    "
    Even though stdafx.cpp is in the solution.
    No project will compile.
    Did you consider to google for a similar problem? Like:
    https://stackoverflow.com/questions/...error-c1041-fs
    https://www.google.com/search?q=Visu...4dUDCA4&uact=5
    Victor Nijegorodov

  6. #6
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    869

    Re: Unable to compile

    Just telling someone to google it is abuse.

    Of course I googled it. Then I asked here. I even saw the stackoverflow post and tried it. It didnt help.
    Last edited by Tom Frohman; July 2nd, 2021 at 01:58 PM.
    Verere testudinem! (Fear the turtle)

    Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein

    Robots are trying to steal my luggage.

  7. #7
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    869

    Re: Unable to compile

    Yes, the file exists
    Verere testudinem! (Fear the turtle)

    Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein

    Robots are trying to steal my luggage.

  8. #8
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,624

    Re: Unable to compile

    Quote Originally Posted by Tom Frohman View Post
    Yes, the file exists
    Not just in the solution, but in the directory where it says it is? That's a pretty specific error. If you try to open it by clicking on it in Solution Explorer, does it open?

  9. #9
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,097

    Re: Unable to compile

    Quote Originally Posted by Tom Frohman View Post
    Just telling someone to google it is abuse.

    Of course I googled it. Then I asked here. I even saw the stackoverflow post and tried it. It didnt help.
    Then sorry! I never used VS 2013, I don't have it installed so I cannot look at it deeper to see what else you could do...
    Victor Nijegorodov

  10. #10
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    869

    Re: Unable to compile

    Yes, the file opens
    Verere testudinem! (Fear the turtle)

    Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein

    Robots are trying to steal my luggage.

  11. #11
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,494

    Re: Unable to compile

    Quote Originally Posted by Tom Frohman View Post
    Just telling someone to google it is abuse.
    Using VC2013 is abuse.

  12. #12
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,097

    Re: Unable to compile

    Quote Originally Posted by Arjay View Post
    Using VC2013 is abuse.

    Totally agree!
    Victor Nijegorodov

  13. #13
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,551

    Re: Unable to compile

    AFAIK VS2013 is now not supported by MS. So basically 'use at your own risk'.

    Remove VS2013, install VS2019.

    stdafx.cpp is used by PreCompiled Headers. In properties/c++/pre-compiled Headers, set Pre-compiled Header to Not Using PreCompiled Header. Ok the change and then try to build again.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++20 Compiler: Microsoft VS2019 (16.11.5)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured