Solved

how to organize a c++ project

Posted on 2009-06-30
5
588 Views
Last Modified: 2012-05-07
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
0
Comment
Question by:coca_cola
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 24749303
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
 

Author Comment

by:coca_cola
ID: 24750266
MS visual studio 2005
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 24751830
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
 
LVL 9

Expert Comment

by:masheik
ID: 24751880
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
 
LVL 1

Accepted Solution

by:
paulmohit earned 500 total points
ID: 24830101
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

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question