Author Topic: No math functions after upgrade to 20.03  (Read 3660 times)

Offline joga

  • Single posting newcomer
  • *
  • Posts: 3
No math functions after upgrade to 20.03
« 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.
« Last Edit: September 02, 2020, 02:23:52 am by joga »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: No math functions after upgrade to 20.03
« Reply #2 on: September 04, 2020, 03:14:59 am »
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org