views:

357

answers:

1

I am new to both Qt and Linux C++ development (although I have many years C and C++ development experience on Windows).

I have some legacy C projects (source files and headers - [not using Qt]) that I want to compile into shared libs on Linux.

I am proposing to store my projects under the following structure:

/home/username/Projects/project_name
/home/username/Projects/project_name/src
/home/username/Projects/project_name/build

Can anyone tell me how to do the following (using Qt to simplify the build process)

  1. Create different build configurations (debug, release etc)
  2. Build a configuration to create the appropriate shared library

As an aside, I have only recently installed Ubuntu 9.10 and the only C/C++ development tool I have installed (using SPM) in Qt - so I dont know if I need to install some other GNU C++ tools.

BTW I have already checked and have gcc (v4.4.1) available on my machine. I do not appear to have g++ though - I do not know whether this is significant or not.

+2  A: 

An Ubuntu system doesn't come with build tool chain by default. Instead it has a meta package that you will need to install:

sudo apt-get install build-essential

This will install, among other the g++ compiler, although I am not sure about the Qt headers an such. For them you will need the qt4-dev package (I assume you wish to work with qt4 rather then qt3).

As for the bould structure, you will want to consult the qmake manual, or you might want to consider using CMake (apt-get install cmake) instead. CMake allow for out of build sources, as you require, and personally, I can't recommend it enough.

Chen Levy
Thanks Chen Levy, I have installed both the build-essential and CMake packages (using SPM). I am reading the qmake manual now - looks like most of the answers are in there.
Stick it to THE MAN
Managed to build succesfully using qmake. I'd like to accept your answer, but I havent figured out how to do that yet .. ;)
Stick it to THE MAN
The stack overflow people, like to think the site have a grate UI. I guess if you have problem figuring it out, it needs some more work :). Anyhow, on question you asked, you should have a check-mark beside each question, you can toggle it on and off buy clicking it.
Chen Levy