I compile my code with the command line. here is an example of how I compile a program named "out" with 2 libraries a and b
g++ -c -O3 -I../../include/boost_1_61_0 -std=c++14 -MMD -MP -MF "a.o.d" -o a.o ../../my_Library/lib_a.cpp
g++ -c -O3 -I../../include/boost_1_61_0 -std=c++14 -MMD -MP -MF "b.o.d" -o b.o ../../my_Library/lib_b.cpp
g++ -lcurl -g -std=c++11 -lpthread -o out a.o b.o -L../../include/shared_libraries -no-pie -lsqlite3 -lrt -lpthread -lcurl -fopenmp -lboost_serialization -lconfig++ -lpq -lstdc++ -lz -lboost_thread -lboost_system -lboost_program_options
In the end, I have that files (.o and .od) - a, b, out I want to debug a cpp file and b cpp file with Vscod how can I do this?
I know that I need to edit the tasks.json and launch.json But I don't know-how. I use ubuntu. thanks
I use ubuntu.
thanks
################# EDIT ###################
I did what Krzysztof Mochocki said. and after some minor changes, it works.
First, I remove the optimization flag from compiling line (-O3)
Second, I add -g (debug flag) to the compiling line.
g++ -c -g -I../../include/boost_1_61_0 -std=c++14 -MMD -MP -MF "a.o.d" -o a.o my_Librar/a.cpp
The last change is in launch.json in the field "program" I write there the program path, not the .o path
"program": "my/path/a",
And now I can debugging with Vscode.
thank you Krzysztof Mochocki