PDA

View Full Version : Stupid Windows Compilation Trick



skepticalgeek
30th August 2010, 00:41
I am porting my Linux Qt jukebox project to Windows. Everything is working correctly except for the CD Ripper portion. I am having a problem with the portion of the code that extracts the tracks from the CDs. Here is the code in question:


void CD_Extractor::Extract(int tracknum)
{
int size;
char *buf;
int16_t *readresult;
long result;
long x;
long firstsector,lastsector;
int i;
QMessageBox box;
QString fname;
QByteArray arr;

Paranoia = cdio_paranoia_init(Drive);
firstsector = cdio_cddap_track_firstsector(Drive, tracknum);
lastsector = cdio_cddap_track_lastsector(Drive, tracknum);
size = (lastsector - firstsector) + 1;
SectorsTotal = size;
SectorsRead = 0;
cdio_cddap_speed_set(Drive,32);
paranoia_modeset(Paranoia, PARANOIA_MODE_FULL); //^PARANOIA_MODE_NEVERSKIP);
paranoia_seek(Paranoia, firstsector, SEEK_SET);
QFile file("/home/patrick/SKG_Jukebox/tracks/Track" + QString::number(tracknum) + ".wav");
file.open(QIODevice::WriteOnly);
WriteWav(file.handle(),size * CD_Framesize_Raw);
for (i = firstsector; i <= lastsector; i++)
{
try
{
//readresult = cdio_paranoia_read(Paranoia,NULL);
readresult = cdio_paranoia_read_limited(Paranoia,NULL,3);
SectorsRead++;
buf = (char*)readresult;
file.write(buf,CD_Framesize_Raw);
UpdateProgress(Progress());
QApplication::processEvents();
}
catch(...)
{
break;
}
}
fname = file.fileName();
file.close();
cdio_paranoia_free(Paranoia);

ExtractFinished(fname);
}

void CD_Extractor::WriteWav(int f,long bytes)
{
/* quick and dirty */

write(f,"RIFF",4); /* 0-3 */
PutNum(bytes+44-8,f,0,4); /* 4-7 */
write(f,"WAVEfmt ",8); /* 8-15 */
PutNum(16,f,0,4); /* 16-19 */
PutNum(1,f,0,2); /* 20-21 */
PutNum(2,f,0,2); /* 22-23 */
PutNum(44100,f,0,4); /* 24-27 */
PutNum(44100*2*2,f,0,4); /* 28-31 */
PutNum(4,f,0,2); /* 32-33 */
PutNum(16,f,0,2); /* 34-35 */
write(f,"data",4); /* 36-39 */
PutNum(bytes,f,0,4); /* 40-43 */
}

void CD_Extractor::PutNum(long num,int f,int endianness,int bytes){
int i;
unsigned char c;

if(!endianness)
i=0;
else
i=bytes-1;
while(bytes--){
c=(num>>(i<<3))&0xff;
if(write(f,&c,1)==-1){
perror("Could not write to output.");
exit(1);
}
if(endianness)
i--;
else
i++;
}
}

When I try to compile, this is what I get:
'write' was not declared in this scope

After digging around, I found that the version of "write" I was using in WriteWav needed the unistd.h header. So I added "#include <unistd.h>" to my source file. That's when things got really interesting. Now when I try to compile, I get this:

debug/cd_extractor.o: In function `ZorN10QEventLoop17ProcessEventsFlagES0_':
C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/global/qglobal.h:1368: multiple definition of `operator|(QEventLoop::ProcessEventsFlag, QEventLoop::ProcessEventsFlag)'
debug/mainwindow.o:C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qeventloop.h:95: first defined here
debug/cd_extractor.o: In function `ZorN10QEventLoop17ProcessEventsFlagE6QFlagsIS0_E' :
C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qeventloop.h:95: multiple definition of `operator|(QEventLoop::ProcessEventsFlag, QFlags<QEventLoop::ProcessEventsFlag>)'
debug/mainwindow.o:C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qeventloop.h:95: first defined here
debug/cd_extractor.o: In function `ZorN10QEventLoop17ProcessEventsFlagEi':
C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qeventloop.h:95: multiple definition of `operator|(QEventLoop::ProcessEventsFlag, int)'
debug/mainwindow.o:C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qeventloop.h:95: first defined here
debug/cd_extractor.o:C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215: multiple definition of `QCoreApplication::sendEvent(QObject*, QEvent*)'
debug/mainwindow.o:C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215: first defined here
debug/cd_extractor.o:C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218: multiple definition of `QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*)'
debug/mainwindow.o:C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218: first defined here
debug/cd_extractor.o:C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220: multiple definition of `QCoreApplication::sendPostedEvents()'
debug/mainwindow.o:C:\SKG_Jukebox\CDRipperTest-build-desktop/../../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220: first defined here
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\CDRipperTest.exe] Error 1
mingw32-make: *** [debug] Error 2


Keep in mind that this exact code compiles and runs just fine under Linux. I'm linked to the correct DLLs. I tried cleaning the project and running QMake. Any insights anyone? This is kind of hlding up my Windows port.

skepticalgeek
30th August 2010, 04:01
Update. I can get rid of the second issue by commenting out the include statement for QApplication, but this means I can't use processEvents, which is causing other issues. Hopefully this helps someone narrow it down.

aamer4yu
30th August 2010, 06:41
There seems to be multiple definitions of "operator|" as the error says. Look for such instances in the code.

totem
30th August 2010, 09:36
Hi,

One rule i follow for windows include order is this :



#include "ProjectHeaders.h"
#include <QHeaders>
#include <stdheaders.h>


wihtout this order i sometimes get ununderstandable compilation errors (this also means: avoid precompiled headers if possible)

wysota
30th August 2010, 10:25
Last time I checked Windows was not a Unix system, so I guess it may not have <unistd.h> or ::write().

skepticalgeek
30th August 2010, 18:12
The uninstd.h header is there, I can link to it fine. Like I said, I can compile if I comment out the include statement for QApplication, but then I can't use processEvents, which I need so that the loop is able to send the signal to the calling thread. Without it, the signal UpdateProgress() never gets received. I tried changing the order of the include statements the way totem suggested, and I went from a few compile errors to hundreds. I got multiple definition errors for just about every Qt function on the face of the earth. It's almost like different sections of the code are linking to different versions of Qt, but I only have one on my system, 4.6.3 with Qt Creator 2.0. Thanks for the suggestions. I can post more code or compiler output if that would help.

wysota
30th August 2010, 18:16
Please provide a minimal compilable example reproducing the problem.

hobbyist
30th August 2010, 18:26
Since you are already working with QFiles, why don't you simply use QFile::write() instead of ::write()? QFile is portable.

skepticalgeek
9th September 2010, 18:11
Hello, I'm back with more of the same. I thought I had these issues resolved by adding some include statements but, like an unwanted guest, it pooed up again. I tried adding a form back into my main project, that I had originally commented out of the pro file until I could figure out how to get the functionality (CD Ripping) to work in Windows. I added the form, but commented out all code relating to extraction and encoding, and am ending up with compile problems again. First, under Build Issues, I get the most useless error message on the face of the earth:

error: collect2: ld returned 1 exit status

Seriously, this error message is so unhelpful, it may as well have come from Microsoft. When I look at Compile Output, here is where it seems to be choking:

./release\moc_frmrip.o:moc_frmrip.cpp:(.text+0x0): multiple definition of `void qSwap<QPicture>(QPicture&, QPicture&)'
./release\frmrip.o:frmrip.cpp:(.text+0x0): first defined here
./release\moc_frmrip.o:moc_frmrip.cpp:(.text+0x1f4): multiple definition of `bool qIsDetached<QPicture>(QPicture&)'
./release\frmrip.o:frmrip.cpp:(.text+0xbc0): first defined here
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\SKG_Jukebox.exe] Error 1
mingw32-make: *** [release] Error 2
The process "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project SKG_Jukebox (target: Desktop)
When executing build step

Here is the kicker. I am not defining qSwap or qIsDetached anywhere. I am not using them anywhere. I have not heard of them until they popped up here. I am not even using any QPicture objects in this form. So where the @#$% is the error message coming from?

On a related note, are there any make arguments I can pass to get Mingw to ignore these multiple definitions? Or anything I can do at all to keep it from being such a massive piece of crap? Sorry about the language, but I am sick and tired of taking code that compiles and executes perfectly fine under Linux, porting it to Windows, and having it immediately become possessed by demons. Thanks in advance for any insights anyone might have here.

wysota
9th September 2010, 20:44
You are really doing something weird or you have a screwed up development environment. You are including some file which is including some file which is including... and finally it is including the file causing the problem. I'd say you have some macro conflict which is causing multiple inclusion of some file or you are linking the same code twice. Or you have forgotten to put guardians in your include files to prevent double inclusion in your code.

skepticalgeek
10th September 2010, 00:32
Well, my development environment is Qt Creator 2.0 for Windows. As far as my includes, i looked down the chain, and it is mostly Qt classes that are included, and a few other things like cdio. Any way I can check the include chain to find anything suspicious? Like I said before, the most frustrating thing is, that this exact code compile fine under Linux using gcc, but fails under Windows using mingw.

wysota
10th September 2010, 01:15
Well, my development environment is Qt Creator 2.0 for Windows.
I don't mean Creator. I mean your include files and such.


As far as my includes, i looked down the chain, and it is mostly Qt classes that are included, and a few other things like cdio.
If you are using ::write() then it's somethine more than just Qt. Some library is probably screwing up your compilation.


Any way I can check the include chain to find anything suspicious?
I doubt it is anything obvious.


Like I said before, the most frustrating thing is, that this exact code compile fine under Linux using gcc, but fails under Windows using mingw.
If your Windows files destroy the compilation then I can believe that happening. I've already seen it :)

You can do two things. First start getting rid of include files (and code that uses it) until the compilation starts working again - then you'll know which file is the first in chain of causing the problem. The other thing you can do is take the file the compiler complains about, open it on the line it complains about and read carefully everything that is before this line - maybe you will spot something disturbing. Especially pay attention to macros defined and grep your includes for them. It could be that one library relies on a macro being defined and some other library undefines it because of some reason.

skepticalgeek
13th September 2010, 09:16
Thanks for the help. I struggled with the issue all weekend, and finally solved it by changing the order of the includes in the header file for the form. It took me a while to find the exact sequence. Any flags I can pass to Qmake or MinGw so that it will be smart enough to figure this out on it's own, without me having to guess at which order it wants the include statements in?

wysota
13th September 2010, 10:17
Any flags I can pass to Qmake or MinGw so that it will be smart enough to figure this out on it's own, without me having to guess at which order it wants the include statements in?

No, it's not possible. Consider the following two include files:

// A.h
#ifndef SOME_VAR
#define SOME_VAR 1
#endif

// B.h
#ifndef SOME_VAR
#define SOME_VAR 2
#endif
and then:

// main.cpp
#include <A.h>
#include <B.h>
It's not possible to determine if this is a correct include order or not without knowing the effect you want to achieve. The compiler can't do it for you.

skepticalgeek
13th September 2010, 17:59
Fair enough. Any idea why the original compilation order worked under Linux, and choked under Windows? Same code,same IDE (Qt Creator), same header files for the 3rd party libraries. The only difference is I was linking to 3rd party DLLs in the pro file, instead of 3rd party .so files.

wysota
13th September 2010, 18:52
Fair enough. Any idea why the original compilation order worked under Linux, and choked under Windows? Same code,same IDE (Qt Creator), same header files for the 3rd party libraries.
... different defines active for each platform in those same files.

skepticalgeek
14th September 2010, 10:41
Well, the multiple definition errors are back again, and this time they mean business. I though everything was working, until I made a minor code change, and kaboom! Here they come back for more. Here is a sample of the output, I ran into the character limit trying o post all of it:

In function `Z17qVariantFromValueI8QVariantES0_RKT_':
C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:453: multiple definition of `QVariant qVariantFromValue<QVariant>(QVariant const&)'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:453: first defined here
./debug\moc_frmrip.o: In function `Z16qVariantSetValueI8QVariantEvRS0_RKT_':
C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:475: multiple definition of `void qVariantSetValue<QVariant>(QVariant&, QVariant const&)'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:475: first defined here
./debug\moc_frmrip.o: In function `QVariant':
C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:480: multiple definition of `QVariant::QVariant()'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:480: first defined here
./debug\moc_frmrip.o: In function `QVariant':
C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:480: multiple definition of `QVariant::QVariant()'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:480: first defined here
./debug\moc_frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:481: multiple definition of `QVariant::isValid() const'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:481: first defined here
./debug\moc_frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:536: multiple definition of `QVariant::isDetached() const'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:536: first defined here
./debug\moc_frmrip.o: In function `ZeqRK8QVariantRK24QVariantComparisonHelper':
C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:558: multiple definition of `operator==(QVariant const&, QVariantComparisonHelper const&)'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:558: first defined here
./debug\moc_frmrip.o: In function `ZneRK8QVariantRK24QVariantComparisonHelper':
C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:563: multiple definition of `operator!=(QVariant const&, QVariantComparisonHelper const&)'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:563: first defined here
./debug\moc_frmrip.o: In function `Z13qvariant_castI8QVariantET_RKS0_':
C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:583: multiple definition of `QVariant qvariant_cast<QVariant>(QVariant const&)'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:583: first defined here
./debug\moc_frmrip.o: In function `Z11qIsDetachedI8QVariantEbRT_':
C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:601: multiple definition of `bool qIsDetached<QVariant>(QVariant&)'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:601: first defined here
./debug\moc_frmrip.o: In function `Z5qSwapI8QVariantEvRT_S2_':
C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:601: multiple definition of `void qSwap<QVariant>(QVariant&, QVariant&)'
./debug\frmrip.o:C:\SKG_Jukebox/../Qt/2010.04/qt/include/QtCore/../../src/corelib/kernel/qvariant.h:601: first defined here
collect2: ld returned 1 exit status
mingw32-make[1]: *** [SKG_Jukebox.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project SKG_Jukebox (target: Desktop)
When executing build step ''

The problems seem to be coming from my moc object files. It looks like qmake is making defective files, then the compiler is complaining about the multiple definitions. I am not putting this in my code. I am not making up new definitions of basic Qt objects and functions, and then wondering why they don't compile. I checked my pro file 3 times, no duplicate entries in the file list. Here it is though, if it can help anyone figure this out.

# -------------------------------------------------
# Project created by QtCreator 2010-01-22T23:16:56
# -------------------------------------------------
QT += network \
phonon \
xml
TARGET = SKG_Jukebox
TEMPLATE = app
SOURCES += main.cpp \
SKG_RoundButton/skg_roundbutton.cpp \
jukeboxconfig.cpp \
SKG_AlbumPanelSmall/skg_albumpanelsmall.cpp \
SKG_AlbumPanelSmall/skg_albumpanelframesmall.cpp \
SKG_AlbumPanel/skg_albumpanel.cpp \
SKG_AlbumPanel/skg_albumpanelframe.cpp \
SKG_AlbumWidget/skg_albumwidget.cpp \
SKG_AlbumWidget/skg_albumframe.cpp \
lib/skglib.cpp \
SKG_Button/skg_button.cpp \
mainnetbook.cpp \
mainnormal.cpp \
frmrip.cpp \
frmtracklist.cpp \
frmoptions.cpp \
googleimagesearch.cpp \
yahooimagesearch.cpp \
frmalbumart.cpp \
frmalbumartdialog.cpp \
frmalbumartmulti.cpp \
customalbumlist.cpp \
customlistmanager.cpp \
frmloadcustomlist.cpp \
frmconfig.cpp \
frmaddeditlist.cpp \
keytranslator.cpp \
# ogg_encoder.cpp \
mp3_encoder.cpp \
# flac_encoder.cpp \
cd_extractor.cpp \
frmdialog.cpp \
playlist.cpp \
playlistmanager.cpp \
frmaddeditplaylist.cpp \
frmloadplaylist.cpp \
frmsplash.cpp \
freedblookup.cpp
HEADERS += SKG_RoundButton/skg_roundbutton.h \
jukeboxconfig.h \
SKG_AlbumPanelSmall/skg_albumpanelsmall.h \
SKG_AlbumPanelSmall/skg_albumpanelframesmall.h \
SKG_AlbumPanel/skg_albumpanel.h \
SKG_AlbumPanel/skg_albumpanelframe.h \
SKG_AlbumWidget/skg_albumwidget.h \
SKG_AlbumWidget/skg_albumframe.h \
lib/skglib.h \
SKG_Button/skg_button.h \
mainnetbook.h \
mainnormal.h \
frmrip.h \
frmtracklist.h \
frmoptions.h \
googleimagesearch.h \
yahooimagesearch.h \
frmalbumart.h \
frmalbumartdialog.h \
frmalbumartmulti.h \
customalbumlist.h \
customlistmanager.h \
frmloadcustomlist.h \
frmconfig.h \
frmaddeditlist.h \
keytranslator.h \
# ogg_encoder.h \
mp3_encoder.h \
# flac_encoder.h \
cd_extractor.h \
frmdialog.h \
playlist.h \
playlistmanager.h \
frmaddeditplaylist.h \
frmloadplaylist.h \
frmsplash.h \
freedblookup.h
FORMS += mainnetbook.ui \
mainnormal.ui \
SKG_AlbumPanelSmall/skg_albumpanelframesmall.ui \
SKG_AlbumPanel/skg_albumpanelframe.ui \
SKG_AlbumWidget/skg_albumframe.ui \
frmtracklist.ui \
frmoptions.ui \
frmalbumart.ui \
frmalbumartdialog.ui \
frmalbumartmulti.ui \
frmloadcustomlist.ui \
frmconfig.ui \
frmaddeditlist.ui \
frmrip.ui \
frmdialog.ui \
frmaddeditplaylist.ui \
frmloadplaylist.ui \
frmsplash.ui

LIBS += -LC:\Qjson\lib -lqjson0 \
-LC:\SKG_Jukebox\dll \
-llibcdio-10 \
-llibcdio_cdda-0 \
-llibcdio_paranoia-0 \
-llame_enc

At this point, I no longer care why this is occurring. I just want it to stop. I want to know which arguments I can pass to qmake or mingw-make32, to get it to stop creating object files with multiple definitions of standard Qt classes, or to ignore them in the compilation process. I don't feel I should have to play guessing games with the preprocessor, to determine which Qt include files I can and cannot include in my objects. I just want Qt creator, and the tools it is using, to stop prison raping me, and compile what I wrote, in the absence of syntax errors. Again, this exact project compiles and runs like a dream in Linux. What is it about Qt in Windows that it wants to make my life miserable. And it all started when I tried adding this one form. There are over a dozen forms in this project, and it is only this one, FrmRip, that caused all this. Before this, the project compiled and ran fine under Windows. There is nothing in the include chain in this form except Qt headers, and some third party headers that I know are not the problem. I can post the includes here, if that will help anyone. Sorry if I came off a little too angry, but I am tired of wrestling with this, and getting desperate.

wysota
14th September 2010, 11:44
It's not that simple. There is no "--dont-throw-errors-on-me" compiler switch. Begin with a simple project, start adding files (and code) to it until it stops compiling. Then you'll know where to look for the problem.

skepticalgeek
14th September 2010, 18:14
I wasn't looking for a "don't throw errors" switch. I don't object to the compiler throwing errors. I object to it throwing errors on stuff I didn't write. I didn't create multiple definitions of all these Qt objects, qmake or the linker did. I want them to stop doing that. Failing that, I was looking for something like a /FORCE switch in Visual Studio, or something like an ignore multiple definitions switch.

That said, I appreciate the time you've taken to try to help me on this. I'm just frustrated. As far as I can tell, I haven't done anything but include standard Qt headers in a Qt project, then watched the compiler tell me to screw myself. For some reason, that stops being fun after about a week.

wysota
14th September 2010, 18:39
I didn't create multiple definitions of all these Qt objects, qmake or the linker did.
No, they didn't.


I want them to stop doing that.
So don't use 3rd party libraries that break your compilation.


Failing that, I was looking for something like a /FORCE switch in Visual Studio, or something like an ignore multiple definitions switch.
Sure. Assuming you have the following two definitions of the same method:

bool func() { return true; }
bool func() { return false; }
Which one would you like for the compiler to ignore automatically?


I'm just frustrated.
Don't be. Just do what I suggested.


As far as I can tell, I haven't done anything but include standard Qt headers in a Qt project, then watched the compiler tell me to screw myself. For some reason, that stops being fun after about a week.
But you can't blame Qt for that. From what I see you are using 3rd party libraries that have their own includes and own functions/classes. You can't call that including only "standard Qt headers in a Qt project". I'm sure that if you remove all those non-Qt includes (and of course code related to them), your application will compile just fine.