PDA

View Full Version : compile source code file



eva
15th March 2009, 15:14
hello everybody. this is my first time in this forum and the first time I use Qt, in fact Qt creator. How can I compile a "library" (source code file) without compiling my program (main function etc.)? the answer in FAQ didn't help me much

p.s. I'm on windows xp:)

p.s.2 sorry for my english:o

faldzip
15th March 2009, 15:48
what do you mean saying "library"? You want to compile just 1 file from your project?
It is unnecessary as it uses make which compiles only changed files since last compile.
So when you press for example Ctrl+B (build project) for a first time, it will compile and link your project. But editing one file and pressing Ctrl+B again result in compiling and linking just that file. If you really want to compile just one file I think you have to do it from command line.

wysota
15th March 2009, 17:28
I guess the question is about building a shared library. Assuming you know what qmake is, you have to create a qmake project with such settings:
TEMPLATE=lib
CONFIG+=dll

eva
15th March 2009, 23:29
hmmm. I've got my main function in one file and all the functions that are used by main in another file .cpp and of course the header file

aamer4yu
16th March 2009, 04:41
How do you do it in C++ ??
#include....

Same is with Qt...Qt is C++ based,,,

wysota
16th March 2009, 09:56
hmmm. I've got my main function in one file and all the functions that are used by main in another file .cpp and of course the header file

You need to have a project file (with a .pro extension). Otherwise there is no way in determining what you want to do with your files.

eva
16th March 2009, 11:15
You need to have a project file (with a .pro extension). Otherwise there is no way in determining what you want to do with your files.

hmmm I see thanks