Closed Maurizio1 closed 10 months ago
Hi @Maurizio1 Could you please provide the reproduction steps? A minimal example, or giving a link to your github repo for instance.
I feel you installed FTXUI and you might be using g++ manually. Did you considered using CMake to get it right all the time?
find_package(ftxui REQUIRED)
target_link_libraries(mine PRIVATE ftxui::component)
target_link_libraries(mine PRIVATE ftxui::dom)
target_link_libraries(mine PRIVATE ftxui::screen)
Thanks @ArthurSonzogni
It was my mistake then. (by the way I forgot to mention that I was using Qt Creator and Qmake)
Now I have implemented your suggestion and created a Cmake project with the following CMakeLists.txt (still in Qt Creator):
`cmake_minimum_required(VERSION 3.5)
project(ftxui_cmake_test LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories(${CMAKE_SOURCE_DIR}/../libraries/dynamic_output_lib) link_directories(${CMAKE_SOURCE_DIR}/../libraries/dynamic_output_lib/build/linux)
add_executable(ftxui_cmake_test main.cpp) target_link_libraries(ftxui_cmake_test PRIVATE dynamic_output_lib)
find_package(ftxui REQUIRED) target_link_libraries(ftxui_cmake_test PRIVATE ftxui::component) target_link_libraries(ftxui_cmake_test PRIVATE ftxui::dom) target_link_libraries(ftxui_cmake_test PRIVATE ftxui::screen)
include(GNUInstallDirs) install(TARGETS ftxui_cmake_test LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )`
Everything works as expected now.
Thank you very much!
Thanks! I guess this is now fixed!
Hi and thanks for this useful library!
I have included ftxui in a class of mine that implements some other output utilities. Class name is 'output'.
No problem when making a static library. When I try to make the 'output' class as a shared library I get the following linker errors:
:-1: error: /usr/local/lib/libftxui-component.a(event.cpp.o): warning: relocation against
_ZN5ftxui5Event3F12E' in read-only section.text'
and
:-1: error: /usr/local/lib/libftxui-component.a(catch_event.cpp.o): relocation R_X86_64_PC32 against symbol
_ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag' can not be used when making a shared object; recompile with -fPIC`I am compiling with g++ (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0.
Is this a supposed behaviour, am I doing something wrong or it's a bug?
Thanks in advance.