Exactly how do you create multi-file project and how do you compile it in C++ using Linux?

Recommended Answers

Exactly how do you create multi-file project and how do you compile it in C++ using Linux?

EZ way, by using some IDE like this.

Not so EZ way (but you will learn a lot), by using makefiles as described

Jump to Post

All 4 Replies

Exactly how do you create multi-file project and how do you compile it in C++ using Linux?

EZ way, by using some IDE like this.

Not so EZ way (but you will learn a lot), by using makefiles as described here and in other sources.

A programmer that says an editor is the answer...geesh. The answer is with the include statment with something like this...

#include "fileToInclude.cpp"

For more info just look up the uses of the include in C/C++

[High Guard]Just follow the links before start typing nonsenses.

The 2nd one will TEACH you what the #include directive is intended for.[/High Guard]

Hello,

You might also wish to look up and how to write makefiles. Unfortunately, I do not remember the exact sequence anymore, as I have moved on to system administration instead of programming, but makefiles can really make your life easier.

Christian

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.