• C

how to organize a c++ project

I am new to C++, and I am building a c++ project which will call methods inside another c++ project, how do I organize my project and how to inclue other project?(in java, I know to include the jar file with building of class path)

thanks
coca_colaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Infinity08Commented:
Ideally, your other project would be a library, in which case, you can simply link to it to use the methods implemented in it.

Organizing a project depends on its size, but usually, you want to split up the code in separate modules. A module corresponds to a .cpp file, and contains everything related to a specific part of the code (often modelled as a class).
For larger projects, it might be useful to group related modules in separate directories.

What compiler are you using ? Are you using any IDE ? Which one ?
0
coca_colaAuthor Commented:
MS visual studio 2005
0
Infinity08Commented:
I don't use that one myself, so I can't help you with specifics, but does my first post answer your question, or are you looking for something else ? If so, what ?
0
masheikCommented:
Hi,
you can create multiple projects inside a .sln solution but that makes project complex to maintain in vs.
If you create or have  libraries (lib or dll files) and use them to  link or execute a program is good way to do this.
0
paulmohitCommented:
Easiest will be to create multiple projects (assuming Visual Studio).

1. Create a library for the project in which you will be calling the functions from. This can be the first project.
2. The second project can then link to the library that is created as a result of the first project.

Other options:

You can create DLL for the first project.

In case you are in Unix/Linux environment,  you can create a library (static or dynamic) for the set of functions you want to call in the second project.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.