QRCodeSignature类不允许记录语句
QRCodeSignature class does not allow logging statements
我有一个QRCode Signature类,我想放入日志记录语句,我从构造函数部分开始,如下所示:
QRCodeSignature::QRCodeSignature(std::vector<WacomType::PEN>* theSigpoints, int theInterval, int theVersion) : sigpoints(theSigpoints), interval(theInterval), version(theVersion) {
Logging::log(QRCodeSignature::logger, Logging::Entry, QRCodeSignature::CLASSNAME, "QRCodeSignature");
我在QRCodeSignature.cpp中有以下内容,包括
#include "QRCodeSignature.h"
#include <iostream>
#include <cstdlib>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
在QRCodeSignature.h中,我得到了以下类作为QRCodeSignature
a constructor
a virtual destructor
private:
static const std::string CLASSNAME;
static Logging::Logger* logger;
在QRCodeSignature.cpp中,我有
const std::string CLASSNAME = "QRCodeSignature";
Logging::logger* QRCodeSignature::logger = NULL;
当我建立这个项目时的错误〔发布〕
build/Release/MinGW_1-Windows/QRCodeSignature.o: In function `QRCodeSignature':
C:reposimpressiontrunkProsenseSign/QRCodeSignature.cpp:13: undefined reference to `QRCodeSignature::CLASSNAME'
collect2: ld returned 1 exit status
make[2]: *** [dist/Release/MinGW_1-Windows/impression.api] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
您应该使用
const std::string QRCodeSignature::CLASSNAME = "QRCodeSignature";
而不是
const std::string CLASSNAME = "QRCodeSignature";
因为第二个不是类的CCD_ 1的初始化。
相关文章:
- 我的简单if-else语句是如何无法访问的代码
- 有一个打印语句的函数是一种糟糕的编程实践吗
- 线程,如果else语句,都是错误的上下文切换后,会发生什么
- 为什么是0;C++中的有效语句
- 将两个数组中的差异记录在第三个数组中
- Insert函数不适用于2 if语句C++
- If语句未被求值C++
- C++嵌套if语句,基本货币交换
- 多个If语句与使用逻辑运算符计算条件的单个语句的比较
- 是否可以使用if constexpr删除控制流语句
- 无法理解此 return 语句的功能,没有它就会发生运行时错误
- 我似乎对if/else的基本语句有问题:/
- 当调用switch语句中的函数时(即使函数不包含循环),似乎是永不结束的循环的问题
- C++-根据级别记录语句
- QRCodeSignature类不允许记录语句
- Boost.Log在每个日志记录语句之后刷新
- 如何在 android L 上加载 OpenCV 时删除日志记录语句
- 为什么我的 read 语句不记录二进制数据
- 一个方便的C++日志记录语句,使用boost::格式
- Log4cxx日志记录语句挂起