LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   compiling .cpp files (https://www.linuxquestions.org/questions/linux-newbie-8/compiling-cpp-files-845143/)

leogg23 11-18-2010 02:17 PM

compiling .cpp files
 
Hello, I am trying to compile the .cpp files and .h files to be able to run a program called PALS. I have like 30 files in a directory (both .cpp and .h) and I do not know if I should just try to compile them all with g++ command. Would this give me an executable file right away?

thanks

Leo

johnsfine 11-18-2010 02:30 PM

It is easy to try:
Code:

g++ *.cpp -o pals
If the errors/warnings don't look too bad, try running it with
Code:

./pals
I have no idea whether that simple method of building it will work. It depends on what is in your 30 files.

TB0ne 11-18-2010 02:35 PM

Quote:

Originally Posted by leogg23 (Post 4163488)
Hello, I am trying to compile the .cpp files and .h files to be able to run a program called PALS. I have like 30 files in a directory (both .cpp and .h) and I do not know if I should just try to compile them all with g++ command. Would this give me an executable file right away?

Like johnsfine said, without knowing what the code is, it's hard to say what it'll do. Would help if you provided details, such as version/distro of Linux, and where you got the PALS software you're trying to compile. Does it have instructions with it? A Makefile?

bsat 11-19-2010 08:02 AM

if you want one executable from all the 30 files, you should have a Makefile or you will have to write your own.


All times are GMT -5. The time now is 11:45 PM.