A stubborn linker problem
Posted: Mon Jun 16, 2025 2:25 am
Hi All,
A rank beginner with CodeLite, I have spent quite a bit of time trying to get math library linked on c++ program. CodeLite is version 14.0.0 running on Mint 21.2. The build error I am getting is: error: 'DBL_MAX' was not declared in this scope. Here is what I have done:
- Under Settings > Build_Settings > gnu g++ > Linker_Options I have added the switch -libm.a
- Under Settings > Build_Settings > gnu g++ > Switches > Library I have added -libm.a
- Under Settings > Build_Settings > gnu g++ > Advanced > Libraries_Path I have added /usr/lib/x86_64-linux-gnu/libm.a
- I checked the inserted path and verified that the math library is actually there.
- I added #include <math.h> at the top of the file that has the error declared against it.
It almost seems like I have done too much. In any case, it still doesn't work. Can anyone inform me about the magic I am missing?
thanks
Gary B