Log pattern problem

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
csmeso
Posts: 15
Joined: Mon, 2006-06-19, 15:21

Log pattern problem

#1 Post by csmeso » Sun, 2017-10-08, 11:07

I try to use a custom pattern for file logging:

Code: Select all

	const char *pattern = "%D{%Y-%m-%d %H:%M:%S.%q} %5p: %m%n";
	OFunique_ptr<dcmtk::log4cplus::Layout> layout(new dcmtk::log4cplus::PatternLayout(pattern));
			logfile->setLayout(OFmove(layout));
//...
	dcmtk::log4cplus::SharedAppenderPtr logfile(new dcmtk::log4cplus::DailyRollingFileAppender(
			strPath,					// file to write log to
			dcmtk::log4cplus::DAILY,	// one log file per day
			false,						// do not flush on each log entry for faster processing
			30							// keep 30 backup files
			));
	logfile->setLayout(OFmove(layout));
I get the following Linker error:

Code: Select all

error LNK2001: Nicht aufgelöstes externes Symbol ""private: __thiscall OFunique_ptr<class dcmtk::log4cplus::Layout>::OFunique_ptr<class dcmtk::log4cplus::Layout>(class OFunique_ptr<class dcmtk::log4cplus::Layout> const &)" (??0?$OFunique_ptr@VLayout@log4cplus@dcmtk@@@@$$FAAE@ABV0@@Z)".
1>D:\Develop\IBox\IBoxTouch\trunk\Release\libDICOM.dll : fatal error LNK1120: 1 nicht aufgelöste Externe
the error disappears when I remove the last line (logfile->setLayout(OFmove(layout)).
What's wrong?

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest