Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/151.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Mac OSX 10.7.4上编译简单Qwt程序时出错 我试图用QWT V来获得下面的C++程序。6.0.1工作: #include <cmath> #include <QApplication> #include <qwt_plot.h> #include <qwt_plot_curve.h> int main(int argc, char **argv) { QApplication a(argc, argv); QwtPlot plot(QwtText("CppQwtExample1")); plot.setGeometry(0,0,640,400); plot.setAxisScale(QwtPlot::xBottom, 0.0, 2.0*M_PI); plot.setAxisScale(QwtPlot::yLeft, -1.0, 1.0); QwtPlotCurve sine("Sine"); std::vector<double> xs; std::vector<double> ys; for (double x=0; x<2.0*M_PI; x+=(M_PI/10.0)) { xs.push_back(x); ys.push_back(std::sin(x)); } sine.setData(&xs[0], &ys[0], xs.size()); sine.attach(&plot); plot.show(); return a.exec(); }_C++_Osx Lion_Qwt - Fatal编程技术网

在Mac OSX 10.7.4上编译简单Qwt程序时出错 我试图用QWT V来获得下面的C++程序。6.0.1工作: #include <cmath> #include <QApplication> #include <qwt_plot.h> #include <qwt_plot_curve.h> int main(int argc, char **argv) { QApplication a(argc, argv); QwtPlot plot(QwtText("CppQwtExample1")); plot.setGeometry(0,0,640,400); plot.setAxisScale(QwtPlot::xBottom, 0.0, 2.0*M_PI); plot.setAxisScale(QwtPlot::yLeft, -1.0, 1.0); QwtPlotCurve sine("Sine"); std::vector<double> xs; std::vector<double> ys; for (double x=0; x<2.0*M_PI; x+=(M_PI/10.0)) { xs.push_back(x); ys.push_back(std::sin(x)); } sine.setData(&xs[0], &ys[0], xs.size()); sine.attach(&plot); plot.show(); return a.exec(); }

在Mac OSX 10.7.4上编译简单Qwt程序时出错 我试图用QWT V来获得下面的C++程序。6.0.1工作: #include <cmath> #include <QApplication> #include <qwt_plot.h> #include <qwt_plot_curve.h> int main(int argc, char **argv) { QApplication a(argc, argv); QwtPlot plot(QwtText("CppQwtExample1")); plot.setGeometry(0,0,640,400); plot.setAxisScale(QwtPlot::xBottom, 0.0, 2.0*M_PI); plot.setAxisScale(QwtPlot::yLeft, -1.0, 1.0); QwtPlotCurve sine("Sine"); std::vector<double> xs; std::vector<double> ys; for (double x=0; x<2.0*M_PI; x+=(M_PI/10.0)) { xs.push_back(x); ys.push_back(std::sin(x)); } sine.setData(&xs[0], &ys[0], xs.size()); sine.attach(&plot); plot.show(); return a.exec(); },c++,osx-lion,qwt,C++,Osx Lion,Qwt,然而,当我现在试着去做的时候 克马克 制造 我得到一个错误: ld:找不到-lqwt的库 collect2:ld返回了1个退出状态 make:[qwtTest.app/Contents/MacOS/qwtTest]错误1 我肯定错过了一些东西。非常感谢您的帮助 LIBS += -L/usr/local/qwt-6.0.1/lib/qwt.framework/Versions/6/ -lqwt 这是错误的。由于Mac OS X框架的命名约定,qwt.framework中的动态库没有命名为“lib

然而,当我现在试着去做的时候

克马克

制造

我得到一个错误:

ld:找不到-lqwt的库 collect2:ld返回了1个退出状态 make:[qwtTest.app/Contents/MacOS/qwtTest]错误1

我肯定错过了一些东西。非常感谢您的帮助

LIBS += -L/usr/local/qwt-6.0.1/lib/qwt.framework/Versions/6/ -lqwt
这是错误的。由于Mac OS X框架的命名约定,qwt.framework中的动态库没有命名为“libqwt.dylib”(链接器需要),而是简单地命名为“qwt”。 使用


相反。

谢谢!这似乎奏效了。我现在可以编译程序了,没有任何错误。但是,现在当我尝试打开生成的应用程序时,会收到一条Dyld错误消息:库未加载:qwt.framework/Versions/6/qwtReferenced from:/Users/USER/*/qwtTest.app/Contents/MacOS/qwtTest原因:image not foundOk,通过对的讨论,我通过使用软链接成功地消除了错误:sudo ln-s/usr/local/qwt-6.0.1/lib/qwt.framework/qwt/usr/lib/qwt。由于某种原因,程序仍然崩溃,但至少我没有发现任何关于无法找到或加载的库的错误。酷吧。很高兴我能帮助你。
LIBS += -L/usr/local/qwt-6.0.1/lib/qwt.framework/Versions/6/ -lqwt
LIBS += -F/usr/local/qwt-6.0.1/lib -framework qwt