Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: Runtime problem in Release mode

  1. #1
    Join Date
    Apr 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Runtime problem in Release mode

    Hi All,

    I'm using Qt SDK 2009.5 and developing using QtCreator and the bundled MinGW on Windows 7 x64. So far, in debug mode, everything worked just fine and my application builds, runs and can be debugged without problems.

    When I try to run the application compiled in release mode, I get the runtime error "Unable to find entry point _Z9qBadAllocv in QtCore4.dll".

    I haven't found any way to fix it so far. By doing an "nm" on the static QtCore4.a I have seen that indeed it contains _Z9qBadAllocv... so I'd expect to find it also in the dll.

    Any pointers? Thanks !

    Giacomo

  2. #2
    Join Date
    Dec 2009
    Posts
    26
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Runtime problem in Release mode

    Hi,

    I am facing this problem in debug mode too. My OS is Windows XP SP2. Please tell me how you able to run your program in debug mode.

    regards
    rittchat

  3. #3
    Join Date
    Apr 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Wink Re: Runtime problem in Release mode

    I haven't done anything special. I created an empty project with Creator, populated it with my files and everything worked out of the box.

    I also tried to use the qt command line. I removed every file from my project folder ( except sources and ui file naturally ) then ran "qmake -project", "qmake", "make". Both debug and release binaries are created, but the release exe still presents the same problem.

    My sensation is that Creator has some minor bugs. For example, every time I open my project, I have to remove Makefiles, .user file, debug and release folder or I get the error "The process could not be started!" when I try to run my app.

    Nothing special but still annoying

  4. #4
    Join Date
    Dec 2009
    Posts
    26
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Runtime problem in Release mode

    I also tried to use the qt command line. I removed every file from my project folder ( except sources and ui file naturally ) then ran "qmake -project", "qmake", "make". Both debug and release binaries are created, but the release exe still presents the same problem.
    In my case whenever I am trying 'make' it is saying that

    'make' is not recognized as an internal or external command, operable program of batch file.

    But when I am running 'mingw32-make' it is creating the debug binary only. But the problem still exist.

    regards
    rittchat

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

    Default Re: Runtime problem in Release mode

    You are using the wrong DLL. Use the one in the 'qt/bin' dir rather than the one in the 'bin' dir. For a test, you can copy it to your apps release folder.

  6. #6
    Join Date
    Apr 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Runtime problem in Release mode

    Hi, I had not realized there are two bin folders, \qt\bin and \bin. What's the difference between the two?

    Unfortunately, by copying one or the other dll in my release folder, I still get an "entry point not found" error. It happens on two different entry points, but still an error.

  7. #7
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    288
    Thanks
    23
    Thanked 32 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Runtime problem in Release mode

    Quote Originally Posted by fatjuicymole View Post
    You are using the wrong DLL.
    No he is not. I have the same problem, I already tested all the qtcore4.dll, copy all of them, did lots os tests, and the problems persists. I put a thread the forum "instalation and deployment" and still havent figured this out. Is not the code either because runs fine in linux, and happens the same with empty projects, works good in debug and crashes in release. I'm using Vista.
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

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

    Default Re: Runtime problem in Release mode

    Well, what can I say? "Unable to find entry point" means exactly that - that it can't find that particular function in the DLL file. Since Qt ships with pretty much every function available in the DLL, the only explanation is that the system is trying to use a custom-compiled QtCore DLL which doesn't have the function that the program needs. If the function wasn't in the DLL, the linker would complain when you ran it, as it wouldn't be able to find the function in the dynamic version of the .a file either.

    Maybe you should host your executable which doesn't work somewhere for someone else to test. If it works on there PC, then it's definitely a DLL issue.

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Runtime problem in Release mode

    Quote Originally Posted by fatjuicymole View Post
    Since Qt ships with pretty much every function available in the DLL, the only explanation is that the system is trying to use a custom-compiled QtCore DLL which doesn't have the function that the program needs.
    Or that the function is at different offset in the library which may happen when trying to run the application against a different version of the library it was linked against (i.e. running against 4.7 while building against 4.6). Which may happen exactly when you take the dll from qtsdk\bin\ instead of qtsdk\qt\bin as already mentioned. Maybe the export library is broken?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    288
    Thanks
    23
    Thanked 32 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Runtime problem in Release mode

    Quote Originally Posted by wysota View Post
    Maybe the export library is broken?
    can you explain this ?
    Here is a exe from a empty project, if someone could test it, thank you.
    Attached Files Attached Files
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

  11. #11
    Join Date
    Dec 2009
    Posts
    26
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Runtime problem in Release mode

    Hi,

    The attached exe file in XP producing same error. I also tried Win7. Same thing had happened as mentioned by benelgiac. It is running fine in debug mode. In release mode only qt creator can run the exe . But in Xp nothing is running .

    regards
    rittchat

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Runtime problem in Release mode

    Quote Originally Posted by john_god View Post
    can you explain this ?
    What exactly? If the export library is incorrect then the resulting executable will not link against an incompatible dll during runtime.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. #13
    Join Date
    Jul 2009
    Posts
    42
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Runtime problem in Release mode

    When I began programming with QT earlier this year I ran into the same Problem.

    When you run from Creator everything works fine. But when you run the EXE it complains about missing DLL(s).

    I think this has something to do with the build configuration... (have not found how to solve it here)

    But, i found that if you copy the Dlls into the applicationfolder it will link and run... You might need more than 1 dll, depending on what Qt Modules your programm uses.

    For me it was necesary to copy following Files (Application is a Custom rich Text Editor)

    mingwm10.dll
    msvcrt.dll
    QtCore4.dll
    QtGui4.dll

    Somewhere I found an Article that lead me to this solution including a small app called "Depends" which will help you find out which dlls your exe needs.

    I hope this helps...

    Eric

  14. #14
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    288
    Thanks
    23
    Thanked 32 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Runtime problem in Release mode

    Quote Originally Posted by wysota View Post
    What exactly?
    I dont know what a export library is, is it the dll ? I deleted the previous Qt version before installng the current one, so there shouldnt be older dll to cause caos.

    Quote Originally Posted by wysota View Post
    Maybe the export library is broken?
    How can I fix it?
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

  15. #15
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Runtime problem in Release mode

    Quote Originally Posted by benelgiac View Post
    Hi, I had not realized there are two bin folders, \qt\bin and \bin. What's the difference between the two?
    The files in the /bin directory are the runtime libraries against which the bundled Qt Creator has been built. They have probably been built using the Microsoft VC++ compiler. The files in /qt/bin are the runtime libraries (debug and release) as built using the bundled MingW compiler. These are the files Qt Creator will use when it builds and runs your program, and the files you should deploy.

    The separation is there to allow the Qt Creator to run independently of any version of Qt, or set of configuration settings, you may be developing your application against.

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

    Default Re: Runtime problem in Release mode

    Quote Originally Posted by john_god View Post
    I dont know what a export library is, is it the dll ? I deleted the previous Qt version before installng the current one, so there shouldnt be older dll to cause caos.
    You should search your system to ensure that is the case. Any application can install the Qt libraries and modify your system search path.

  17. #17
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Runtime problem in Release mode

    Quote Originally Posted by john_god View Post
    I dont know what a export library is, is it the dll ?
    No. It has a "lib" extension for MSVC libraries and "a" for MinGW ones.

    I deleted the previous Qt version before installng the current one, so there shouldnt be older dll to cause caos.
    If you have Qt SDK installed, you have at least two versions of Qt in your system.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  18. #18
    Join Date
    Dec 2009
    Posts
    26
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Runtime problem in Release mode

    One thing I have discovered today, that when I am installing Qt on the folder C:\Qt it is working in Xp but if I am installing Qt in folder C:\Qt\2009.5 (which is the default folder of installation) it is not working.

    second thing is that even in this case also release build is not working UNLESS I copy qtcore4.dll and qtGui4.dll from C:\Qt\qt\bin folder to release folder. I find that qtCore4.dll in C:\Qt\bin folder have different size than qtCore4.dll in C:\Qt\qt\bin folder. Please let me know that whether release build is working or nor in Win7 after copying these 2 dlls.

    regards
    rittchat

  19. #19
    Join Date
    Jul 2006
    Location
    Catalunya - Spain
    Posts
    117
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Runtime problem in Release mode

    Quote Originally Posted by rittchat View Post
    One thing I have discovered today, that when I am installing Qt on the folder C:\Qt it is working in Xp but if I am installing Qt in folder C:\Qt\2009.5 (which is the default folder of installation) it is not working.
    One idea : it's not the first time you install QT, isn't it ? So, perhaps you have an old C:\Qt\bin in your path before C:\Qt\2009.5\qt\bin and O.S. searches missing DLLs in that path before.

    As wysota said, on qtsdk/bin are the qtcreator DLLs ( release mode ) and in qtsdk/qt/bin are the redistributable DLLs so when you try to execute release version, execution fails.

    second thing is that even in this case also release build is not working UNLESS I copy qtcore4.dll and qtGui4.dll from C:\Qt\qt\bin folder to release folder. I find that qtCore4.dll in C:\Qt\bin folder have different size than qtCore4.dll in C:\Qt\qt\bin folder.
    Of course that copying DLLs works !! WIndows first searches needed DLLs on exe's path, then following PATH variable and - if I'm not confused - on system paths...

    Checks environment variables, there must be the error, for sure.

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

    Default Re: Runtime problem in Release mode

    Open a command prompt (Start->Run->Cmd) and then type "echo %PATH%" and post your findings.

Similar Threads

  1. problem with mouse release on the border, help me!
    By dungsivn in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2007, 09:16
  2. qodbc driver not loaded error in release mode
    By mandal in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2006, 10:42
  3. Problem with Debug mode in KDevelop
    By zlatko in forum KDE Forum
    Replies: 1
    Last Post: 16th June 2006, 10:10
  4. Problem with Release version
    By jlbrd in forum Installation and Deployment
    Replies: 7
    Last Post: 30th March 2006, 20:45
  5. Runtime dynamic linking + Qt4 problem
    By _Ramirez_ in forum Qt Programming
    Replies: 5
    Last Post: 11th February 2006, 15:28

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.