Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Must create QTimer before call function in other dll on 32bit compiler of windows
Forum Updated to NodeBB v4.3 + New Features

Must create QTimer before call function in other dll on 32bit compiler of windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 207 Views 2 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.
  • A Offline
    A Offline
    Andy Matos
    wrote on last edited by
    #1

    I am using Qt to develop GUI of a face recognition application.

    The Face recognition algorithm is provided by other developers in the form of dynamic libraries. So I have face.dll, face.lib and face.h (both 32bit and 64bit) in my qt project. I just link the face library to my qt application.

    And in my MainWindow constructor, I just call a function of face library to set callback and create a QTimer like this.

    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
    {
        face_set_callback(CB_STATUS, (void *) face_callback, (void *) this);
        clearTimer = new QTimer(this);
    }
    
    void MainWindow::face_callback(int type, int value, void *vptr_args)
    {
    
    }
    

    The strange thing is that these codes works fine when I use MSVC2015 64bit Kit to build and GUI come up as normal, but when I use MSVC2015 32bit Kit to build, the application compile successfully but ends with " The process was ended forcefully" and crashed before GUI come up.

    After some tests, I find that if I call face_set_callback after create clearTimer, everything works fine in 32bit build.
    In 64bit build, the order of create QTimer and face_set_callback is not has no effect.

    The code works fine after I change the order, but I just wanna to know why it does not work if I put face_set_callback before creating QTimer.

    Or is there anyone can offer some idea on how to find out the problem, since I have no idea on why this is happening.

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Since we don't know what face_set_callback is doing we can't help you. I would use a debugger to see where it crashes.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

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

        Hi,

        To add to @Christian-Ehrlicher, if you can't get the sources it might be interesting to try to get the options used to build these libraries.

        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
        1

        • Login

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