0

我很难使用 NCReport 库打印报告

所以还有其他印刷解决方案

当我想使用 qt 4.8.5 和 ncreport 引擎编译我的程序时,我总是遇到错误

她是错误的

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
4

2 回答 2

0

您需要在 qmake 中使用以下内容:

LIBS += -L C:/test/Ncreport/lib -lNCReport2

其中libNCReport2.a将是 ncreport 库的名称,即您不需要使用“lib”前缀,也不需要使用“.a”扩展名。

如果这对未定义的符号仍然没有帮助,您需要深入了解静态库是否存在您尝试在应用程序中使用的符号,即您的应用程序是否与 NociSoft 软件兼容他们为您提供。

您可以使用 mingw 检查符号,因为它默认安装了“nm”二进制文件。如果符号不存在,您将需要从 NociSoft 获取兼容版本,或者您需要在您的应用程序中使用您拥有的库。

于 2013-09-12T20:46:43.307 回答
0

QtRPT 和 QtRptDesigner

QtRPT 是使用 C++ QtToolkit 编写的易于使用的打印报告引擎。它允许将多个报告合并到一个 XML 文件中。对于单独获取的字段,您可以指定一些条件,具体取决于该字段将显示为不同的字体和背景颜色等。该项目由两部分组成:报表库QtRPT和报表设计器应用程序QtRptDesigner。报告文件是 XML 格式的文件。报表设计器可以轻松创建报表 XML 文件。感谢 Qt 库,我们的项目可以在 Windows、Linux、MacOS 操作系统的程序中使用

http://qtrpt.sourceforge.net/

于 2015-03-15T12:41:48.890 回答