Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Linking(Can't import math.h)
Linking [message #1754684] Tue, 21 February 2017 14:40 Go to next message
Arwel Hughes is currently offline Arwel HughesFriend
Messages: 3
Registered: February 2017
Junior Member
I'm trying to make a simple C project, but when I try to compile, I get 'undefined reference to `powf'', even though I have #include <math.h> at the start of my code.

I've googled around this, and am told that that for previous versions of eclipse, I should..... "project -> properties -> C/C++ Build -> Settings -> GCC Linker -> Libraries -> add "m" -> Apply -> build". But, in Oxygen everything has changed and there is no longer a 'C/C++ build' under this menu as far as I can see.

How do I do this in the latest version please? This is *really* annoying me! Confused
Re: Linking [message #1754906 is a reply to message #1754684] Thu, 23 February 2017 19:18 Go to previous message
Gregory Sagehorn is currently offline Gregory SagehornFriend
Messages: 4
Registered: February 2017
Junior Member
You must #include <math.h> and must remember to link in the math library at compilation: cc mathprog.c -o mathprog -lm
If that does not fix it. And if that does not work try defining the Math.h.
Previous Topic:cannot creat javadocs
Next Topic:Multiple Installation Failures
Goto Forum:

Current Time: Wed Jul 28 21:18:26 GMT 2021

Powered by FUDForum. Page generated in 0.02883 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top