Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QT with Windows Filtering Platform
Forum Updated to NodeBB v4.3 + New Features

QT with Windows Filtering Platform

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 3.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tadamczak
    wrote on last edited by
    #1

    Hello,

    I have to create GUI for my project written in VS in c++. It's small application which adds filters to block chosen web brower using WFP. I have GUI written in VS but i need to make it in QT. I'm trying to move my code from VS to QT creator. First problem i faced was affter including WFP library

    In Visual studio my code looked:
    @#pragma once

    #include <windows.h>
    #include <fwpmu.h>
    #include <rpc.h>
    #include <winioctl.h>
    #include <strsafe.h>
    #include <stdio.h>
    #include <guiddef.h>
    #include <vcclr.h>
    #include <AccCtrl.h>
    #include <Aclapi.h>
    #include <sddl.h>
    #include <fstream>
    #include <iostream>

    #pragma comment(lib, "fwpuclnt.lib")
    #pragma comment(lib, "rpcrt4.lib")
    #pragma comment(lib, "advapi32.lib")@

    After moving this to QT i get error:

    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\ipsectypes.h:8: In file included from c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\ipsectypes.h:8:0,

    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmtypes.h:9: from c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmtypes.h:9,

    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmu.h:10: from c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmu.h:10,

    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\QTTrojan\GUI.cpp:2: from ..\QTTrojan\GUI.cpp:2:

    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\iketypes.h:746: błąd: #endif without #if
    #endif /* iketypes_h */
    ^

    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmtypes.h:10: In file included from c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmtypes.h:10:0,

    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmu.h:10: from c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmu.h:10,

    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\QTTrojan\GUI.cpp:2: from ..\QTTrojan\GUI.cpp:2:

    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\iketypes.h:746: błąd: #endif without #if
    #endif /* iketypes_h */
    ^

    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmu.h:11: In file included from c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmu.h:11:0,

    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\QTTrojan\GUI.cpp:2: from ..\QTTrojan\GUI.cpp:2:
    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\iketypes.h:746: błąd: #endif without #if
    #endif /* iketypes_h */
    ^
    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\QTTrojan\GUI.cpp:4: In file included from ..\QTTrojan\GUI.cpp:4:0:

    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\QTTrojan\interface.h:19: ostrzeżenie: ignoring #pragma comment [-Wunknown-pragmas]
    #pragma comment(lib, "fwpuclnt.lib")
    ^

    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\QTTrojan\interface.h:20: ostrzeżenie: ignoring #pragma comment [-Wunknown-pragmas]
    #pragma comment(lib, "rpcrt4.lib")
    ^

    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\QTTrojan\interface.h:21: ostrzeżenie: ignoring #pragma comment [-Wunknown-pragmas]
    #pragma comment(lib, "advapi32.lib")
    ^

    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmtypes.h:10: In file included from c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmtypes.h:10:0,
    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmu.h:10: from c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\fwpmu.h:10,
    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\QTTrojan\GUI.cpp:2: from ..\QTTrojan\GUI.cpp:2:
    c:\qt\qt5.2.0\tools\mingw48_32\i686-w64-mingw32\include\iketypes.h:743: błąd: expected declaration before '}' token
    }
    ^

    I've just started learning QT so im complete newbie. I've been searching internet for solution for more than 5 hour now. I would appreciate any help!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      AFAIK, there's no equivalent of "pragma comment" for gcc. You will have to either use MSVC or use the LIBS variable in your pro file to link to these libraries

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved