Skip to content

What flags to compile without CMake, only with g++ via command line? #262

Answered by ArthurSonzogni
terroo asked this question in Q&A
Discussion options

You must be logged in to vote

I highly recommend using cmake. If you don't, here is the answer:

Assuming FTXUI is installed under /usr/local:

# Build:
/usr/bin/c++ -c -I/usr/local/include -std=c++17 -o main.cpp.o  main.cpp

# Link:
/usr/bin/c++ -o main main.cpp.o /usr/local/lib/ftxui-component.a /usr/local/lib/ftxui-dom.a ftxui-screen.a -lpthread

Or combined:

/usr/bin/c++ -I/usr/local/include -std=c++17 -o main main.cpp /usr/local/lib/ftxui-component.a /usr/local/lib/ftxui-dom.a ftxui-screen.a -lpthread 

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@terroo
Comment options

@ArthurSonzogni
Comment options

Answer selected by ArthurSonzogni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #261 on November 19, 2021 10:34.