我很难使用 NCReport 库打印报告
i got hard to print report using NCReport library
所以还有另一种用于打印的 esay 解决方案
so there an other esay solution for printing
当我想使用 qt 4.8.5 和 ncreport 引擎编译我的程序时总是出错
i always got errors when i want to compiler my programme using qt 4.8.5 and ncreport engine
她是错误
C:\test\build-Ncreport-Qt_4_8_5_MinGW_32_bit-Debug\debug\mainwindow.o:-1: In function `MainWindow': C:\test\Ncreport\mainwindow.cpp:12: erreur : undefined reference to `_imp___ZN8NCReportC1EP7QObject' C:\test\Ncreport\mainwindow.cpp:13: erreur : undefined reference to `_imp___ZN8NCReport5resetEb' C:\test\Ncreport\mainwindow.cpp:14: erreur : undefined reference to `_imp___ZN8NCReport13setReportFileERK7QString' C:\test\Ncreport\mainwindow.cpp:15: erreur : undefined reference to `_imp___ZN8NCReport18runReportToPrinterEibP7QWidgetRK7QString' C:\test\Ncreport\mainwindow.cpp:12: erreur : undefined reference to `_imp___ZN8NCReportC1EP7QObject' C:\test\Ncreport\mainwindow.cpp:13: erreur : undefined reference to `_imp___ZN8NCReport5resetEb' C:\test\Ncreport\mainwindow.cpp:14: erreur : undefined reference to `_imp___ZN8NCReport13setReportFileERK7QString' C:\test\Ncreport\mainwindow.cpp:14: erreur : undefined reference to `_imp___ZN8NCReport13setReportFileERK7QString' C:\test\Ncreport\mainwindow.cpp:15: erreur : undefined reference to `_imp___ZN8NCReport18runReportToPrinterEibP7QWidgetRK7QString' :-1: erreur : collect2: ld returned 1 exit status 推荐答案您需要在 qmake 中使用以下内容:
You need to use the following with qmake:
LIBS += -L C:/test/Ncreport/lib -lNCReport2其中 libNCReport2.a 将是 ncreport 库的名称,即您不需要使用lib"前缀,也不需要使用.a"扩展名.
where libNCReport2.a will be the name of the ncreport library, i.e. you do not need to use the "lib" prefix, nor the ".a" extension.
如果这对未定义的符号仍然没有帮助,您需要深入研究静态库是否存在您尝试在应用程序中使用的符号,即您的应用程序是否与他们为您提供的 NociSoft 软件.
If that still does not help with the undefined symbols, you need to go down the way to actually look into the static library whether the symbols are present that you are trying to use in your application, i.e. whether your application is compatible with the NociSoft software they provided for you.
您可以使用 mingw 检查符号,因为它默认安装了nm"二进制文件.如果符号不存在,您将需要从 NociSoft 获取兼容版本,或者您需要在您的应用程序中使用您拥有的库.
You can check the symbols with mingw since it has the 'nm' binary installed by default. If the symbols are not present, you will either need to grab the compatible version from NociSoft, or you need to comply in your application with the library you have.
更多推荐
免费且简单的 Qt 5.1.0 或 Qt 4.8.5 报告引擎
发布评论