Compile program from c++

I'm trying to compile an external program from c++ using system, but its not working. It says "Undefined reference to 'main'" even though I have a main function. I can compile the program from the terminal, but system and popen have the error. I don't know why its not working, any help is appreciated.
Last edited on
How are you compiling...
Like system("g++ file.cpp")
I just checked, and it does the same thing compiling assembly from gcc.
Topic archived. No new replies allowed.