Results 1 to 2 of 2

Thread: Unable to successfully create Qt application

  1. #1
    Join Date
    Apr 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Unable to successfully create Qt application

    Hi all,
    I've downloaded and installed "qt-sdk-win-opensource-2009.01.1" with Qtcreator on windows xp.I'm new to Qt and I'm trying to build an application that uses winpcap but have encountered some issues that needs advice.

    1) After installation I've manually set the environment variables for PATH,QTDIR and QMAKESPEC as mine does not show these 3 variables after installation. I've created a Qt4 GUI application project and added the following to .pro file and main.cpp:
    my .pro file looks like:
    Qt Code:
    1. TARGET = HelloQtGUI
    2. TEMPLATE = app
    3.  
    4. SOURCES += main.cpp\
    5. helloqtgui.cpp
    6.  
    7. HEADERS += helloqtgui.h
    8.  
    9. FORMS += helloqtgui.ui
    10.  
    11. win32:LIBS += -Ld:/proj/WpdPack402/Lib -lwpcap
    12. win32:INCLUDEPATH += d:/proj/WpdPack402/Include
    To copy to clipboard, switch view to plain text mode 
    while my main.cpp looks like:
    #include <QtGui/QApplication>
    #include "helloqtgui.h"
    #include <pcap.h>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    HelloQtGUI w;
    w.show();

    //Testing portion of code
    char *dev,errbuf[PCAP_ERRBUF_SIZE];
    //Retrieve the device list from the local machine
    dev = pcap_lookupdev(errbuf);
    if (dev == NULL)
    {
    fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
    return(2);
    }
    printf("Device: %s\n", dev);

    return a.exec();
    }
    However,when I hit Ctrl+R to run it i get the following application output message and the blank GUI main window does not pop up:
    Starting D:/proj/HelloQtGUI/debug/HelloQtGUI.exe...

    D:/proj/HelloQtGUI/debug/HelloQtGUI.exe exited with code -1073741515
    I tried to run the executable in debug folder but an error with "The application has failed to start because wpcap.dll was not found.Re-installing the application may fix this problem".There seems to be no compilation issues.If I were to remove the "Testing portion" of winpcap code then it works fine.

    Then I removed the environment variables (since initially installation does not add them) and rerun my application but now I get this message when I tried to run my executable:
    "The application has failed to start because mingwm10.dll was not found.Re-installing the application may fix this problem".

    Is there any solution for this??

    2) If my application uses winpcap libraries and required to be able to run on different versions of windows like xp and vista,which deployment will be more appropriate to use,static or shared libraries?Perhaps can someone provide me a clearer picture of this?

    Thanks in advance.Appreciate any help.
    Last edited by remy06; 25th April 2009 at 11:52.

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Unable to successfully create Qt application

    try to copy wpcap.dll to your application dir (where your .exe file is).
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

Similar Threads

  1. Visual Studio 2005 Express
    By Muzz in forum Installation and Deployment
    Replies: 22
    Last Post: 6th November 2008, 06:21
  2. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  3. Program crashes with assert error in xcb_lock.c
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2007, 19:56
  4. KDE 3.5.0 crash while opening project
    By MarkoSan in forum KDE Forum
    Replies: 2
    Last Post: 19th October 2007, 16:21

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.