Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: joga on September 02, 2020, 02:12:50 am
-
I just upgraded Code::Blocks from 17.NN to 20.03 and wanted to just continue to work on my current project in C (GCC). But suddenly I cannot compile anything using functions from math.h. No errors on the #include <math.h>-line but all references to pow(), cos(), etc, are marked undefined.
My command line is "gcc -Wshadow -Wunreachable-code -Wall -m64 -g -std=gnu99 -Wshadow -Wunreachable-code -Wall -m64 -g -std=gnu99 -Wno-comment -c". Don't know why there is duplicates of the parameters, they are only defined in Project>Build options.
I did suspect that Code::Blocks think the source is C++, but #include <cmath> causes an error and nothing in the build log point to C++. My project is in C.
Version: Code::Blocks 20.03, GCC 8.3.0 running on Debian/AMD64.
Why the f--k can't I use math functions anymore and why does not include <math.h> cause an error? Not an byte has changed in my project since the upgrade, and I have not touched my GCC installation.
Edit: I tried to start a new project, choosing C and import all project files. It didn't work. Still "undefined reference to 'pow'", etc.
-
Please post a full rebuild log, like described here:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
-
Please do not use CB Global compiler settings! If you do then document them in the project notes!
https://askubuntu.com/questions/332884/how-to-compile-a-c-program-that-uses-math-h (https://askubuntu.com/questions/332884/how-to-compile-a-c-program-that-uses-math-h)
Tim S.