Wolfgang Pausch | 1 Oct 2009 09:26
Picon

Re: Using windows.h with mingw and Qt

Hello,

> Sounds like a third party is repackaging the MinGW toolchain.
> If it works, great. But if you run into problems, try building
> a simple self-contained test case at the command line (not in
> an IDE) first. That way, if it doesn't work, you can copy and
> paste the exact commands here, and we'll be able to figure out
> how to fix it.

Ok, I wrote the following attached test program.  It is based on 
http://msdn.microsoft.com/en-us/library/ms645598(VS.85).aspx

This page tells me "Declared in Winuser.h, include Windows.h".  My first try was only including windows.h,
the second also including winuser.h, the behaviour was in both cases the same.

My Path variable looks like follows:
C:\Programme\MiKTeX
2.7\miktex\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Programme\Intel\WiFi\bin\;C:\Programme\ATI
Technologies\ATI.ACE\Core-Static;c:\Programme\Gemeinsame
Dateien\Lenovo;C:\Programme\Gemeinsame Dateien\Roxio
Shared\10.0\DLLShared\;C:\Programme\Gemeinsame Dateien\Roxio
Shared\DLLShared\;C:\Programme\Gemeinsame Dateien\Roxio
Shared\DLLShared\;C:\Programme\Gemeinsame Dateien\Roxio
Shared\10.0\DLLShared\;C:\Programme\ThinkPad\ConnectUtilities;C:\Programme\Lenovo\Client
Security Solution;c:\Programme\Microsoft SQL
Server\90\Tools\binn\;C:\Qt\2009.03\qt\bin;C:\Programme\SlikSvn\bin\;C:\MinGW\bin\;\;C:\Programme\MySQLServer51\bin;C:\Programme\util;C:\Programme\Bakefile;c:\Programme\Microsoft
SQL Server\100\Tools\Binn\;c:\Programme\Microsoft SQL Server\
 100\DTS\Binn\

Now I try to compile it.  I get the following error messages:
(Continue reading)

Mark | 1 Oct 2009 09:41
Picon

Re: Using windows.h with mingw and Qt

Wolfgang Pausch wrote:
> This program
>
> #include <windows.h>
>
>
> int main(int argc, char* argv[]) {
> 	MessageBox(NULL, "test", "foo", MB_OK);
> }
>
> works.
there should be an FAQ :-)

at [l3252 of my distribution] of winuser.h it says
#if (_WIN32_WINNT >= 0x0501)

so you need to
#define _WIN32_WINNT 0x0501
then
#include <windows.h>
to properly include the typedef of RAWINPUTDEVICELIST

Best

Mark

http://www.halloit.com

Key ID 046B65CF

(Continue reading)

Wolfgang Pausch | 1 Oct 2009 11:44
Picon

Re: Using windows.h with mingw and Qt

Hello Mark,

> at [l3252 of my distribution] of winuser.h it says
> #if (_WIN32_WINNT >= 0x0501)
> 
> so you need to
> #define _WIN32_WINNT 0x0501
> then
> #include <windows.h>
> to properly include the typedef of RAWINPUTDEVICELIST

Thanks, now it works.  However, what am I doing here?  Do I define a symbol which would usually be defined on my
Windows version (Windows XP), and which just MingW misses for some reason.

Or do I mimic a windows version I actually don´t have?  

So, am I hacking something which would normally not work, or am I just working around some limitation of MingW?

Wolfgang
--

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
(Continue reading)

Mark | 1 Oct 2009 12:00
Picon

Re: Using windows.h with mingw and Qt

Wolfgang Pausch wrote:
> Hello Mark,
>   
>> at [l3252 of my distribution] of winuser.h it says
>> #if (_WIN32_WINNT >= 0x0501)
>>
>> so you need to
>> #define _WIN32_WINNT 0x0501
>> then
>> #include <windows.h>
>> to properly include the typedef of RAWINPUTDEVICELIST
>>     
> Thanks, now it works.  However, what am I doing here?  Do I define a symbol which would usually be defined on my
Windows version (Windows XP), and which just MingW misses for some reason.
>
> Or do I mimic a windows version I actually don´t have?  
>
> So, am I hacking something which would normally not work, or am I just working around some limitation of MingW?
>
> Wolfgang
>   
Hi Wolfgang,

the way I see it you are defining a windows version you are compiling
for; as, essentially the necessary dll would be absent in pre NT5.1, you
are must define that you are compiling for NT5.1+ [ie xp/server 2003]
http://msdn.microsoft.com/en-us/library/aa383745(VS.85).aspx

Best

(Continue reading)

Tor Lillqvist | 1 Oct 2009 12:01
Picon
Picon
Favicon

Re: Using windows.h with mingw and Qt

> So, am I hacking something which would normally not work, or am I just working around some limitation of MingW?

There is no "hacking" involved. You are simply selecting what parts of
the headers are visible to you. The MinGW default is quite
conservative, only declarations of APIs (and related macro and type
definitions) present on some quite old version of Windows is by
default visible. To get declarations of APIs introduced in later
versions of Windows, you need to redefine _WIN32_WINNT.

--tml

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
(Continue reading)

Clive McCarthy | 1 Oct 2009 18:38
Picon
Favicon

An Introduction to GCC


I found this little (just 137 pages) and inexpensive ($16) book an excellent aid to beginning work with gcc:

http://www.amazon.com/Introduction-GCC-Brian-J-Gough/dp/0954161793/ref=cm_cr_pr_product_top

I keep dipping back into it to fix silly problems I encounter such as: the order of libs on the command line,
linking with shared objects, library archiver syntax, etc. It's not a monster reference manual but it
seems to cover ALL the initial problems one is likely to bump into as a new user and it is very easy to read.

You can probably find everything in the book on-line and at no apparent cost but, if your time is worth
anything, having this introduction in one place is valuable. It certainly is for me.
  		 	   		  
_________________________________________________________________
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
(Continue reading)

Lucian Smith | 1 Oct 2009 21:29

cross-compiling linker errors

I seem to be having basically the same problem as David GF did last month, 
but nobody responded to his question.

I'm compiling a library for windows on ubuntu.  I've been able to compile 
the dependent libraries successfully and everything is created and 
installed in /usr/i586-mingw32msvc/ (what I gave configure as '--prefix').

However, once I try to create an actual program that uses the library:

i586-mingw32msvc-c++ -Wall -ggdb -I/usr/i586-mingw32msvc/include/ -L/usr/i586-mingw32msvc/lib/
-o test.exe test.cpp -lsbml

I get errors like:

test.cpp:17: undefined reference to `__imp__writeSBMLToString'

and further on:

libsbml.a(zfstream.o):[home directory]/mingw_libsbml/src/compress/zfstream.cpp:67: undefined
reference to `_gzopen'

Checking nm:

/usr/i586-mingw32msvc/bin/nm /usr/i586-mingw32msvc/lib/libsbml.a | grep writeSBMLToString
         U _writeSBMLToString
00002f40 T _SBMLWriter_writeSBMLToString
00002e80 T _writeSBMLToString

and:

(Continue reading)

JonY | 2 Oct 2009 01:37
Picon

Re: cross-compiling linker errors

On 10/2/2009 03:29, Lucian Smith wrote:
> I seem to be having basically the same problem as David GF did last month,
> but nobody responded to his question.
>
> I'm compiling a library for windows on ubuntu.  I've been able to compile
> the dependent libraries successfully and everything is created and
> installed in /usr/i586-mingw32msvc/ (what I gave configure as '--prefix').
>
> However, once I try to create an actual program that uses the library:
>
> i586-mingw32msvc-c++ -Wall -ggdb -I/usr/i586-mingw32msvc/include/
-L/usr/i586-mingw32msvc/lib/ -o test.exe test.cpp -lsbml
>
> I get errors like:
>
> test.cpp:17: undefined reference to `__imp__writeSBMLToString'
>
> and further on:
>
> libsbml.a(zfstream.o):[home directory]/mingw_libsbml/src/compress/zfstream.cpp:67:
undefined reference to `_gzopen'
>
> Checking nm:
>
> /usr/i586-mingw32msvc/bin/nm /usr/i586-mingw32msvc/lib/libsbml.a | grep writeSBMLToString
>           U _writeSBMLToString
> 00002f40 T _SBMLWriter_writeSBMLToString
> 00002e80 T _writeSBMLToString
>
> and:
(Continue reading)

Muthukumar | 2 Oct 2009 05:30
Picon

Hi

Hello

I have just downloaded the mingw for windows, but could not find enough documentation on how to proceed on until i start coding and executing my first program.

Thanks.
Muthukumar
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Brecht Sanders | 2 Oct 2009 08:45

Re: Hi


Muthukumar wrote:
I have just downloaded the mingw for windows, but could not find enough documentation on how to proceed on until i start coding and executing my first program.

MinGW is just a command line compiler.
To get started with an existing program I suggest you install MSYS, open the MSYS shell and do just as you would on a *nix system (download sources, extract them, run ./configure and the make install), e.g.:
    wget -c http://downloads.sourceforge.net/libpng/libpng-1.2.40.tar.bz2
    tar xfj libpng-1.2.40.tar.bz2
    cd libpng-1.2.40
    ./configure -- help
    ./configure
    make install
If you want to start a new project or if you only have a Windows background I suggest you use an IDE.
For use with MinGW I would recommend Code::Blocks (http://www.codeblocks.org/), although other IDEs exist (Dev-C++, Eclipse).
Good luck
    Brecht
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Gmane