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. The program crashes in release mode
Forum Updated to NodeBB v4.3 + New Features

The program crashes in release mode

Scheduled Pinned Locked Moved General and Desktop
8 Posts 5 Posters 3.5k 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.
  • K Offline
    K Offline
    knvmbox
    wrote on last edited by
    #1

    I have compiled program in VS 2008 (Qt 4.8.5) in release mode. Program uses DB Firebird. I run program from VS and all works fine, but when I try run program from Explorer or CMD.exe it crashes when it connect to DB.

    Visual Studio 2008 Professional.
    Windows XP 32bit

    1 Reply Last reply
    0
    • T Offline
      T Offline
      terenty
      wrote on last edited by
      #2

      Hi,
      As I understood your program runs fine in debug but crashes in release?
      It could be due to uninitialized variables since they initialized to default in VS in debug mode. Also check your warnings in debug , there might be some hints

      1 Reply Last reply
      0
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        I never worked with firebird, but this sounds like your program can't find some dependent libraries at runtime. Make sure that you have whatever library(dll) firebird requires in your app directory.

        If you can't figure out what that is use Dependency Walker to check for dependencies.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          knvmbox
          wrote on last edited by
          #4

          [quote author="terenty" date="1385666052"]Hi,
          As I understood your program runs fine in debug but crashes in release?
          It could be due to uninitialized variables since they initialized to default in VS in debug mode. Also check your warnings in debug , there might be some hints[/quote]

          Hi Terenty,
          Program works success in debug mode if it runs as from VS as from Explorer. In release mode it works only if it runs from VS. If I run program from Explorer it crashes when I try connect to DB

          1 Reply Last reply
          0
          • K Offline
            K Offline
            knvmbox
            wrote on last edited by
            #5

            [quote author="Chris Kawa" date="1385666148"]I never worked with firebird, but this sounds like your program can't find some dependent libraries at runtime. Make sure that you have whatever library(dll) firebird requires in your app directory.

            If you can't figure out what that is use Dependency Walker to check for dependencies.[/quote]

            Chris,
            The strange for me that the program works well if it runs from VS, but not from Explorer.

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #6

              There's nothing strange about it.
              When you run your program in the development environment IDE sets various additional stuff for you like environment variables, link locations, search paths etc.

              When you run an app outside of IDE it relies solely on the system paths. If it can't find a library at runtime in system locations (on windows that is exe location, PATH env variable and Windows/System32/SysWow64 folders) it gives up.
              Debug mode runs also from outside IDE because debug binaries contain hardcoded paths to dependencies inside them for debug purposes. It still wouldn't work on another machine or if you move stuff around.

              Just look around this forum for "runs in IDE but doesn't outside". Tons of topics and 99.9% of the times it's bad deployment (missing libraries).

              So again - there's almost certainly some .dll that your db engine is located in. Find out what that is and put it in the exe location.
              You can find out which is it either by sniffing with Dependency Walker or check the Output window in VS when you run your app. It shows all the modules(dlls) it loads.

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

                Hi,

                To add to Chris Kawa, have a look at "the Windows deployment guide":http://qt-project.org/doc/qt-4.8/deployment-windows.html

                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
                • JeroentjehomeJ Offline
                  JeroentjehomeJ Offline
                  Jeroentjehome
                  wrote on last edited by
                  #8

                  Hi, Maybe post the crash report if given? That might give some suggestion. What Chris says is very accurate! May sure your links and paths are correct for release. Maybe you should debug your way through your code and 'simulate' a non found dll. What does your code do when the DB isn't found, the pointer to it isn't loaded etc.
                  Even try to introduce exceptions in there?

                  Greetz, Jeroen

                  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