WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to tell compiler where my header (.h) file is please?  (Read 8321 times)

aus9

  • Guest
How to tell compiler where my header (.h) file is please?
« on: May 31, 2013, 08:16:30 AM »
Hi

in attempting to compile a package I have eglibc_base-dev loaded which is a part of deps for compiletc

nan.h sits under /usr/include/bits/

So to my fumbling brain I tried

export LDFLAGS="-Wl,-O1 -L /usr/include/bits/"

but cat *.log | grep error has
Code: [Select]
gcc: error: unrecognized option '-V'
gcc: fatal error: no input files
gcc: error: unrecognized option '-qversion'
gcc: fatal error: no input files
conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory
conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory
conftest.c:75:20: fatal error: ieeefp.h: No such file or directory
conftest.c:42:20: fatal error: ieeefp.h: No such file or directory
conftest.c:75:17: fatal error: nan.h: No such file or directory
conftest.c:42:17: fatal error: nan.h: No such file or directory
conftest.c:77:22: fatal error: fp_class.h: No such file or directory
conftest.c:44:22: fatal error: fp_class.h: No such file or directory
conftest.c:91:16: fatal error: dl.h: No such file or directory
conftest.c:58:16: fatal error: dl.h: No such file or directory
configure:13283: checking for strerror
| /* Override any GCC internal prototype to avoid an error.
| /* Override any GCC internal prototype to avoid an error.
| /* Override any GCC internal prototype to avoid an error.
| /* Override any GCC internal prototype to avoid an error.
| /* Override any GCC internal prototype to avoid an error.
| /* Override any GCC internal prototype to avoid an error.
| /* Override any GCC internal prototype to avoid an error.
| /* Override any GCC internal prototype to avoid an error.
ac_cv_func_strerror=yes

according to appsearch (Rich's great database search tool) I get hits for nan.h as
nan.h
   eglibc_base-dev.tcz
   plt.tcz
   toolchain64.tcz

but I am not building 64 bit, can't see how plt applies so the top one is my target TCZ

Code: [Select]
sudo find / -name nan.h
/tmp/tcloop/eglibc_base-dev/usr/include/bits/nan.h
/usr/include/bits/nan.h

any clues?

clearly I don't know a lot about compiling but you guys are the best, so hopefully will give me an answer

if not thanks for reading

Gordon

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11220
Re: How to tell compiler where my header (.h) file is please?
« Reply #1 on: May 31, 2013, 09:07:52 AM »
Hi aus9
I think the syntax is:
Code: [Select]
-I/usr/include/bits/and would be added to  CFLAGS  and/or  CXXFLAGS. However, if you look inside the nan.h file you'll find:
Code: [Select]
#ifndef _MATH_H
# error "Never use <bits/nan.h> directly; include <math.h> instead."
#endif
so this may not be a good idea and suggests the problem may lie elsewhere.

aus9

  • Guest
Re: How to tell compiler where my header (.h) file is please?
« Reply #2 on: May 31, 2013, 05:24:10 PM »
Rich

thanks for your all your help, and I would not have guessed I needed to look inside a header.

I test this later but
Code: [Select]
tce-load -i eglibc_base-dev.tcz
/etc/sysconfig/tcedir/optional/eglibc_base-dev.tcz: OK
sudo find /usr -name math.h
/usr/include/math.h

will test
Quote
# depends
export CFLAGS="-march=i486 -mtune=i686 -Os -pipe -I/usr/include/"
export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe -I/usr/include/"
export LDFLAGS="-Wl,-O1"

Hopefully if it sees math.h then it sees the sub-folder bits and then nan.h?

EDIT (1)
nope same error but I look at configure stage output and see
Quote
Disabling code coverage for GCC

./configure --help offers
--with-coverage         build for code coverage with GCC (off)

is that an issue?

I enabled and still nan.h error

EDIT 2
maybe I should expose my current (untested) build?  as its only a 5M download
https://www.dropbox.com/s/b69oidwnjd5fz5z/build.sh
« Last Edit: May 31, 2013, 05:43:54 PM by aus9 »