Results 1 to 2 of 2

Thread: QProcess on linux - problem with shared libraries

  1. #1
    Join Date
    Oct 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QProcess on linux - problem with shared libraries

    Hi. I`ve written this code :

    Qt Code:
    1. QProcess *myProcess = new QProcess();
    2.  
    3. QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
    4.  
    5. env.insert("LD_LIBRARY_PATH", "/home/khoros2200/lib");
    6.  
    7. myProcess->setProcessEnvironment(env);
    8.  
    9. myProcess->execute("/home/khoros2200/bin/karith1")
    To copy to clipboard, switch view to plain text mode 
    ;

    and i have this error :

    /home/khoros2200/bin/karith1: error while loading shared libraries: libkdmanip.so: cannot open shared object file: No such file or directory

    when I execute the program in console , it works properly . When I unset the LD_LIBRARY_PATH variable I get the same mistake as in Qt Creator. So what`s the problem ? Why is QProcess doesn`t see envioronment variables ?

  2. #2
    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: QProcess on linux - problem with shared libraries

    QProcess::execute() is a static call so it ignores whatever you do with the QProcess object. Use QProcess::start() instead.
    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.


Similar Threads

  1. Replies: 10
    Last Post: 20th December 2015, 11:14
  2. Qt linguist and qt shared libraries
    By webquinty in forum Qt Tools
    Replies: 0
    Last Post: 15th July 2010, 09:44
  3. Application with shared library problem in linux
    By cutie.monkey in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2010, 07:20
  4. Deployment (shared libraries)
    By amagdy.ibrahim in forum Qt Programming
    Replies: 5
    Last Post: 26th June 2008, 21:55
  5. exception in shared libraries
    By big4mil in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2006, 19:51

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.