locked
Compiling on Windows Server 2012 R2 failing RRS feed

  • Question

  • Hi,

    I'm setting up a new Jenkins-based build server, which I've just migrated from a Windows 7 machine to a new Windows Server 2012 R2 machine. I have a single solution with a large number of C++ projects that get built by VS2013 (devenv.exe) via a script. At different points during the compilation I get the following error:

    <project number>><path to source>\<source file>.Cpp : fatal error C1083: Cannot open compiler generated file: 'C:\Users\devbuild\AppData\Local\Temp\AsmTempFile6': Permission denied

    Does anybody know what might be causing this? I have the jenkins service running as the local user (devbuild), but it looks like the problem is related to file privileges. I just dont know how it could be blocking access to the users own temp folder. The user is also in the administrators group on the server, so should have full access anyway.

    Any help would be hugely appreciated!

    • Moved by Amanda Zhu Monday, September 15, 2014 3:20 AM better forum
    • Moved by Anna Cc Wednesday, October 8, 2014 6:42 AM
    Thursday, September 11, 2014 11:53 PM

Answers

  • Thanks.

    It appears the /FAcs compiler option is causing the problem. With the switch removed, I can compile fine. I'll see what impact this will have on our application, but in the meantime is there a reason for this that is known to microsoft?

    Hi Nick Hynes,

    Do you mean that you removed /FAcs compiler option only for the project which you mentioned in your last reply and still compiled with Release|x86 configuration , currently it can compile well without the error, right?

    If yes, I am a little confused about your scenario. Is there any other project which needs to have reference to the project? What is the output file of the project for? Because /FAcs compiler option helps us to create a listing file containing assembly code and if /FAcs is specified, the file extension will be .cod. Do you have any project or any service to go to open this file? Whether the file you want to open is .asm not .cod. So if you use /FA option, whether the issue still happen.

    And based on your original post,  I want to confirm if there is no problem when you run it on Windows 7 ,  and this issue you met only happen on Windows server 2012.

    In order to verify if there is any limitation to access .cod file in windows server, I make a small test with Windows server 2008 R2 with VS2012 (Sorry I have no windows server 2012).  I create a simple console project and add assembly file into the project source file, and let main cpp file  link the assembly file. I can build the project well on windows server 2008 R2. No matter I use .asm as the file extension for assembly or .cod as the file extension, I can build successfully.

    So I am not sure how you use the /FAcs output file, whether the issue only exists in windows server 2012.

    This is my assembly file:

    .386
    .model flat
    .stack
    .code
    
    _Square proc
    mov eax, [esp+4]
    imul eax
    
    push eax ; Save the calculated result
    
    ; Call PrintResult here
    push eax ; value
    push 0 ; ShowSquare
    ;call _PrintResult
    add esp, 8 ; Clear the stack
    
    pop eax ; Return the calculated result
    
    ret
    _Square endp
    end

    This is my testing cpp file:

    #include <iostream>
    
    using namespace std;
    
    extern "C" long Square(long);
    
    
    int main(int argc, char* argv[])
    {
        long Num1, Num2;
    
        do
        {
            cout << "Enter number to square" << endl;
            cin >> Num1;
            Num2 = Square(Num1);
            cout << "Square returned: " << Num2 << endl;
        }
        while (Num2);
    
        return 0; 
    }
    
    

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, September 16, 2014 7:55 AM

All replies

  • Hi Nick,

    For fixing this issue, my suggestion is you delete the .suo file, open VS as admin, load this solution, clean and build this solution to check whether the same issue will occur. If you can compile the solution from VS IDE fine after those operations above, then please build the solution via your script.

    In addition, in order to check whether this issue is on your specific solution, could you please create a new and simple C++ project and compile it via your script to check the result? And please navigate to C:\Users\devbuild\AppData\Local\Temp folder to make sure you have read/write access to this folder.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 12, 2014 7:56 AM
  • Thanks for the reply, but deleting the .suo and clean/build in the IDE is producing the same error.

    Ive narrowed it down to one project in the solution, and only the Release|x86 configuration, that the project will not compile and gives the error above. I've also confirmed that the user has read/write access to the temp folder.

    Friday, September 12, 2014 11:41 PM
  • Hi Nick,

    Through your useful information, we can determine that your issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System and Visual Studio Editor.

    Because your program can work fine on Windows 7, then your program itself is OK, from your research result, this issue is more related to the configuration and environment compatibility. We think that Application Compatibility for Windows Desktop Development forum: http://social.msdn.microsoft.com/Forums/en-US/home?forum=windowscompatibility  is a proper forum for your issue. We will move this thread there. You can get better support and solution on that forum.

    Thank you for your understanding and support.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 15, 2014 3:19 AM
  • Thanks.

    It appears the /FAcs compiler option is causing the problem. With the switch removed, I can compile fine. I'll see what impact this will have on our application, but in the meantime is there a reason for this that is known to microsoft?

    Monday, September 15, 2014 3:52 AM
  • Thanks.

    It appears the /FAcs compiler option is causing the problem. With the switch removed, I can compile fine. I'll see what impact this will have on our application, but in the meantime is there a reason for this that is known to microsoft?

    Hi Nick Hynes,

    Do you mean that you removed /FAcs compiler option only for the project which you mentioned in your last reply and still compiled with Release|x86 configuration , currently it can compile well without the error, right?

    If yes, I am a little confused about your scenario. Is there any other project which needs to have reference to the project? What is the output file of the project for? Because /FAcs compiler option helps us to create a listing file containing assembly code and if /FAcs is specified, the file extension will be .cod. Do you have any project or any service to go to open this file? Whether the file you want to open is .asm not .cod. So if you use /FA option, whether the issue still happen.

    And based on your original post,  I want to confirm if there is no problem when you run it on Windows 7 ,  and this issue you met only happen on Windows server 2012.

    In order to verify if there is any limitation to access .cod file in windows server, I make a small test with Windows server 2008 R2 with VS2012 (Sorry I have no windows server 2012).  I create a simple console project and add assembly file into the project source file, and let main cpp file  link the assembly file. I can build the project well on windows server 2008 R2. No matter I use .asm as the file extension for assembly or .cod as the file extension, I can build successfully.

    So I am not sure how you use the /FAcs output file, whether the issue only exists in windows server 2012.

    This is my assembly file:

    .386
    .model flat
    .stack
    .code
    
    _Square proc
    mov eax, [esp+4]
    imul eax
    
    push eax ; Save the calculated result
    
    ; Call PrintResult here
    push eax ; value
    push 0 ; ShowSquare
    ;call _PrintResult
    add esp, 8 ; Clear the stack
    
    pop eax ; Return the calculated result
    
    ret
    _Square endp
    end

    This is my testing cpp file:

    #include <iostream>
    
    using namespace std;
    
    extern "C" long Square(long);
    
    
    int main(int argc, char* argv[])
    {
        long Num1, Num2;
    
        do
        {
            cout << "Enter number to square" << endl;
            cin >> Num1;
            Num2 = Square(Num1);
            cout << "Square returned: " << Num2 << endl;
        }
        while (Num2);
    
        return 0; 
    }
    
    

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, September 16, 2014 7:55 AM