public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Custom gcc installation include files
@ 2015-06-24 10:57 Siddhartha Jain
  2015-06-24 16:43 ` Jonathan Wakely
  2015-06-25  9:27 ` Andrew Haley
  0 siblings, 2 replies; 10+ messages in thread
From: Siddhartha Jain @ 2015-06-24 10:57 UTC (permalink / raw)
  To: gcc-help

Hi,

I have a custom installation of gcc 4.8.1 in my home directory.
However the include files in that installation have no extensions!
(except for tgmath.h, fenv.h, complex.h, and cxxabi.h)

Thus even if I include the installation include directory (for me
under include/c++/4.8.1) in C_INCLUDE_PATH, it still goes to the
system-wide gcc include files.

Why do the include files in the gcc install not have extensions and
will renaming them to have a .h extension fix the problem?



Thanks
--Sid

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Custom gcc installation include files
  2015-06-24 10:57 Custom gcc installation include files Siddhartha Jain
@ 2015-06-24 16:43 ` Jonathan Wakely
  2015-06-24 18:38   ` Siddhartha Jain
  2015-06-25  9:27 ` Andrew Haley
  1 sibling, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2015-06-24 16:43 UTC (permalink / raw)
  To: Siddhartha Jain; +Cc: gcc-help

On 24 June 2015 at 11:56, Siddhartha Jain wrote:
> Hi,
>
> I have a custom installation of gcc 4.8.1 in my home directory.
> However the include files in that installation have no extensions!
> (except for tgmath.h, fenv.h, complex.h, and cxxabi.h)

Which files are you talking about?

Most C++ Standard Library headers do not have extensions, so that's normal.


> Thus even if I include the installation include directory (for me
> under include/c++/4.8.1) in C_INCLUDE_PATH, it still goes to the
> system-wide gcc include files.

You should never need to add GCC's own include directories to its
search paths, it looks there automatically. So you're doing something
wrong.

> Why do the include files in the gcc install not have extensions and
> will renaming them to have a .h extension fix the problem?

What problem?

Most C++ headers are not supposed to have extensions, so renaming them
is not going to help.

It sounds like you have some problem compiling something and are
confused about C++ headers, but it's hard to tell. Please describe the
symptoms of the problem, not what you think is causing it.

What are you trying to do?

What errors are you getting?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Custom gcc installation include files
  2015-06-24 16:43 ` Jonathan Wakely
@ 2015-06-24 18:38   ` Siddhartha Jain
  2015-06-24 18:57     ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Siddhartha Jain @ 2015-06-24 18:38 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

Hm I see. I'm trying to compile Qt and I'm getting the error

In file included from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/tools/qbytearray.h:48:0,
                 from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/qbytearray.h:1,
                 from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/tools/qstring.h:46,
                 from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/qstring.h:1,
                 from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/io/qiodevice.h:51,
                 from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/qiodevice.h:1,
                 from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/io/qdatastream.h:46,
                 from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/qdatastream.h:1,
                 from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/tools/qstringlist.h:46,
                 from
/home/sj1/Software/qt/4.8.7/build/include/QtCore/qstringlist.h:1,
                 from project.h:45,
                 from project.cpp:42:
/usr/include/string.h:548:5: error: ‘__locale_t’ has not been declared
     __locale_t __loc)


there are a couple of other similar errors but this is the first one
and I thought it might be because the system gcc is 4.4.7 and it's
using the executable for gcc 4.8.1

--Sid

On Wed, Jun 24, 2015 at 12:43 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 24 June 2015 at 11:56, Siddhartha Jain wrote:
>> Hi,
>>
>> I have a custom installation of gcc 4.8.1 in my home directory.
>> However the include files in that installation have no extensions!
>> (except for tgmath.h, fenv.h, complex.h, and cxxabi.h)
>
> Which files are you talking about?
>
> Most C++ Standard Library headers do not have extensions, so that's normal.
>
>
>> Thus even if I include the installation include directory (for me
>> under include/c++/4.8.1) in C_INCLUDE_PATH, it still goes to the
>> system-wide gcc include files.
>
> You should never need to add GCC's own include directories to its
> search paths, it looks there automatically. So you're doing something
> wrong.
>
>> Why do the include files in the gcc install not have extensions and
>> will renaming them to have a .h extension fix the problem?
>
> What problem?
>
> Most C++ headers are not supposed to have extensions, so renaming them
> is not going to help.
>
> It sounds like you have some problem compiling something and are
> confused about C++ headers, but it's hard to tell. Please describe the
> symptoms of the problem, not what you think is causing it.
>
> What are you trying to do?
>
> What errors are you getting?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Custom gcc installation include files
  2015-06-24 18:38   ` Siddhartha Jain
@ 2015-06-24 18:57     ` Jonathan Wakely
  2015-06-24 19:10       ` Siddhartha Jain
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2015-06-24 18:57 UTC (permalink / raw)
  To: Siddhartha Jain; +Cc: gcc-help

On 24 June 2015 at 19:38, Siddhartha Jain wrote:
> /usr/include/string.h:548:5: error: ‘__locale_t’ has not been declared
>      __locale_t __loc)

This indicates you are either doing something wrong or your C library
is severely messed up.

/usr/include/string.h is part of the C library, and the type
__locale_t should be defined by another header in the C library,
/usr/include/xlocale.h


> there are a couple of other similar errors but this is the first one
> and I thought it might be because the system gcc is 4.4.7 and it's
> using the executable for gcc 4.8.1

No, that should work fine (and it does, I use such a setup frequently).

I suggest you stop adding anything to C_INCLUDE_PATH. If you just
invoke gcc 4.8.1 it should know how to find all the standard C and C++
headers it needs, without your help.

If that still doesn't work and you want further help you will need to
show the exact gcc or g++ command that causes the error, as well as
any environment variables such as C_INCLUDE_PATH and CXX that you
might have set that would confuse things. We can't guess what the
problem is if you don't tell us exactly what you're doing.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Custom gcc installation include files
  2015-06-24 18:57     ` Jonathan Wakely
@ 2015-06-24 19:10       ` Siddhartha Jain
  2015-06-24 19:31         ` Siddhartha Jain
  2015-06-25  8:50         ` Jonathan Wakely
  0 siblings, 2 replies; 10+ messages in thread
From: Siddhartha Jain @ 2015-06-24 19:10 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

The command is below. C_INCLUDE_PATH and CXX are empty. I have a
symlink to the gcc exec in my home dir bin which is what's running.

When I set the CXX and CC to the system g++ and gcc, the problem goes
away so it seems like my gcc custom installation is messed up? I have
compiled other things in the past with it though.

g++ -c -o project.o -pipe -DQMAKE_OPENSOURCE_EDITION -g -I.
-Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac
-Igenerators/symbian -Igenerators/integrity
-I/home/sj1/Software/qt/4.8.7/build/include
-I/home/sj1/Software/qt/4.8.7/build/include/QtCore
-I/home/sj1/Software/qt/4.8.7/build/src/corelib/global
-I/home/sj1/Software/qt/4.8.7/build/src/corelib/xml
-I/home/sj1/Software/qt/4.8.7/qt-everywhere-opensource-src-4.8.7/tools/shared
-DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED
-DQLIBRARYINFO_EPOCROOT -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES
-DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS
-I/home/sj1/Software/qt/4.8.7/qt-everywhere-opensource-src-4.8.7/mkspecs/linux-g++
-DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT
-DQT_NO_DEPRECATED  project.cpp

On Wed, Jun 24, 2015 at 2:56 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 24 June 2015 at 19:38, Siddhartha Jain wrote:
>> /usr/include/string.h:548:5: error: ‘__locale_t’ has not been declared
>>      __locale_t __loc)
>
> This indicates you are either doing something wrong or your C library
> is severely messed up.
>
> /usr/include/string.h is part of the C library, and the type
> __locale_t should be defined by another header in the C library,
> /usr/include/xlocale.h
>
>
>> there are a couple of other similar errors but this is the first one
>> and I thought it might be because the system gcc is 4.4.7 and it's
>> using the executable for gcc 4.8.1
>
> No, that should work fine (and it does, I use such a setup frequently).
>
> I suggest you stop adding anything to C_INCLUDE_PATH. If you just
> invoke gcc 4.8.1 it should know how to find all the standard C and C++
> headers it needs, without your help.
>
> If that still doesn't work and you want further help you will need to
> show the exact gcc or g++ command that causes the error, as well as
> any environment variables such as C_INCLUDE_PATH and CXX that you
> might have set that would confuse things. We can't guess what the
> problem is if you don't tell us exactly what you're doing.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Custom gcc installation include files
  2015-06-24 19:10       ` Siddhartha Jain
@ 2015-06-24 19:31         ` Siddhartha Jain
  2015-06-25  8:50         ` Jonathan Wakely
  1 sibling, 0 replies; 10+ messages in thread
From: Siddhartha Jain @ 2015-06-24 19:31 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

Hmm, I just realized, that the command is g++, not gcc...I exported
the gcc library path into LD_LIBRARY_PATH (at /lib64) but that didn't
help either.

On Wed, Jun 24, 2015 at 3:09 PM, Siddhartha Jain <tmfs10@gmail.com> wrote:
> The command is below. C_INCLUDE_PATH and CXX are empty. I have a
> symlink to the gcc exec in my home dir bin which is what's running.
>
> When I set the CXX and CC to the system g++ and gcc, the problem goes
> away so it seems like my gcc custom installation is messed up? I have
> compiled other things in the past with it though.
>
> g++ -c -o project.o -pipe -DQMAKE_OPENSOURCE_EDITION -g -I.
> -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac
> -Igenerators/symbian -Igenerators/integrity
> -I/home/sj1/Software/qt/4.8.7/build/include
> -I/home/sj1/Software/qt/4.8.7/build/include/QtCore
> -I/home/sj1/Software/qt/4.8.7/build/src/corelib/global
> -I/home/sj1/Software/qt/4.8.7/build/src/corelib/xml
> -I/home/sj1/Software/qt/4.8.7/qt-everywhere-opensource-src-4.8.7/tools/shared
> -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED
> -DQLIBRARYINFO_EPOCROOT -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES
> -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS
> -I/home/sj1/Software/qt/4.8.7/qt-everywhere-opensource-src-4.8.7/mkspecs/linux-g++
> -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT
> -DQT_NO_DEPRECATED  project.cpp
>
> On Wed, Jun 24, 2015 at 2:56 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>> On 24 June 2015 at 19:38, Siddhartha Jain wrote:
>>> /usr/include/string.h:548:5: error: ‘__locale_t’ has not been declared
>>>      __locale_t __loc)
>>
>> This indicates you are either doing something wrong or your C library
>> is severely messed up.
>>
>> /usr/include/string.h is part of the C library, and the type
>> __locale_t should be defined by another header in the C library,
>> /usr/include/xlocale.h
>>
>>
>>> there are a couple of other similar errors but this is the first one
>>> and I thought it might be because the system gcc is 4.4.7 and it's
>>> using the executable for gcc 4.8.1
>>
>> No, that should work fine (and it does, I use such a setup frequently).
>>
>> I suggest you stop adding anything to C_INCLUDE_PATH. If you just
>> invoke gcc 4.8.1 it should know how to find all the standard C and C++
>> headers it needs, without your help.
>>
>> If that still doesn't work and you want further help you will need to
>> show the exact gcc or g++ command that causes the error, as well as
>> any environment variables such as C_INCLUDE_PATH and CXX that you
>> might have set that would confuse things. We can't guess what the
>> problem is if you don't tell us exactly what you're doing.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Custom gcc installation include files
  2015-06-24 19:10       ` Siddhartha Jain
  2015-06-24 19:31         ` Siddhartha Jain
@ 2015-06-25  8:50         ` Jonathan Wakely
  2015-06-25  8:52           ` Siddhartha Jain
  1 sibling, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2015-06-25  8:50 UTC (permalink / raw)
  To: Siddhartha Jain; +Cc: gcc-help

On 24 June 2015 at 20:09, Siddhartha Jain wrote:
> The command is below. C_INCLUDE_PATH and CXX are empty. I have a
> symlink to the gcc exec in my home dir bin which is what's running.
>
> When I set the CXX and CC to the system g++ and gcc, the problem goes
> away so it seems like my gcc custom installation is messed up? I have
> compiled other things in the past with it though.

Was the new GCC compiled for this OS, or built on a different machine
and copied over?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Custom gcc installation include files
  2015-06-25  8:50         ` Jonathan Wakely
@ 2015-06-25  8:52           ` Siddhartha Jain
  2015-06-25  9:11             ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Siddhartha Jain @ 2015-06-25  8:52 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

I compiled it for this OS.

On Thu, Jun 25, 2015 at 4:50 AM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 24 June 2015 at 20:09, Siddhartha Jain wrote:
>> The command is below. C_INCLUDE_PATH and CXX are empty. I have a
>> symlink to the gcc exec in my home dir bin which is what's running.
>>
>> When I set the CXX and CC to the system g++ and gcc, the problem goes
>> away so it seems like my gcc custom installation is messed up? I have
>> compiled other things in the past with it though.
>
> Was the new GCC compiled for this OS, or built on a different machine
> and copied over?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Custom gcc installation include files
  2015-06-25  8:52           ` Siddhartha Jain
@ 2015-06-25  9:11             ` Jonathan Wakely
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Wakely @ 2015-06-25  9:11 UTC (permalink / raw)
  To: Siddhartha Jain; +Cc: gcc-help

On 25 June 2015 at 09:51, Siddhartha Jain wrote:
> I compiled it for this OS.

Strange, I've seen errors like that when using GCC on a different
machine from the one where it was built.

You'll need to debug why __locale_t is not being defined.

You can add -save-temps to the failing command, then look in the file
project.ii and look for "xlocale.h", which is the file that should be
included to define __locale_t, or just look for __locale_t.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Custom gcc installation include files
  2015-06-24 10:57 Custom gcc installation include files Siddhartha Jain
  2015-06-24 16:43 ` Jonathan Wakely
@ 2015-06-25  9:27 ` Andrew Haley
  1 sibling, 0 replies; 10+ messages in thread
From: Andrew Haley @ 2015-06-25  9:27 UTC (permalink / raw)
  To: Siddhartha Jain, gcc-help

The fact that you're not giving us full information makes it
very hard for us to help you.

We need to know how you configured GCC and how you installed it.
Everything you have said points to a problem there.

We also need to know how you run GCC.  This has to be *exact*.
Copy-and-paste the command line.

You previous example was a bit strange.  Did you change your PATH
to point to the installed GCC?

Andrew.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-06-25  9:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-24 10:57 Custom gcc installation include files Siddhartha Jain
2015-06-24 16:43 ` Jonathan Wakely
2015-06-24 18:38   ` Siddhartha Jain
2015-06-24 18:57     ` Jonathan Wakely
2015-06-24 19:10       ` Siddhartha Jain
2015-06-24 19:31         ` Siddhartha Jain
2015-06-25  8:50         ` Jonathan Wakely
2015-06-25  8:52           ` Siddhartha Jain
2015-06-25  9:11             ` Jonathan Wakely
2015-06-25  9:27 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).