Results 1 to 14 of 14

Thread: QtCore4.dll error when starting the program from cd

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QtCore4.dll error when starting the program from cd

    Qt Code:
    1. QProcess *proc = new QProcess(NULL); // no parents cause i dont want to bind those two applications, i just want to start it without parent....
    To copy to clipboard, switch view to plain text mode 

    It looks like you are using a local pointer 'proc'.
    At the end of the function it will be destroyed - no wonder the application crashes.

    You have to make your QProcess pointer a member, and it has to live as long as the process you are running with it lives.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  2. #2
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtCore4.dll error when starting the program from cd

    I think you are wrong about that, i dont want to kill real exe when the other one killed. And pointers are not destroyed if they have no parents and if you dont delete them or directly the pointer. That is the deal here. I want to start the program and close the other one. And as i said it is working if i start the autorun.exe in my harddisk.
    AutoRun.exe -> copies the files and Starts ApplicaitonRunner.exe
    ApplicationRunner.exe -> starts MyProgram.exe
    MyProgram.exe -> Crashes when qtcore4.dll is tried to be load...
    Thanks.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QtCore4.dll error when starting the program from cd

    And pointers are not destroyed if they have no parents and if you dont delete them or directly the pointer.
    LOL.
    You better read some basic C++ tutorials about pointers.
    The only thing that does not get destroyed in a case of a local pointer is the allocated memory.
    The pointer variable gets destroyed,and in fact causes a memory leak,which will be cleaned up only when the allocating process is destroyed.


    This might not be the cause of your crash, but since you didn't post much code, its hard to say.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #4
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtCore4.dll error when starting the program from cd

    And pointers are not destroyed if they have no parents and if you dont delete them or directly the pointer.

    Hehehe i think you have to read those tutorials(espacially QtAssistan -> QProcess -> Constructor parameters and their meanings) or what i wrote but anyway thanx for your tries. Better if you try to write some basic examples what we are talking about. You can see what i m talking about clearly with that way.

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QtCore4.dll error when starting the program from cd

    Hehehe i think you have to read those tutorials(espacially QtAssistan -> QProcess -> Constructor parameters and their meanings)
    I think that after about 8 year of Qt programming I got the idea.
    It has nothing to do with QProcess but C++ basics, see below:
    Qt Code:
    1. void MyClass::foo()
    2. {
    3. QProcess *pProcess = new QProcess();
    4. .....
    5.  
    6. }
    To copy to clipboard, switch view to plain text mode 
    At the end of foo() the pointer pProcess is destroyed. period.
    And you can't access that instance of QProcess anymore (unless you saved the address in another pointer that lives beyond the scope of foo() such as a member variable.)

    It is well possible that your crash has nothing to do with QProcess, but with some out of scope pointer, but without seeing your code its hard to say.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. #6
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtCore4.dll error when starting the program from cd

    circass, did you deployed a CRT of your compiler (vc_redist for MSVC) ?

  7. #7
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtCore4.dll error when starting the program from cd

    Ok,
    i found the problem. This is what i got:::

    If you are trying to open an external program and if that program uses some extra files for loading then you have to set the working path of that program.

    QProcess->setWorkingDirectory(Program'sDirectory);

    The real problem was a xml file that must be load at the begining of the program. when it couldnt load it gave that rediciolus error QtCore4.dll thing. I was searching for a wrong thing from the begining... Well i solved my problem.
    Thank you for all your efforts.

    Circass

Similar Threads

  1. program compile problem: FT_Select_Size error
    By cooper in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2010, 23:52
  2. Program running error in qtopia 2.2.0
    By halloworld in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 15th February 2009, 09:23
  3. Eclipse Integration and program not starting
    By Cruz in forum Installation and Deployment
    Replies: 1
    Last Post: 16th January 2009, 22:32
  4. some error in my first program
    By rainius in forum Installation and Deployment
    Replies: 5
    Last Post: 11th June 2008, 09:01
  5. Error starting Qt
    By shamik in forum Installation and Deployment
    Replies: 1
    Last Post: 18th April 2007, 12:30

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
  •  
Qt is a trademark of The Qt Company.