Results 1 to 5 of 5

Thread: how to avoid conflict in definitions when using Win32 SDK API header in Qt ?

  1. #1
    Join Date
    Mar 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default how to avoid conflict in definitions when using Win32 SDK API header in Qt ?

    Hello Everyone,

    I've come across a problem when using the wlanapi (win32 native WIFI API) in Qt.

    I included the wlanapi.h in my .cpp file. However, the compiler compains that wlanapi.h can not be found. So I added two include paths to my .pro file, like this:

    Qt Code:
    1. INCLUDEPATH += "C:\Program Files\Microsoft SDKs\Windows\v6.1\Include" #this is the path to my wlanapi header
    2. INCLUDEPATH += "C:\Program Files\Microsoft Visual Studio 9.0\VC\include" #this is the path to header files included by wlanapi.h
    To copy to clipboard, switch view to plain text mode 

    When compile, it shows up a lot of warning/errors which make me feel that the <QtCore/qglobal.h> has conflict with those win32's:


    In file included from d:\Qt\2010.05\qt\include/QtCore/../../src/corelib/tools/qbytearray.h:48,

    from d:\Qt\2010.05\qt\include/QtCore/qbytearray.h:1,

    from d:\Qt\2010.05\qt\include/QtCore/../../src/corelib/tools/qstring.h:46,

    from d:\Qt\2010.05\qt\include/QtCore/qstring.h:1,

    from d:\Qt\2010.05\qt\include\QtCore/../../src/corelib/kernel/qobject.h:48,

    from d:\Qt\2010.05\qt\include\QtCore/qobject.h:1,

    from d:\Qt\2010.05\qt\include\QtCore/QObject:1,

    c:\Program Files\Microsoft Visual Studio 9.0\VC\include/string.h:141: warning: ignoring #pragma warning

    c:\Program Files\Microsoft Visual Studio 9.0\VC\include/string.h:142: warning: ignoring #pragma warning

    c:\Program Files\Microsoft Visual Studio 9.0\VC\include/string.h:145: warning: ignoring #pragma warning

    c:\Program Files\Microsoft Visual Studio 9.0\VC\include/string.h:266: warning: ignoring #pragma warning

    c:\Program Files\Microsoft Visual Studio 9.0\VC\include/string.h:267: warning: ignoring #pragma warning

    c:\Program Files\Microsoft Visual Studio 9.0\VC\include/string.h:269: warning: ignoring #pragma warning
    Anybody knows how to resolve the conflict ? Many thanks in advance !

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to avoid conflict in definitions when using Win32 SDK API header in Qt ?

    what qt version you are using? QtSDK or compiled yourself? Using the VC2008 binary?

  3. #3
    Join Date
    Mar 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to avoid conflict in definitions when using Win32 SDK API header in Qt ?

    Thank you nish.

    I am using the QtCreator 2.0.1 with Qt SDK ver 4.7.0. The QtSDK is installed, not recompiled. I am not using Visual Studio. I simply want to add some WiFi features to my current QtCreator project.

    I have added #include <wlanapi.h> to my .cpp file. At first it complained that wlanapi.h can not be found, so I added the windows SDK path using "INCLUDEPATH +=" in .pro file. In this case the defines in qt head file get incasinated.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to avoid conflict in definitions when using Win32 SDK API header in Qt ?

    Or maybe just GCC doesn't fully understand the Visual studio-specific Win32 include files. You may need to modify them.

  5. #5
    Join Date
    Mar 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to avoid conflict in definitions when using Win32 SDK API header in Qt ?

    Quote Originally Posted by squidge View Post
    Or maybe just GCC doesn't fully understand the Visual studio-specific Win32 include files. You may need to modify them.
    Thank you. I belive that modifying win32 headers is the last thing I would do ever.

    I found this on google
    http://qt.gitorious.org/qt-mobility/...engine_win.cpp

    This file also contains #include <wlanapi.h>. However I have not managed to compile this project either -- the same problem.

Similar Threads

  1. Replies: 10
    Last Post: 6th April 2011, 10:05
  2. Replies: 0
    Last Post: 20th January 2010, 19:51
  3. MinGW conflict?
    By Paolo_R in forum Newbie
    Replies: 3
    Last Post: 30th June 2009, 05:16
  4. Conflicting header definitions
    By jacky in forum Qt Programming
    Replies: 13
    Last Post: 4th May 2009, 09:51
  5. Framebuffer conflict
    By Vidar Bøe in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 21st November 2008, 10:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.