Results 1 to 3 of 3

Thread: Starting a second executable using system( )

  1. #1
    Join Date
    Apr 2017
    Posts
    53
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Starting a second executable using system( )

    I am on RHEL6 Linux QT4.8 QtCreator 2.8.1. My system call is as follows:

    system ( "/home/mydir/build-FlashRad-Desktop-Debug/FlashRad ");

    FlashRad is the executable

    From a command line When I cd into /home/mydir/build-FlashRad-Desktop-Debug and type ./FlashRad it runs the app.

    But from the calling app I get the error that the director/file does not exist.

    Is my system syntax wrong? Thanks for any help

    emp1953

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,521
    Thanked 278 Times in 273 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Starting a second executable using system( )

    What happens when you do from the command line : /home/mydir/build-FlashRad-Desktop-Debug/FlashRad without cd ?

  3. #3
    Join Date
    Apr 2017
    Posts
    53
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Starting a second executable using system( )

    Quote Originally Posted by Lesiok View Post
    What happens when you do from the command line : /home/mydir/build-FlashRad-Desktop-Debug/FlashRad without cd ?
    starting out in my home directory it runs the app without errors. I can cd to any directory and type in /home/mydir/build-FlashRad-Desktop-Debug/FlashRad and again
    it runs the app without errors.

    I even created a script file that cd's to the correct directory then tries to run with ./FlashRad

    The error now says that my script cannot be found.
    But its there and I can executed it from the command line. All permissions are wide open 777


    Added after 6 minutes:


    Ok, I got it to work but I don't know why. I built the FlashRad project from the command line so that the project executable was placed in the FlashRad project directory. When building/running from qtCreator it puts the executable in the build-FlashRad..... directory. If I run from the executable in the project directory all works as expected and the app in the system call starts up, but if I run from the build directory it does not work as expected.
    Last edited by emp1953; 23rd March 2020 at 18:27.

Similar Threads

  1. Qftp folder download from remote system to host system
    By iravi89 in forum Qt Programming
    Replies: 1
    Last Post: 21st September 2016, 21:07
  2. Replies: 2
    Last Post: 3rd November 2015, 10:38
  3. Replies: 10
    Last Post: 7th May 2015, 11:38
  4. Replies: 8
    Last Post: 21st March 2011, 13:40
  5. Starting with QML
    By MTK358 in forum Newbie
    Replies: 5
    Last Post: 3rd October 2010, 14:36

Tags for this Thread

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.