Results 1 to 2 of 2

Thread: Problems with paths

  1. #1
    Join Date
    Jan 2007
    Posts
    95
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Problems with paths

    Hi all.
    I have a problem to know where is the application path in windows and linux. As you know in windows, when you install your application you put all files in the same path (if you want, this is what i do):
    c:/program files/myapp/execfile.exe
    c:/program files/myapp/datafile.dat
    and when I run my program (execfile.exe) I use something like this myapppath=app.applicationdirpath() to know where the program have been installed and call the data file mydatafile=myapppath+"/datafile.dat". This works fine.
    But I have a problem in linux. When I copy the application, p.e., /home/david/apppath/, do a make to compile the application, but if i do a "make install", the exec file is copied to the /usr/local/bin/ directory (for example), and when I run the program from anywhere, the application cannot find the data file. I know that this is due to the appfile is in a directory (/usr/local/bin or other) and the data file is in other directory (for example /home/david/apppath).
    What can I do?
    Is there a way to know in linux where is the application and where have been installed the application? (if i use applicationdirpath() function i get the path where have been executed the program)

    Thanks in advanced and I hope you understand my problem.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Problems with paths

    No, there is no relation between an installed binary and the source directory. Perhaps you should consider installing the data file as well... See qmake variable reference - INSTALLS for more details.
    J-P Nurmi

Similar Threads

  1. problems installing Qt opensource with msvc2008 support
    By odin1985 in forum Installation and Deployment
    Replies: 6
    Last Post: 24th May 2008, 09:06
  2. flicker and wierd resize problems ...
    By momesana in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2008, 18:00
  3. Problems with QTextEdit::cursorRect()
    By elcuco in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2008, 10:34
  4. Replies: 2
    Last Post: 8th March 2007, 22:22
  5. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39

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.