Adding gcc and gdb to Creator (Windows XP)
-
wrote on 2 Dec 2011, 00:50 last edited by
Hi -
I have to begin developing on a XP platform. On the Mac, I was using gdb and gcc, and I'd like to use them on the XP box, too. I tried installing Cygwin, but...to be honest, I can't tell whether the installation was successful or not. It doesn't appear in my tool chain, so I assume I'm not done. So:
- Is Cygwin the best/only way to get gcc and gdb up on my XP?
- Does anyone have any experience running it? I've run the setup.exe, selected gcc4, but that's as far as I've gone.
Thanks.
-
wrote on 2 Dec 2011, 01:04 last edited by
I would advise against cygwin, better use a "MinGW":http://www.mingw.org/ environment. This is the platform supported by Qt too (the open source SDK can install a MinGW environment for you).
If you install your own copy of MinGW, you'll have to build the Qt libs manually. That's quite easy, just like on the Mac. If you utilize the MinGW of the SDK you can use the prebuilt binaries of course.
I happily switched our commercial project from Visual Studio to MinGW (self installed, not from the SDK) recently, it works like a charm.
-
wrote on 2 Dec 2011, 01:12 last edited by
OK...I'll take your word for it (less work for me). MinGW it is. I'll be happy to use whatever debugger comes along with it.
On the XP build, I'm getting a compile-time warning for this line of code:
@const uint64_t BIT_56_63 = 0xff00000000000000;
@The error is "integer constant too large for 'long' type"
Am I running into a problem caused by the fact that my XP system is 32-bit, or is there something less insidious at play here? (I don't get this error on the Mac).
-
wrote on 2 Dec 2011, 13:02 last edited by
Hm, I don't get an error or warning on my MinGW installation.
Which MinGW do you use? The SDK bundled one or did you install it your self?
What's your gcc version (call "gcc --version" on the MSYS command line)?
Did you try to replace uint64_t with quint64? -
wrote on 2 Dec 2011, 15:05 last edited by
I'm using the bundled version that came in the download yesterday. According to the tool chain, it's in /QtSDK/mingw/bin/mingw32-g++.exe.
I can't find the MSYS command line, so I can't tell you what version.
And...I'm reluctant to use Qt data typing, because I don't yet know where all this program will be hosted, but I did test it, and got the same error.
I was told that Boost might get me around this problem, but...how to install it isn't obvious (actually, not much of anything on Windows is obvious to me). I downloaded it and unzipped it, but haven't figured out how to complete the installation.
-
wrote on 2 Dec 2011, 15:23 last edited by
Strange. Are you really sure you only do have a 64 bit constant?
What is the output of
@
qDebug() << "sizeof(uint64_t)" << sizeof(uint64_t);
qDebug() << "sizeof(quint64)" << sizeof(quint64);
qDebug() << "sizeof(long long int)" << sizeof(long long int);
qDebug() << "sizeof(long int)" << sizeof(long int);
@ -
wrote on 2 Dec 2011, 15:33 last edited by
[quote author="Volker" date="1322839386"]Strange. Are you really sure you only do have a 64 bit constant?[/quote]
I'm not sure what you're asking...the hex value I'm supplying has 16 digits, which should correspond to 64 bits.
[quote]What is the output of
@
qDebug() << "sizeof(uint64_t)" << sizeof(uint64_t);
qDebug() << "sizeof(quint64)" << sizeof(quint64);
qDebug() << "sizeof(long long int)" << sizeof(long long int);
qDebug() << "sizeof(long int)" << sizeof(long int);
@
[/quote]sizeof (uint64_t) 8
sizeof (quint64) 8
sizeof (long long int) 8
sizeof (long int) 4 -
wrote on 2 Dec 2011, 15:42 last edited by
Can you double-check that there is no typo and you do not have another digit sneaked in? The size of the types look ok.
What's the output of
@
qDebug() << GNUC << GNUC_MINOR << GNUC_PATCHLEVEL;
@ -
wrote on 2 Dec 2011, 15:50 last edited by
Double- and triple-checked...the hex value is good (or at least, it's what I intend it to be. ff, followed by 14 0s.
I've also tried ff << 56 with similar results.
Is it possible that I'm omitting a needed header file? Which do you include in your example that worked?
Output of that line is:
4 4 0.
Thanks for helping.
-
wrote on 2 Dec 2011, 15:57 last edited by
That's the complete program:
@
#include <QtCore/QCoreApplication>
#include <QDebug>int main(int argc, char *argv[])
{
QCoreApplication(argc, argv);
const quint64 ui64 = 0xf123456789abcdef;qDebug() << "ui64" << ui64 << QString::number(ui64, 16); qDebug() << "sizeof(quint64)" << sizeof(quint64); qDebug() << "sizeof(uint64_t)" << sizeof(uint64_t); qDebug() << "sizeof(long long int)" << sizeof(long long int); qDebug() << "sizeof(long int)" << sizeof(long int); return 0;
}
@ -
wrote on 2 Dec 2011, 16:13 last edited by
Fascinating...I just copied your program, and I get the same warning I've been getting all along (line 7 this time).
Is your system 32-bit?
EDIT: I have a number of other compilers in my tool chain; would it be worth trying a different one? How does one go about shuffling the order of the auto-detected tools?
-
wrote on 2 Dec 2011, 22:59 last edited by
Hm. It's a 64bit Vista system. But MinGW and Qt both are 32bit versions, so theoretically that shouldn't be a problem.
I need to install the SDK on a 32 bit XP box next week to check.
-
wrote on 3 Dec 2011, 00:17 last edited by
OK...in the meantime, I'd better start looking for a solution to this. Do you use the Boost libraries on your Vista system? I need a pointer on installing it.
-
wrote on 3 Dec 2011, 00:23 last edited by
Nope, I never was in need of using boost.
3/14