Cannot generate .so file for application deployment on linux us



  • I am trying to recompile then deploy the \Qt\2010.04\qt\examples\tools\plugandpaint application onto a unix os machine following the below link but get an error. I am using the shared library but can't for the life of me find any .so file. Please help.

    "http://doc.qt.nokia.com/4.5/deployment-x11.html#building-qt-statically":http://doc.qt.nokia.com/4.5/deployment-x11.html#building-qt-statically

    [edit: fixed link / chetankjain]



  • I think you are mixing different things...

    Is there any error message to help us to understand what is happening?



  • Hi anselmolsm,

    Thanks for the response. To back track a little bit, I downloaded Qt 2010.04, installed the SDK and rebuilt Qt as a Shared Library by doing the following at the command prompt:

    cd /path/to/Qt
    ./configure -shared
    mingw32-make

    I then followed the instruction in the link I provided above to try to recompile the project linking to the shared Qt library.

    cd /path/to/Qt/examples/tools/plugandpaint Now run qmake to create a new makefile for the application, and do a clean build to create the dynamically linked executable:

    make clean
    qmake -config release
    make

    This builds the core application, the following will build the plugins:

    cd ../plugandpaintplugins
    make clean
    qmake -config release

    Everything compiled fine and the plug and paint application generates an executatble that runs on my Windows machine. However, based on the document, a couple of .so files are suppose to be generated but isn't.

    "If everything compiled and linked without any errors, we will get a plugandpaint executable and the libpnp_basictools.so and libpnp_extrafilters.so plugin files."

    I can see that my pc contains libpnp_basictools.a file and libpnp_extrafilters.a file. Are these file the same?

    Please help me if you have any insight what is going on. My goal is to be able to run the application (.exe) on an X11 virtual machine, once I move all the .so files, and my Qt shared lib to a linux machine. (according to the link provided)

    thank you!



  • Ok, now I see you are following the shared library section (the link you sent points to the static link section =). However, I think I'm still confused =/

    Well, you are building stuff on Windows, right? Then the executable that runs on your Windows (a .exe) use a couple of .dll plugins generated in your build.

    To build on Windows an executable to run on Linux, you need a compiler that can generate Linux binaries/libraries, you won't be able to run the same .exe file in a different OS. Same for the shared libraries, so that's why you don't see any .so (Linux shared libraries).

    .a files are for static linking on Unix/Linux systems. Weird, how did you build them? Do you have this compiler I mentioned before? - IIRC, static libs on Windows are .lib files.

    I have already done the opposite way (build on Linux, run on Windows), I guess the process is not that different.



  • Hi anselmolsm,

    1. Sorry for posting the wrong link. :-)
    2. Yes, I am following the shared library section and is building stuff on Windows.
    3. I do have the .exe file in my release folder but in the plugins directory, I only have .dll files and .a files.
    4. I initially build the Qt library as a static library. But then the application contains plugins thus I had to rebuild it as shared because "we cannot deploy plugins using the static linking". I build them by using :

    configure -shared
    mingw32-make

    1. My Qt\bin folder has some .exe, some .bat, and alot of .dll file. The Qt\lib folder has a whole bunch of .a, .dll, and .prl files.

    Am I suppose to do anything else to generate the .so file?

    Note: as i mentioned before, I am using the 2010.04 archive version I downloaded from the web. Should I download the current release 2010.05?

    Thanks!
    -Tien



  • I forgot to answer one of your question. No, I do not have the IIRC compiler. I searched for "IIRC" in the Qt directory that resulted in no findings.



  • Hi anselmolsm,

    I am reading your response and I think I overlooked something that I might need you to elaborate on. You have indicated that "To build on Windows an executable to run on Linux, you need a compiler that can generate Linux binaries/libraries, you won’t be able to run the same .exe file in a different OS. Same for the shared libraries, so that’s why you don’t see any .so (Linux shared libraries)."

    Does this mean that in order for me to run an application on Window's, it needs to be built on a Window's machine with Qt on it and if I wanted it to run the same application on an X11 machine, I would have to rebuild the same application on an X11 machine?

    Is there a "simple" way to integrate a linux compiler on a Window's machine so that I can build the application "targeted" for a Linux machine on Window's?

    Thanks!

    • Tien


  • Hey phamtv,

    [quote author="phamtv" date="1285252252"]I forgot to answer one of your question. No, I do not have the IIRC compiler. I searched for "IIRC" in the Qt directory that resulted in no findings.[/quote]

    IIRC = "If i remember correctly" =)

    [quote author="phamtv" date="1285255512"]
    Does this mean that in order for me to run an application on Window's, it needs to be built on a Window's machine with Qt on it and if I wanted it to run the same application on an X11 machine, I would have to rebuild the same application on an X11 machine?
    [/quote]

    No exactly. The thing you seem to not get is that each operating system use a different binary format for executable files and shared libraries. So, .exe file will not run on Linux, an ELF file won't run on Windows. However, you can generate a binary to run in other OS, it's a matter of setting a proper compiler to do this task.

    In you case, you need a Windows compiler that knows how to build Linux binaries/libs.

    [quote author="phamtv" date="1285255512"]
    Is there a "simple" way to integrate a linux compiler on a Window's machine so that I can build the application "targeted" for a Linux machine on Window's?
    [/quote]

    I already tried the opposite way: Using a compiler running on Linux to build Windows binaries, I think you can easily find a guide of how to do it on the web.

    Ah, remember: It is not a Qt specific thing. Using a 'cross-compiler' to build a binary to another OS is framework independent. It can work for pure C applications, for instance.


Log in to reply
 

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