Results 1 to 2 of 2

Thread: QextSerialPort installation on Win7 fails (Linker errors)

  1. #1
    Join Date
    Oct 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QextSerialPort installation on Win7 fails (Linker errors)

    Hi, I use Qt 4.7.4 on Win7 with Visual Studio 2010(64bit).

    I wanted to install QextSerialPort as static library, and I followed the instructions here.
    It says:
    Usage(3):Shared or Static Library Without Installation

    If I don't want to install the library to my system. How should I do?

    It's easy too. ;-)

    1. 【Config】 Write a config.pri file.(read config_example.pri for reference):

    shared library
    static library

    2. 【Build】 Changed to subdirectory buildlib, run

    Qt Code:
    1. qmake
    2. make
    To copy to clipboard, switch view to plain text mode 

    shared or static library will be generated.

    3. 【Usage】 Add following line to your qmake project file:

    Qt Code:
    1. # xxxx.pro
    2. include(pathToPri/qextserialport.pri)
    To copy to clipboard, switch view to plain text mode 
    My question: What did I do wrong when I did the following:
    And yet another thing: Is it possible that I have to install certain drivers before I install QextSerialPort ?

    So I started with the config.pri file.
    It now looks like this:
    Qt Code:
    1. # This is an example config.pri for building and using qextserialport.
    2. #
    3. # When using the qextserialport, all you need is to add following line
    4. # in your .pro file:
    5. # include(pathToQextserialport/src/qextserialport.pri)
    6. #
    7. # uncomment the following line if you want to use qextserialport as library
    8. QEXTSERIALPORT_LIBRARY = yes
    9.  
    10. # uncomment the following line too if you want to use it as static library
    11. QEXTSERIALPORT_STATIC = yes
    12.  
    13. # comment following line if you always want to enable "udev" under linux
    14. # QEXTSERIALPORT_WITH_UDEV = yes
    To copy to clipboard, switch view to plain text mode 

    I run qmake in the buildlib directory, then nmake. (I copied qmake.exe in that folder, then worked with Visual Studio Command Prompt x64. I guess this is not the usual way to do this?)
    Anyway, it did its job without errors.
    Then I edited my .pro file to look like this:
    (I added include(QExtSerialPort/src/qextserialport.pri))
    Qt Code:
    1. #Schnarchdaten_Reader
    2. #--------------------------------------------------
    3.  
    4. TEMPLATE = app
    5. CONFIG += qt
    6. QT += core gui
    7.  
    8. #--------------------------------------------------
    9.  
    10. HEADERS += schnarchdaten_reader.h\
    11. datentyp.h\
    12. Buffer.h\
    13. qcustomplot.h
    14.  
    15. #--------------------------------------------------
    16.  
    17. SOURCES += main.cpp\
    18. schnarchdaten_reader.cpp\
    19. Datentyp.cpp\
    20. Buffer.cpp\
    21. qcustomplot.cpp
    22.  
    23. #--------------------------------------------------
    24.  
    25. include(QExtSerialPort/src/qextserialport.pri)
    26.  
    27. #--------------------------------------------------
    28.  
    29. FORMS += schnarchdaten_reader.ui
    30.  
    31. #--------------------------------------------------
    32.  
    33. TARGET = Schnarchdaten_Reader
    34.  
    35. #--------------------------------------------------
    To copy to clipboard, switch view to plain text mode 

    Now I create a new project in Visual Studio by Qt->Open .pro-file
    My new project is being put together.
    But when I try to Compile and Run, I get that weird message "error LNK1104: File"\.obj" can't be opened."

    Though, the QextSerialPort class is getting recognized and I can use it to create objects and use functions.

    I tried to change my .pro modification to include(Schnarchdaten_Reader/QExtSerialPort/src/qextserialport.pri)
    I think this is wrong, because my projects directory is: like this:
    Schnarchdaten_Reader
    .pro file
    QExtSerialPort
    folders and files of QExtSerialPort

    But: After doing the same stuff as described above I can at least start the project, but as soon as I make a new QextSerialPort Object I get Linker errors refering to QextSerialPort.

    Which would be the right setting for that?

    I have spent the whole day trying to fix that, so any help/guess/hint is highly appreciated.

    Sorry for the long post and thank you very much for reading it!

    Greetings
    sHs

  2. #2
    Join Date
    Oct 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QextSerialPort installation on Win7 fails (Linker errors)

    #SOLVED: I was clueless about the fact that you need to copy the generated .libs to your QT.DIRECTORY/lib
    It was obvious that something couldnt be found, so yeah. Thats important ... =/

Similar Threads

  1. Linker errors Phonon lib
    By tcampos in forum Qt Programming
    Replies: 2
    Last Post: 3rd May 2012, 17:43
  2. Configure with minGW fails on Win7 x64
    By Lenich in forum Installation and Deployment
    Replies: 1
    Last Post: 27th September 2010, 09:24
  3. please help with linker errors
    By jimboqt in forum Qt Programming
    Replies: 1
    Last Post: 5th July 2007, 09:49
  4. Linker errors!!
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2006, 08:14
  5. Linker Errors
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 7th March 2006, 18:30

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.