different method signatures for mingw and visual c
I am writing code to be compiled with both MinGW and Visual C compiler. I am using define like this:
I have defined VISUAL_STUDIO In my project file as follows:
Code:
QMAKE_CFLAGS_DEBUG += -O2 VISUAL_STUDIO
QMAKE_CFLAGS += -O2 -DVISUAL_STUDIO
I get multiple definition error for the following code
Code:
#ifdef VISUAL_STUDIO
int FUNCA(
#else
static inline int FUNCA(
#endif
Pkt_t *pkt
)
Can anybody help me with this or any idea to do it in different was will be appreciated?
different method signatures for mingw and visual c
I am writing code in QT that can be compiled with both MinGW and Visual C compiler. I am using define like this:
I have defined VISUAL_STUDIO In my project file as follows:
Code:
QMAKE_CFLAGS_DEBUG += -O2 VISUAL_STUDIO
QMAKE_CFLAGS += -O2 -DVISUAL_STUDIO
I get multiple definition error for the following code
Code:
#ifdef VISUAL_STUDIO
int FUNCA(
#else
static inline int FUNCA(
#endif
Pkt_t *pkt
)
Can anybody help me with this or any idea to do it in different was will be appreciated?
Re: different method signatures for mingw and visual c
why do you have -D in one, but not the other?
also, maybe you're just including the file too many times... It's hard to tell without a complete compilable example - see my sig.
Re: different method signatures for mingw and visual c
You get a multiple definition of which symbol exactly? Are you sure this is caused by your defines and not a non-inlined function declaration in line #2?
Re: different method signatures for mingw and visual c
You might want to read what the OP has already been told:
http://qt-project.org/forums/viewthread/31971/
Re: different method signatures for mingw and visual c
Quote:
Originally Posted by
ChrisW67
Merged the threads, thanks.