When trying to compile my project, I am getting undefined reference to 'reflex::Input::file_get(char*, unsigned long long)'
error.
I exactly know where that function is. It is in a file called input.cpp
I have tried my best to link it. But I'm unable. Here is the steps I did:
- Compiled
input.cpp
toinput.o
. (g++ -isystem..\RE-flex\include -c ..\RE-flex\lib\*.cpp
). - Created
libreflex.a
frominput.o
. (ar -rcs .\bin\libreflex.a *.o
). - Built the project using
libreflex.a
. (g++ -o myproj.exe -isystem..\RE-flex\include -L.\bin -lreflex myproj.cpp -g -std=c++20
).
But still I am getting linker errors. I can't find any solution to this specific case. Please correct me where I gone wrong.