News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

No math functions after upgrade to 20.03

Started by joga, September 02, 2020, 02:12:50 AM

Previous topic - Next topic

joga

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.


stahta01

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

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]