在Windows上与Witty(Wt)和Mingw64链接

时间:2019-04-13 18:07:06

标签: windows cmd mingw-w64 msys wt

在Windows cmd和/或msys上的MingW64上使用Wt库进行编译时,我似乎遇到链接器问题。未定义对Wt:: ..的引用。有什么建议吗?

使用msys shell,我编译了boost_1_69_0和wt4.0.5并在其他libwt.a和libwthttp.a中生成了lib。我将这些库移动到一个目录中,因为它们分散在不同的目录中。

我的hello.cc是来自:https://www.webtoolkit.eu/wt/doc/tutorial/wt.html

的简单程序

我正在尝试按以下方式构建它:

> g++ -std=c++14 -IC:/.../boost_1_69_0/include -LC:/.../boost_1_69_0/lib -IC:/.../wt4msys -IC:/.../wt4msys/src -LC:/.../wt4msys/lib -lwt -lwthttp hello.cc

但是我得到了以下大错误堆栈

C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x3c): undefined reference to `Wt::operator+(char const*, Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x49): undefined reference to `Wt::WText::setText(Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x56): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x64): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x92): undefined reference to `Wt::WApplication::WApplication(Wt::WEnvironment const&, Wt::WtLibVersion)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0xbb): undefined reference to `Wt::WString::WString(char const*, Wt::CharEncoding)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0xcb): undefined reference to `Wt::WApplication::setTitle(Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0xd8): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x206): undefined reference to `Wt::WInteractWidget::clicked()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x229): undefined reference to `Wt::Signals::Impl::Connection::~Connection()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x237): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x28b): undefined reference to `Wt::WApplication::~WApplication()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x303): undefined reference to `Wt::WRun(int, char**, std::function<std::unique_ptr<Wt::WApplication, std::default_delete<Wt::WApplication> > (Wt::WEnvironment const&)>)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text+0x347): undefined reference to `Wt::EventSignalBase::exposeSignal()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x26): undefined reference to `Wt::WString::WString(char const*, Wt::CharEncoding)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x44): undefined reference to `Wt::WText::WText(Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x5f): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJRA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x83): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt9WLineEditEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt9WLineEditEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x19): undefined reference to `Wt::WLineEdit::WLineEdit()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x26): undefined reference to `Wt::WString::WString(char const*, Wt::CharEncoding)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x44): undefined reference to `Wt::WPushButton::WPushButton(Wt::WString const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x5f): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt11WPushButtonEJRA10_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x83): undefined reference to `Wt::WString::~WString()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt6WBreakEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt6WBreakEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x19): undefined reference to `Wt::WBreak::WBreak()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZSt11make_uniqueIN2Wt5WTextEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[__ZSt11make_uniqueIN2Wt5WTextEJEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x19): undefined reference to `Wt::WText::WText()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZN16HelloApplicationD1Ev[__ZN16HelloApplicationD1Ev]+0x19): undefined reference to `Wt::WApplication::~WApplication()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLink10add_beforeEOSt8functionIFvS3_EEPKNS_4Core10observableE[__ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLink10add_beforeEOSt8functionIFvS3_EEPKNS_4Core10observableE]+0x67): undefined reference to `Wt::Signals::Impl::SignalLinkBase::connect(Wt::Core::observable const*)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLinkC1Ev[__ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLinkC1Ev]+0x16): undefined reference to `Wt::Signals::Impl::SignalLinkBase::SignalLinkBase(void (*)(Wt::Signals::Impl::SignalLinkBase*))'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.text$_ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLinkD1Ev[__ZN2Wt7Signals4Impl11ProtoSignalIJNS_11WMouseEventEEE10SignalLinkD1Ev]+0x42): undefined reference to `Wt::Signals::Impl::SignalLinkBase::~SignalLinkBase()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x10): undefined reference to `Wt::WObject::id[abi:cxx11]() const'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x14): undefined reference to `Wt::WObject::setObjectName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x18): undefined reference to `Wt::WObject::objectName[abi:cxx11]() const'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x1c): undefined reference to `Wt::WObject::signalConnectionsChanged()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x20): undefined reference to `Wt::WObject::setFormData(Wt::WObject::FormData const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x24): undefined reference to `Wt::WObject::setRequestTooLarge(long long)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x28): undefined reference to `Wt::WObject::getStateless(void (Wt::WObject::*)())'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x2c): undefined reference to `Wt::WApplication::refresh()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x30): undefined reference to `Wt::WApplication::makeAbsoluteUrl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x34): undefined reference to `Wt::WApplication::waitForEvent()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x38): undefined reference to `Wt::WApplication::initialize()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x3c): undefined reference to `Wt::WApplication::finalize()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x40): undefined reference to `Wt::WApplication::notify(Wt::WEvent const&)'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x44): undefined reference to `Wt::WApplication::isExposed(Wt::WWidget*) const'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x48): undefined reference to `Wt::WApplication::enableAjax()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x4c): undefined reference to `Wt::WApplication::unload()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x50): undefined reference to `Wt::WApplication::idleTimeout()'
C:\...\AppData\Local\Temp\ccf7lOkh.o:hello.cc:(.rdata$_ZTV16HelloApplication[__ZTV16HelloApplication]+0x54): undefined reference to `Wt::WApplication::handleJavaScriptError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2.exe: error: ld returned 1 exit status

还有什么可以尝试的,或者我在哪里犯错?

0 个答案:

没有答案
相关问题