[Solved]Class Definitions by Plattform - Problem with Mac
I´m having a little issue here that i dont know to solve in MAC compilations.
I have some classes on my system that are generated in the compilation/build (Object Files .o) depending on the host platform.
Everyting is working fine , and for Window and Android (MSVC and MinGw) the compiler "remove" the class definiton and build the final code, but in XCode it are generation a empty symbol file error and not compile the Code...
I´m Using the Qt platform definitions to do that, and this is a example:
If i compile the program in Windows the MSVC compiler properly remove the .o file generated by MyMacOS class and mantain only the definition of MyMacWin class, but when i compile it in MAC instead of be removed or ignored in the Build a error are emmited and the build fails.
Anyone know how can i setup this in Qt, to tell the compiler remove the .o file and do not generate the error since the clas will not be used?
Any help will be much appreciated.
The most clean way to do that is to have seperated files for these classes and only build them on the correct platform.
HEADERS += mywinclass.h
SOURCES += mywinclass.cpp
HEADERS += mymacclass.h
SOURCES += mymacclass.cpp
Thus you avoid to build things you shouldn't
Hope it helps
Thanks so much for your help!
it fits perfectly for my need.
Its impressive how powerful is the .pro structure/setup of Qt!
You welcome !
Since you have now your build up and running, please update the thread title prepending [solved] so other forum users may know a solution has been found :)