+ Reply to Thread
Results 1 to 6 of 6

Thread: Installing Qwt with MSVC-2015 64bit compiler on Windows (complete instructions)

  1. #1
    Join Date
    Jul 2016
    Posts
    57
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Post Installing Qwt with MSVC-2015 64bit compiler on Windows (complete instructions)

    So I've been having a lot of trouble getting it all to work with MSVC 64 compiler, and decided to put these simple steps which could have save me few hours if I knew it before.

    My goal was to be able to plot, I am not interested in neither knobs/sliders nor the QtCreator integration, as a result this manual won't cover it. Just pure plotting capabilities and nothing else. Also, I wanted it to work with MSVC 64, because I build my Qt 64-bit applications with that compiler.

    1) Make sure you have Qt installed with MSVC 2015 64-bit compiler

    2) Go ahead download and install Microsoft Visual Studio Community 2015 to the default path

    3) download the Qwt source zip file, and extract it to: C:\Qwt-6.1.3

    4) Edit the qwtconfig.pri inside the C:\Qwt-6.1.3 folder, specifically, make sure that QWT_INSTALL_PREFIX is loaded in such a way that it points to C:\Qwt-6.1.3 and also comment out the following lines:
    QWT_CONFIG += QwtWidgets
    QWT_CONFIG += QwtDesigner

    5) Next, open the command shell of Qt from the start Menu, Windows START MENU->Qt->5.7->MSVC 2015 (64-bit)->Qt 5.7 64-bit for Desktop (MSVC 2015), you will see the following message:
    Setting up environment for Qt usage...
    Remember to call vcvarsall.bat to complete environment setup!
    6) Now, do the following command: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC and that is the directory where you installed your MSVC Community 2015

    7) Run this command: vcvarsall.bat amd64

    8) Now go to Qwt folder: C:\Qwt-6.1.3

    9) Run this: qmake qwt.pro

    10) now run this: nmake

    11) finally run this: nmake install

    12) Create some simple gui application in QtCreator, so that it only has a main.cpp file, and enter this code (taken from here):
    Qt Code:
    1. #include <qapplication.h>
    2. #include <qwt_plot.h>
    3. #include <qwt_plot_curve.h>
    4. #include <qwt_plot_grid.h>
    5. #include <qwt_symbol.h>
    6. #include <qwt_legend.h>
    7.  
    8. int main( int argc, char **argv )
    9. {
    10. QApplication a( argc, argv );
    11.  
    12. QwtPlot plot;
    13. plot.setTitle( "Plot Demo" );
    14. plot.setCanvasBackground( Qt::white );
    15. plot.setAxisScale( QwtPlot::yLeft, 0.0, 10.0 );
    16. plot.insertLegend( new QwtLegend() );
    17.  
    18. QwtPlotGrid *grid = new QwtPlotGrid();
    19. grid->attach( &plot );
    20.  
    21. QwtPlotCurve *curve = new QwtPlotCurve();
    22. curve->setTitle( "Some Points" );
    23. curve->setPen( Qt::blue, 4 ),
    24. curve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
    25.  
    26. QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
    27. QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 8, 8 ) );
    28. curve->setSymbol( symbol );
    29.  
    30. QPolygonF points;
    31. points << QPointF( 0.0, 4.4 ) << QPointF( 1.0, 3.0 )
    32. << QPointF( 2.0, 4.5 ) << QPointF( 3.0, 6.8 )
    33. << QPointF( 4.0, 7.9 ) << QPointF( 5.0, 7.1 );
    34. curve->setSamples( points );
    35.  
    36. curve->attach( &plot );
    37.  
    38. plot.resize( 600, 400 );
    39. plot.show();
    40.  
    41. return a.exec();
    42. }
    To copy to clipboard, switch view to plain text mode 

    13) in the .pro file of your application include this line: include (C:\Qwt-6.1.3\features\qwt.prf)

    14) run qmake, build and run, it will work now, so this way if you are building 64bit programs with MSVC, they will be able to work with your 64 bit MSVC built Qwt plot libraries.

    NOTES: * Again, I did not need sliders/knobs or QtCreator integration, so I turned it off. If you are also fine with this then this manual is for you
    * pay attention at step #7, you must provide "amd64" argument to that .bat file, in order to make it 64 bit. Let the "amd" word not confuse you (as it did me and I lost some time with this) because even x64 platform also defaults to amd64 in that BAT file.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    2,997
    Thanked 780 Times in 730 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Installing Qwt with MSVC-2015 64bit compiler on Windows (complete instructions)

    Better don't use the same directory for the Qwt source directory and where you install Qwt ( Step 3 and 4 ). It is not necessary and even if it works ( never tried it myself ) it might cause confusion.
    If you are not interested in the source code or the examples you could even remove the source directory from disk after installation - everything you need for your application is in the install directory then.

    When trying to build the designer plugin you often need to build and install Qwt twice ( at different locations ), where your strategy of having the same directory for building and installing can't work anymore.

    In the end the only step, that is not mentioned in the Qwt installation documentation is Step 7 - everything else is individual configuration related, what usually differs for others.

    As I had many, many problems with homebrew installation guides in the past - please always try to understand and follow the official installation guide step by step: http://qwt.sourceforge.net/#installonmainpage

    Uwe

  3. #3
    Join Date
    Jul 2016
    Posts
    57
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Installing Qwt with MSVC-2015 64bit compiler on Windows (complete instructions)

    ok, so the only modification to the manual is, in step #3 extract it to C:\Qwt-6.1.3_src and everything else stays same.

    And step #7 is the most critical thing here which was big part of my confusion and LNKxxxx errors and lost time. Without that step, the Windows->MSVC subsection of the manual here http://qwt.sourceforge.net/qwtinstall.html is incomplete...

  4. #4
    Join Date
    Oct 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Installing Qwt with MSVC-2015 64bit compiler on Windows (complete instructions)

    I'm agree with r2com.
    I install qt-opensource-windows-x86-msvc2015_64-5.8.0 and Visual Studio 2015 on Windows 10. Everything works fine. I compile QT project in Visual Studio.
    When I want to compile qwt-6.1.3 (following the official instructions), I have this error:

    fatal error LNK1112: type d'ordinateur module 'x64' en confilt avec le type d'ordinateur cible 'X86'
    (sorry it's a french version of windows )

    The problem is the same when I add the instruction 7. of r2com. I have the same result.
    When I type 'vcvarsall.bat amd64' in the MSVC path, nothing happens (no files change in the MSVC directory).

    Some one have a solution ?

  5. #5
    Join Date
    Oct 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Installing Qwt with MSVC-2015 64bit compiler on Windows (complete instructions)

    Sorry it's Windows 7 pro and not Windows 10.

  6. #6
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    2,997
    Thanked 780 Times in 730 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Installing Qwt with MSVC-2015 64bit compiler on Windows (complete instructions)

    Looks like a 32 vs. 64 bit incompatibility between libraries needed when linking the application.

    Uwe

+ Reply to Thread

Similar Threads

  1. Replies: 0
    Last Post: 25th January 2016, 02:24
  2. QFileDialog crashes with MSVC 64bit
    By beneR-89 in forum Installation and Deployment
    Replies: 1
    Last Post: 3rd October 2015, 10:28
  3. Replies: 8
    Last Post: 16th February 2011, 05:16
  4. msvc Compiler or mingw compiler
    By Ashutosh2k1 in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2011, 08:33
  5. Replies: 1
    Last Post: 21st September 2010, 08:58

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