user3023605
user3023605

Reputation: 459

QCustomPlot in MSVS2012

I succeeded in building a program in visual studio 2012 that runs QT without the plugin. I included the QT include folder and manually added the libraries to the resources. And it compiled and ran.

Now I wanted to use QCustomPlot in the same way, without the QtAddin plugin. I tried multiple projects, where I added QCustomPlot's .h and .cpp and tried to compile, but it gives me tons of linker problems(http://pastebin.com/SWVXktBk). Can someone point me in the right direction?

Windows 7 x64, QT 5.4.1,

Upvotes: 1

Views: 1702

Answers (1)

user3023605
user3023605

Reputation: 459

After hours, I found it. As UldisK pointed, I had to moc the header. I followed everything in here: http://ldmartin68.com/QTSetup4VSNET.html

In windows cmd

moc qcustomplot.h > moc_qcustomplot.cpp

then simply add the generated file to the project, and voila worked. In the end you should have in the project:

  • the original qcustomplot.h
  • the original qcustomplot.cpp
  • the generated moc_qcustomplot.cpp

Upvotes: 1

Related Questions