Deprecated: Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Cookie/Jar.php on line 63

Deprecated: Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Cookie/Jar.php on line 73

Deprecated: Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Cookie/Jar.php on line 89

Deprecated: Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Cookie/Jar.php on line 102

Deprecated: Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Cookie/Jar.php on line 111

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/francisfisher/francisfisher.me.uk/problem/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91
undefined reference to `ceil’ (or pow or floor or …) in ubuntu 11.10 – Computer Problems
Categories
Linux

undefined reference to `ceil' (or pow or floor or ...) in ubuntu 11.10

There has been a change to the build tools in ubuntu 11.10 - The "--as-needed" flag is now passed to the linker. This primarily has implications for dynamic library linking but it also affects the order that libraries appear on the command line even for static linking.

A simple example of the problem:

frankster@frankie-laptop:~> cat testm.c
#include <math.h>

int main(int argc, char*argv[]){
double x;
double return_val = ceil(x);
return 0;
}
frankster@frankie-laptop:~> gcc -lm testm.c
/tmp/ccNkQLo6.o: In function `main':
testm.c:(.text+0x15): undefined reference to `ceil'
collect2: ld returned 1 exit status>

A quick fix solution could be to pass the "-Wl,--no-as-needed" option to gcc which turns off the option in ld. However the real problem in the example I provided is the order of -lm and testm.c. The following builds successfully:

gcc testm.c -lm

More info at http://www.gentoo.org/proj/en/qa/asneeded.xml and https://wiki.ubuntu.com/OneiricOcelot/ReleaseNotes?action=show&redirect=OneiricOcelot%2FTechnicalOverview#GCC_4.6_Toolchain

By ff

Systems software engineer with interests in C/C++/Rust on Linux, electronic music and games.

7 replies on “undefined reference to `ceil' (or pow or floor or ...) in ubuntu 11.10”

Thanks a lot
I was in trouble for two days with ubuntu 11.10 and openembedded stable/2009 branch
this hint helped me to fix it by changing:
-Dldflags="${LDFLAGS}" \
To:
-Dldflags="${LDFLAGS} -Wl,--no-as-needed -lpthread -lm" \
I hope it helps someone just like this article helped me

Hi I would like to update the operating system for my E-MU Virtuoso 2000 which is currently version 1.24 I believe there is an update to version 2.26?
My computer : Mac Pro 12 core
Mac OSX 10.9.5
I would also want to purchase either NEW,SECOND HAND or B stock from plastic silver front panel.
Many thanks

Leave a Reply to Tim Cancel reply

Your email address will not be published. Required fields are marked *