PDA

View Full Version : How to specify my own global typedefs



Gert van Kruiningen
19th January 2011, 03:12
Hi, the qglobal.h file contains typedefs for all possible variable types like quint8 quint16 etc etc.
I am trying to compile an application with slightly different typedefs like uint8_t uint16_t etc etc.

Can anyone tell me what the proper way is to add these typedefs globally somewhere?

Regards

Gert

ChrisW67
19th January 2011, 06:15
These definitions are typically found in:


// For C99
#include <stdint.h>
// For C++
#include <cstdint>

Gert van Kruiningen
19th January 2011, 20:15
Forgot to mention that the files I am trying to compile are generated, so I can't modify them.
An other compiler I am using has the ability to "force" an #include for every file that is being compiled. Is there maybe a similar setting here in Qt Creator? Or a way of adding project specific items in qglobal.h?

wysota
19th January 2011, 21:16
QtCreator is not a compiler. If you have a compiler you like, just try using it to build Qt applications.

ChrisW67
19th January 2011, 21:17
What is generating this incomplete code?

squidge
19th January 2011, 21:42
Qt Creator uses GCC by default, so all you need to do is pass the compiler command line option "-include file.h" to process file.h as if #include "file.h" appeared as the first line.

Gert van Kruiningen
20th January 2011, 02:08
Makes sense squidge, But my next question is where do I tell Qt Creator to use this "-include file.h" when calling the compiler.
The place that makes sense is to pass this information on to the make or qmake, so I went to the Projects tab where you can add additional arguments to the QMake proces. But that does not work.

Why is there a make and a qmake in that tab? I also noticed that you can swap the order of these two around???

Any suggestions?

ChrisW67
20th January 2011, 05:11
What is generating the broken code in the first place? It would be preferable to get the generator producing code that is complete and compiles rather than rely on compiler specific hacks.