Quantcast
Channel: Qt DevNet forums: Installation and Deployment
Viewing all articles
Browse latest Browse all 2113

How to include a global architecture header file at the top of each C file

$
0
0
I am making a desktop version of a large embedded project, written in C. It’s meant for better unit tests without having to download on target. For the small 8-bit target we use an IAR compiler. To do this, I have added the following line in the IAR project description: MY_Q_ARCHITECTURE_H_FILE="Q_Architecture.h" This way I am able to switch target header file without changing code. Now every C file starts like this: #include MY_Q_ARCHITECTURE_H_FILE // Don't want to change in 100+ files! HOW DO I DO THIS IN Qt? It’s a plain C with qmake project. I have tried several syntaxes both in the .pro file and in the Project Additional Arguments, but failed. It would complain like this: ..\scheduler\S_ChanSched.c:2:10: error: #include expects "FILENAME" or <FILENAME>  #include MY_Q_ARCHITECTURE_H_FILE Øyvind Teig Senior development engineer, M.Sc. __________________________________________ Autronica Fire and Security AS UTC CCS EMEA Fire & Security Operations Phone: + 47 73 58 24 68 / Mobile +47 959 61 506 E-mail: oyvind.teig@autronicafire.no www.autronicafire.no www.teigfam.net/oyvind/home/ (also work-related)

Viewing all articles
Browse latest Browse all 2113

Trending Articles