views:

84

answers:

2

I want to create a program that modifies another c++ source,compiles it and runs the exe. I mean with something like gcc may be I can but on a windows os gcc may not be present. Is it possible?

+1  A: 

I think your options are fairly limited for windows:

  1. Check for an install of a compiler (possibly limit this to a short list) and use that compiler
  2. Bring along a compiler in your application's install package
Robb
+1  A: 
helios
hmm it can be slow...and it depends on internet connection.But it's interesting idea ;)
Alexander Ivanov
+1 for audacity.
Steve Jessop
Thanks... anyway I was thinking on it and realized about managing zip and http in C... and it was not that nice... :S
helios
You can (should) grab a library for that sort of thing. Even so it's going to be more work than some languages. As it happens I have implemented both HTTP client and zip file writer libraries in the past: not in C but in a language at about the same level, so I was sitting on top of zlib and a Berkely-style sockets interface. I don't really recommend it, for a very simple http client it's not all that difficult, just very tedious. Use libcurl and libtar instead (tar since compression isn't actually essential here anyway, so keep it simple)...
Steve Jessop