Thread: RunTime Compilation

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    38

    RunTime Compilation

    I am runnig an exe file and thru that i want to compile another .cpp file which is not related to it in any way! How i am going to do this? Using Visual C++ and Windows XP!

  2. #2
    Registered User
    Join Date
    Aug 2004
    Location
    San Diego, CA
    Posts
    313
    *blinks*

    If I understand what you're asking, you want to know how to write a compiler?

  3. #3
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    I'm getting the same notion as Lithorien. If you want to be able to compile a cpp file and then add that compiled code to the executable that is already running, Windows won't allow you to do that......easily.

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    If it's a seperate program you want to compile and you don't want to write your own compiler, you could use ShellExecuteEx or CreateProcess to run cl.exe and link.exe on the source file and generated objects to produce a new exe

  5. #5
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    No. My program does unit testing. It is given the address the "to be tested file" and it tests it by compiling it and running it on values the user has given to test with! I hope i am more clearer now.
    So how to Compile that "to be tested file" from my running exe?

  6. #6
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    Thanks Quantum1024! I got it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Runtime formation and execution at runtime
    By Soham in forum C Programming
    Replies: 17
    Last Post: 08-27-2008, 08:45 AM
  2. link with C runtime library
    By George2 in forum C++ Programming
    Replies: 26
    Last Post: 02-05-2008, 01:56 AM
  3. Visual Studio and .Net Runtime Framework dependency
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 08-08-2007, 07:52 AM
  4. FILES in WinAPI
    By Garfield in forum Windows Programming
    Replies: 46
    Last Post: 10-02-2003, 06:51 PM
  5. MS VC++ Crash on compilation
    By Magos in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 08-23-2003, 07:06 PM