microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.17k stars 6.39k forks source link

[FTXUI] error LNK2019 #22268

Closed qisumi closed 2 years ago

qisumi commented 2 years ago

Library name:FTXUI

New version number:0.11

Now when using vcpkg with ftxui in Visual Studio 2022, there will be some linking error.

Environment: Windows11 x64 VisualStudio2022

More Details

1>ConsoleUIApp.obj : error LNK2019: 无法解析的外部符号 "public: static struct ftxui::Dimension __cdecl ftxui::Dimension::Fit(class std::shared_ptr<class ftxui::Node> &)" (?Fit@Dimension@ftxui@@SA?AU12@AEAV?$shared_ptr@VNode@ftxui@@@std@@@Z),函数 main 中引用了该符号
1>ConsoleUIApp.obj : error LNK2019: Unresolved external symbol "public: static struct ftxui::Dimension __cdecl ftxui::Dimension::Full(void)" (?Full@Dimension@ftxui@@SA?AU12@XZ),
1>ConsoleUIApp.obj : error LNK2019: Unresolved external symbol "public: static class ftxui::Screen __cdecl ftxui::Screen::Create(struct ftxui::Dimension,struct ftxui::Dimension)" (?Create@Screen@ftxui@@SA?AV12@UDimension@2@0@Z),函数 main 中引用了该符号
1>ConsoleUIApp.obj : error LNK2019: Unresolved external symbol "public: void __cdecl ftxui::Screen::Print(void)" (?Print@Screen@ftxui@@QEAAXXZ),
1>ConsoleUIApp.obj : error LNK2019: Unresolved external symbol "void __cdecl ftxui::Render(class ftxui::Screen &,class std::shared_ptr<class ftxui::Node> const &)" (?Render@ftxui@@YAXAEAVScreen@1@AEBV?$shared_ptr@VNode@ftxui@@@std@@@Z),
1>ConsoleUIApp.obj : error LNK2019: Unresolved external symbol "class std::shared_ptr<class ftxui::Node> __cdecl ftxui::operator|(class std::shared_ptr<class ftxui::Node>,class std::function<class std::shared_ptr<class ftxui::Node> __cdecl(class std::shared_ptr<class ftxui::Node>)>)" (??Uftxui@@YA?AV?$shared_ptr@VNode@ftxui@@@std@@V12@V?$function@$$A6A?AV?$shared_ptr@VNode@ftxui@@@std@@V12@@Z@2@@Z),
1>ConsoleUIApp.obj : error LNK2019: Unresolved external symbol "class std::shared_ptr<class ftxui::Node> __cdecl ftxui::text(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?text@ftxui@@YA?AV?$shared_ptr@VNode@ftxui@@@std@@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@3@@Z),
1>ConsoleUIApp.obj : error LNK2019: Unresolved external symbol "class std::shared_ptr<class ftxui::Node> __cdecl ftxui::border(class std::shared_ptr<class ftxui::Node>)" (?border@ftxui@@YA?AV?$shared_ptr@VNode@ftxui@@@std@@V23@@Z),
1>ConsoleUIApp.obj : error LNK2019: Unresolved external symbol "class std::shared_ptr<class ftxui::Node> __cdecl ftxui::hbox(class std::vector<class std::shared_ptr<class ftxui::Node>,class std::allocator<class std::shared_ptr<class ftxui::Node> > >)" (?hbox@ftxui@@YA?AV?$shared_ptr@VNode@ftxui@@@std@@V?$vector@V?$shared_ptr@VNode@ftxui@@@std@@V?$allocator@V?$shared_ptr@VNode@ftxui@@@std@@@2@@3@@Z),
1>ConsoleUIApp.obj : error LNK2019: Unresolved external symbol "class std::shared_ptr<class ftxui::Node> __cdecl ftxui::flex(class std::shared_ptr<class ftxui::Node>)" (?flex@ftxui@@YA?AV?$shared_ptr@VNode@ftxui@@@std@@V23@@Z),
qisumi commented 2 years ago

it works well when using CMake in Visual Studio

LilyWangLL commented 2 years ago

Thanks for posting this issue. I can use FTXUI well in CMake project. Could you please provide a sample project to reproduce the error?

qisumi commented 2 years ago

Thanks for posting this issue. I can use FTXUI well in CMake project. Could you please provide a sample project to reproduce the error?

Yes it work well in CMake project, maybe there is some wrong in project setting. I'm working on solving it.

LilyWangLL commented 2 years ago

Thanks for your reply. If you need any help, please comment there.