Results 1 to 3 of 3

Thread: QT and VISA lib?

  1. #1

    Default QT and VISA lib?

    Hi all,

    I try to control some test equipment with a gpib card. For doing that i try to use visa protocol but i don't success to compil anything. It seems that i don't success to link visa32.lib. It seems to not recognized the .lib extension :
    Qt Code:
    1. C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc\visa32.lib:-1: error: file not recognized: File format not recognized
    To copy to clipboard, switch view to plain text mode 


    Here is my "simple" code :
    Qt Code:
    1. #include <QtGui>
    2. #include <iostream>
    3. #include <windows.h>
    4.  
    5. #include "dial_GPIB.h"
    6.  
    7.  
    8. #include "C:\Program Files\IVI Foundation\VISA\WinNT\include\visa.h"
    9.  
    10.  
    11. void dialogue_GPIB::send_GPIB()
    12. {
    13.  
    14. ViSession defaultRM, vi;
    15. char buf [256] = {0};
    16.  
    17.  
    18. /* Open session to GPIB device at address 22 */
    19.  
    20. viOpenDefaultRM (&defaultRM);
    21.  
    22. viOpen (defaultRM, "GPIB0::22::INSTR", VI_NULL,VI_NULL, &vi);
    23.  
    24. /* Initialize device */
    25. viPrintf (vi, "*RST\n");
    26.  
    27. /* Send an *IDN? string to the device */
    28. viPrintf (vi, "*IDN?\n");
    29.  
    30. /* Read results */
    31. viScanf (vi, "%t", &buf);
    32.  
    33. /* Print results */
    34. printf ("Instrument identification string: %s\n", buf);
    35.  
    36. /* Close session */
    37. viClose (vi);
    38. viClose (defaultRM);
    39. #endif
    40. }
    To copy to clipboard, switch view to plain text mode 

    and here my .pro file
    Qt Code:
    1. ######################################################################
    2. # Automatically generated by qmake (2.01a) jeu. 14. févr. 11:17:30 2008
    3. ######################################################################
    4.  
    5. TEMPLATE = app
    6. TARGET =
    7.  
    8. # Input
    9. HEADERS += dial_GPIB.h
    10. FORMS += dial_GPIB.ui
    11. SOURCES += dial_GPIB.cpp main.cpp
    12.  
    13. win32: LIBS += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc/visa32.lib"
    14.  
    15. INCLUDEPATH += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc"
    16. DEPENDPATH += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc"
    17.  
    18. win32: PRE_TARGETDEPS += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc/visa32.lib"
    To copy to clipboard, switch view to plain text mode 

    anyone can help me?

    thanks

  2. #2
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT and VISA lib?

    Did you ever get a solution to this? - I'm having the same problem with visa32.lib under Qt.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: QT and VISA lib?

    This is not a Qt problem, but there is insufficient information to answer this question definitively anyway. The OP is probably using the MingW toolchain with the Microsoft format library file.

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
  •  
Qt is a trademark of The Qt Company.