SHARE
TWEET

Untitled

a guest Sep 7th, 2012 32 Never
  1. mic@mic-nb /tmp $ cat main.cpp
  2.  
  3. namespace math {
  4. #include <math.h>
  5. }
  6.  
  7. int main() {
  8.         return math::expf(5);
  9. }
  10. mic@mic-nb /tmp $ g++ main.cpp
  11. mic@mic-nb /tmp $ ./a.out; echo $?
  12. 148
  13. mic@mic-nb /tmp $ g++ main.cpp -nostdlib
  14. /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400144
  15. /tmp/ccSX0iir.o: In function `main':
  16. main.cpp:(.text+0xd): undefined reference to `expf'
  17. collect2: error: ld returned 1 exit status
RAW Paste Data
Top