Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7979221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:43:14+00:00 2026-06-04T09:43:14+00:00

I’m calling CreateProcess to launch cl.exe (VS2010 on Win7 64 bit). I get the

  • 0

I’m calling CreateProcess to launch cl.exe (VS2010 on Win7 64 bit). I get the following error..

cl : Command line error D8037 : cannot create temporary il file; clean temp directory of old il files

Calling the same command line with the same environment variables in a cmd window succeeds. I’ve checked the temp directory and there are no old files. It seems like the process that is created does not have write permissions. I’ve been trying different approaches.. CreateProcessAsUser, Set the security attributes to grant all standard permissions to the Everyone user group, with and without inheriting handles, etc. None of them seem to fix it.

And here’s the basic code…

SECURITY_ATTRIBUTES sa;
sa.nLength = sizeof( SECURITY_ATTRIBUTES );
sa.bInheritHandle = TRUE;
sa.lpSecurityDescriptor = NULL;

const char* _szSourceFile = "c:\\temp\\test\\src\\foo.cpp";

char szOptions[ 2048 ];
sprintf_s( szOptions, 
    "c:\\temp\\compile\\cl.exe "
    "/Gd "
    "/Fo\"c:\\temp\\test\\out\\\" "
    "/Fe\"c:\\temp\\test\\out\\\" "
    "/Fd\"c:\\temp\\test\\out\\\" "
    "/D \"WIN32\" "
    "/D \"_DEBUG\" "
    "/D \"_WINDOWS\" "
    "/D \"_USRDLL\" "
    "/D \"_WINDLL\" "
    "/D \"_MBCS\" "
    "/I\"c:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Include\" "
    "/MDd "
    "/I\"c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\include\" "
    "/LDd "
    "%s "
    "c:\\temp\\test\\lib\\Uuid.Lib "
    "c:\\temp\\test\\lib\\oldnames.lib "
    "c:\\temp\\test\\lib\\msvcrtd.lib"
    , _szSourceFile );


STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof( STARTUPINFO ) );
ZeroMemory( &pi, sizeof( PROCESS_INFORMATION ) );
si.cb = sizeof( STARTUPINFO );

BOOL bSucceeded = CreateProcess( "c:\\temp\\compile\\cl.exe", szOptions, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, "PATH=c:\\temp\\Compile;%PATH%\0TEMP=c:\\temp\\test\\tmp\0\0", "c:\\temp\\test\\", &si, &pi );

In case you’re wondering about the weird paths, I copied over the most minimal set of required tools, libs, etc to build a dll directly from a cpp file. The command in the code works on a regular command line with the path that is set in the enviroment variables block.

Also, in case you’re wondering what this is for, I’m trying to have an app that can dynamically reload a dll. The app is being used for debugging/visualization and the idea is to be able to tweak the visualization code on the fly and have the app reload the dll.

I’ve been at this for 4 days googling and trying out different things. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:43:16+00:00Added an answer on June 4, 2026 at 9:43 am

    Found the issue.

    I used the Process Monitor to monitor cl.exe to see what was failing.
    Process monitor can be downloaded from http://technet.microsoft.com/en-us/sysinternals/bb896645.

    Turns out that it was failing to load rsaenh.dll in the windows system folder. cl.exe could not resolve %SystemRoot% environment variable. Since I was overriding the environment variables, it got reset. Adding SystemRoot=c:\Windows to the environment variables fixed it. The proper fix would be to get the environment variables for the current process, parse and modify it to make your path additions and then pass that in. That way you inherit all the environment variables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.