Qextserialport problem



  • Hello everyboby,
    I developed an application in Qt using Qt Creator, which use the library "qextserialport".
    This application was developed in Windows XP and it works.

    Now I need to run this application on linux.
    After the Qt Creator installation under linux (Ubuntu 10.04 LTS) I copied my project in linux PC and I tryed to compile it, but It didn't work.
    When I tried to compile that appliation under linux I found this error:

    undefined reference to 'QextSerialPort::QextSerialPort(QString const&)'

    I think I have some problem to link the "qextserialport" library.

    In the follow you can find the sections of the .pro file relative to the "qextserialport" library
    N.B. files for the "qextserialport" library are into the ./COM directory

    @
    INCLUDEPATH += ./COM

    QMAKE_LIBDIR += ../COM

    LIBS += -lqextserialport

    unix:DEFINES = TTY_POSIX
    win32:DEFINES = TTY_WIN
    QWT_DLL
    QT_DLL
    @

    Could someone help me?
    Thanks in advance.

    Gio



  • Hi,

    Can you try this:

    If the qextserialport shared libraries (.so) are in ~/PATH/TO/DIRECTORY/COM

    Open a Terminal and write:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/PATH/TO/DIRECTORY/COM/

    You should write the absolute path, not relative.

    Then,.. maybe you could execute the application.

    (Sorry if my english is poor).

    ¡Good luck!
    Jacobo.



  • If you need to confirm the path, you can show the content of LD_LIBRARY_PATH doing:

    echo $LD_LIBRARY_PATH

    [quote author="jacobodeharo" date="1326901533"]Hi,

    Can you try this:

    If the qextserialport shared libraries (.so) are in ~/PATH/TO/DIRECTORY/COM

    Open a Terminal and write:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/PATH/TO/DIRECTORY/COM/

    You should write the absolute path, not relative.

    Then,.. maybe you could execute the application.

    (Sorry if my english is poor).

    ¡Good luck!
    Jacobo.[/quote]



  • LIBS += -L/path/where/libextserialport/is -lqextserialport



  • and don't forget, linux is case sensitive! libextserialport.so != libExtSerialPort.so



  • Thanks a lot for reply.

    My qextserialport directory has the path:
    /home/QtProjects/Testqserialport/COM

    and contains the following files:

    -libqextserialport.a

    -libqextserialport.dylib

    -posix_qextserialport.h

    -qextserialbase.h

    -qextserialport.dll

    -qextserialport.h

    -win_qextserialport.h

    so that:

    jacobodeharo: I'd like to do what you told me, but I don't have any file .so.

    AcerExtensa: I add the path in the way you told me, so that the .pro file became:

    @INCLUDEPATH += ./COM

    QMAKE_LIBDIR += ../COM

    LIBS += -L/home/QtProjects/Testqserialport/COM -lqextserialport

    unix:DEFINES = TTY_POSIX

    win32:DEFINES = TTY_WIN
    QWT_DLL
    QT_DLL@

    But nothing change.

    I have the same error:

    undefined reference to ‘QextSerialPort::QextSerialPort(QString const&)'

    any other help?

    Thanks!



  • I think that you need to compile the project qextSerialPort in ubuntu. If you do that, you will make the .so shared libraries. Have you got the sources?

    You can get the sources here:

    http://code.google.com/p/qextserialport/source/checkout

    Then open the .pro file in QtCreator and compile.

    Good luck!
    Jacobo.



  • Did you qmaked(regenerated Makefile) Project after you have edited .pro file? Take a look in Makefile, -L path & -l name should be on the LIBS line... and try to compile project from console with make... take a look what the compiler says... and post the output here. maybe the library is just broken...



  • Guys,
    read "this":http://developer.qt.nokia.com/forums/viewreply/67246/.

    Perhaps you change your mind and take another library.


Log in to reply
 

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