Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Creating a class library
Creating a class library [message #199353] Thu, 09 August 2007 23:20
Eclipse UserFriend
Originally posted by: big.raiders.fan.nospam.gmail.com

I'm fairly new to Eclipse after having worked in MS Visual Studio for
years. I'm having some trouble figuring out how to build and use a C++
class library under Eclipse with the CDT.

My directory structure is as follows:

/include
/src/class1
/src/class2
/src/class3
/src/class_lib
/src/class_exe
/lib
/bin

Each 'class' subfolder has one or more .cpp files which build into a
static library. I seem to have this working OK. I would like the
'class_lib' project to build one large static library that includes each
of the libraries built by each 'class'. The 'class_exe' project builds
an executable that will link in the class library.

I am able to open each of the projects in the same workspace under
Eclipse, which was another objective.

Questions:
1 - How can I have the 'class_lib' project build after the 'class'
projects and combine those libraries into one big class library? I
don't see a way to have one static library include others.

2 - How can I get the output of the 'class_lib' project to go to the
'lib' subfolder? Under Visual Studio, you can set the output directory
of the project. I can't seem to find an equivalent in Eclipse. Do I
need to do a post-build step and copy the output file over?

3 - How do I have the 'class_exe' build after the 'class_lib' is built
and then have its input directed to the 'bin' subfolder? This may be
answered once I know how to do 1 & 2.

Once I have these working, I need to check everything into our library
system.

4 - What files do I need to check in so that someone else can extract
all of the files and be able to import them into an Eclipse workspace
and just have it work? Is it any 'makefile' and '*.mk' file I find?

My goal is to accomplish all of this from the IDE, and not have to
manually write makefiles or scripts (or do as little of that as
possible). If there's much manual work involved, we may be prone to
forgo Eclipse and do everything from the command line.

I'm doing all of this under Linux, and all of our code is C++.

I'm pretty impressed with Eclipse, and am hoping none of these are hard
to do. I may just be having trouble because all of my experience is
with MS Visual Studio, and in working with .vcproj and .sln files and
being accustomed to all of the build options.

Any guidance would be greatly appreciated!

Thanks!
David
Previous Topic:Using Eclipse Vars within Debug Dialog Shared Libs Config
Next Topic:ClassNotFoundException thrown with Eclipse 3.3 and CDT 4
Goto Forum:
  


Current Time: Tue Jun 17 00:56:19 EDT 2025

Powered by FUDForum. Page generated in 0.02974 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top