I use g++ 9.3.0. Now I just copy your example of library usage and when I do "g++ main.cpp -std=c++11" I get a lot of errors like this:
g++ main.cpp -o main -L/build/minisat
/usr/bin/ld: /tmp/ccKas2ZI.o: in function main': main.cpp:(.text+0x2e): undefined reference toMinisat::Solver::Solver()'
/usr/bin/ld: main.cpp:(.text+0x47): undefined reference to Minisat::Solver::newVar(bool, bool)' /usr/bin/ld: main.cpp:(.text+0x66): undefined reference toMinisat::Solver::newVar(bool, bool)'
/usr/bin/ld: main.cpp:(.text+0x85): undefined reference to Minisat::Solver::newVar(bool, bool)' /usr/bin/ld: main.cpp:(.text+0x3c7): undefined reference toMinisat::Solver::~Solver()'
/usr/bin/ld: main.cpp:(.text+0x3fc): undefined reference to Minisat::Solver::~Solver()' /usr/bin/ld: /tmp/ccKas2ZI.o: in functionMinisat::Solver::addClause(Minisat::Lit, Minisat::Lit, Minisat::Lit)':
main.cpp:(.text._ZN7Minisat6Solver9addClauseENS_3LitES1S1[_ZN7Minisat6Solver9addClauseENS_3LitES1S1]+0x94): undefined reference to Minisat::Solver::addClause_(Minisat::vec<Minisat::Lit>&)' /usr/bin/ld: /tmp/ccKas2ZI.o: in functionMinisat::Solver::solve()':
main.cpp:(.text._ZN7Minisat6Solver5solveEv[ZN7Minisat6Solver5solveEv]+0x5b): undefined reference to `Minisat::Solver::solve()'
collect2: error: ld returned 1 exit status
I have looked into the issues and I am guessing it because of not linking the library correctly.
I use g++ 9.3.0. Now I just copy your example of library usage and when I do "g++ main.cpp -std=c++11" I get a lot of errors like this: g++ main.cpp -o main -L/build/minisat /usr/bin/ld: /tmp/ccKas2ZI.o: in function
main': main.cpp:(.text+0x2e): undefined reference to
Minisat::Solver::Solver()' /usr/bin/ld: main.cpp:(.text+0x47): undefined reference toMinisat::Solver::newVar(bool, bool)' /usr/bin/ld: main.cpp:(.text+0x66): undefined reference to
Minisat::Solver::newVar(bool, bool)' /usr/bin/ld: main.cpp:(.text+0x85): undefined reference toMinisat::Solver::newVar(bool, bool)' /usr/bin/ld: main.cpp:(.text+0x3c7): undefined reference to
Minisat::Solver::~Solver()' /usr/bin/ld: main.cpp:(.text+0x3fc): undefined reference toMinisat::Solver::~Solver()' /usr/bin/ld: /tmp/ccKas2ZI.o: in function
Minisat::Solver::addClause(Minisat::Lit, Minisat::Lit, Minisat::Lit)': main.cpp:(.text._ZN7Minisat6Solver9addClauseENS_3LitES1S1[_ZN7Minisat6Solver9addClauseENS_3LitES1S1]+0x94): undefined reference toMinisat::Solver::addClause_(Minisat::vec<Minisat::Lit>&)' /usr/bin/ld: /tmp/ccKas2ZI.o: in function
Minisat::Solver::solve()': main.cpp:(.text._ZN7Minisat6Solver5solveEv[ZN7Minisat6Solver5solveEv]+0x5b): undefined reference to `Minisat::Solver::solve()' collect2: error: ld returned 1 exit statusI have looked into the issues and I am guessing it because of not linking the library correctly.