Sharing classes (files) beetwen projects in one workspace

General questions regarding the usage of CodeLite
netrick
CodeLite Enthusiast
Posts: 19
Joined: Fri Dec 07, 2012 8:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Sharing classes (files) beetwen projects in one workspace

Post by netrick »

Hi,
firstly I must say codelite is the best c++ ide i've ever used! I like it so much, however now when I work on a bigger projects it seems like it's missing one very important feature...
I am working on an online game, so I have one workspace and 3 projects in it (client, server, editor). The problem is, that for example server and client share the same movement and map classes, the editor and client share same render and gui classes etc. I need a way that I can have shared classes (.cpp and .hpp files) between projects in workspace, which I can include without any magic using #include "class.hpp", like in visual c++.

The only solution I came with is creating 4th project as a static library, add it to linker options in every project and add another location for include and lib files (that 4th project location) to workspace settings. However, that's rather unconvenient and ugly way. Not to mention that static linking sux on linux, and I would need to link very big sfml lib to that shared classes lib... I want to do it non-lib way.

Is there any solution for sharing classes between projects in codelite that I don't see?

Thanks!
User avatar
Jarod42
CodeLite Expert
Posts: 239
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Sharing classes (files) beetwen projects in one workspace

Post by Jarod42 »

I prefer to share code throw library.
But to do without library:
You can add the files in both projects.

A ugly config is to you set the same obj directory for both project, so common obj should be generated only once.
A cleaner config is that each project has its own obj directory (but common file will be generated once for each project).
which I can include without any magic using #include "class.hpp"
It is not magic to include header. it is the normal way to use header...
Post Reply