How to do LD_LIBRARY_PATH?



  • Guys, i'm lost!
    I need my app running on other's ditro's of linux, and i cant do!
    On the http://doc.qt.io/qt-5/linux-deployment.html#creating-the-application-package the solution is: You can write a startup script for your application, where you modify the dynamic linker configuration (e.g., adding your application's directory to the LD_LIBRARY_PATH environment variable.

    But, how do i do that? I'm really newbie, sorry!
    Please help me!
    Thanks


  • Moderators

    Hi @Lays147,

    Here is a tutorial: http://www.tripleboot.org/?p=138 Scroll down to the Linux section.



  • Didn't work. =/ Another way?


  • Moderators

    @Lays147 said:

    Didn't work. =/ Another way?

    If you want us to help you, you need to:

    1. Describe what you did, and
    2. Show us any error messages you got.

    Anyway, the tutorial already shows you another way: Using RPATH



  • @JKSH The RPATH didn't work because on ubuntu 15.04 the Qt packages don't come default. That tutorial is for previous versions of ubuntu.
    Please, enlighten me then: How to config Qt to develop with Cross-Platform?


  • Moderators

    First, tell us: are you able to run your app on your own computer yet?

    @Lays147 said:

    @JKSH The RPATH didn't work because on ubuntu 15.04 the Qt packages don't come default.

    RPATH doesn't require Ubuntu's default packages.

    When you use RPATH, you copy the shared libraries (for example, libQt5Core.so.5) into your app folder.

    That tutorial is for previous versions of ubuntu.

    That tutorial still works for Ubuntu 15.04.

    Please, enlighten me then: How to config Qt to develop with Cross-Platform?

    "Cross-platform" means you want your app to run on other operating systems. For example, you develop on Linux, and then run your app on Windows. Is this what you want?



  • In this case, is to run in those linux versions: Ubuntu 14.04 LTS, Ubuntu 15.04, Ubuntu 15.10, Fedora, OpenSuse and Debian.
    I already download the open source version of Qt
    I'm make the ./configure with: ./configure -opensource -static -xplatform frebsd-g++ -xplatform linux-g++-64 -xplatform linux-icc-64 -xplatform openbsd-g++ -debug -opengl
    Is that correct?


  • Moderators

    @Lays147 said:

    In this case, is to run in those linux versions: Ubuntu 14.04 LTS, Ubuntu 15.04, Ubuntu 15.10, Fedora, OpenSuse and Debian.
    ...
    I'm make the ./configure with: ./configure -opensource -static -xplatform frebsd-g++ -xplatform linux-g++-64 -xplatform linux-icc-64 -xplatform openbsd-g++ -debug -opengl
    Is that correct?

    No.

    First, FreeBSD and OpenBSD are not Linux.

    Second, you should not configure Qt. Just do this:

    1. Go to http://www.qt.io/download-open-source/
    2. Click "Qt Offline Installer"
    3. Download and install "Qt 5.4.2 for Linux 32-bit (535 MB)"
    4. Open Qt Creator and start coding.
    5. Make sure you can run your app on your own computer.

    After you finish Step #5, come back here to learn how to make your app run on other computers.



  • @JKSH said:

    1. Make sure you can run your app on your own computer.

    After you finish Step #5, come back here to learn how to make your app run on other computers.

    Well, i already start coding. And i already have the qtcreator installed on my computer. I just need my app run in those versions of Linux. And make configure for cross-compile is the way i found on the internet and here. If exists another way, please show me then. Because i cant find in the configure of qtcreator the configure for the app run on those linux. And my app run in the ubuntu vivid at my machine.
    Thanks


  • Moderators

    @Lays147 said:

    And make configure for cross-compile is the way i found on the internet and here.

    Ubuntu, Fedora, OpenSuse and Debian are all Linux, so you do not need to cross-compile your app. (You need to cross-compile if you want to run your app on Windows).

    Because i cant find in the configure of qtcreator the configure for the app run on those linux.

    You do not need to configure anything.

    You need to deploy your app. Follow the tutorial to:

    1. Change your app's RPATH
    2. Copy your app and shared libraries to the other Linux computers.

    That is what you need to do.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.