0

I'm trying to build a library named Ogre3d v1.8 using gcc 4.7 on MacOSX 10.6. I have tried to install the gcc version from both MacPorts and from gFortran webpage. Both have the same issue and I can't find much information about this on the internet.

My problem is that I get this error:

Scanning dependencies of target OgreMain
[ 0%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAlignedAllocator.cpp.o
In file included from /usr/local/gcc-4-7-svn/lib/gcc/x86_64-apple-darwin10/4.7.0/include/c++/bits/postypes.h:42:0,
from /usr/local/gcc-4-7-svn/lib/gcc/x86_64-apple-darwin10/4.7.0/include/c++/bits/char_traits.h:42,
from /usr/local/gcc-4-7-svn/lib/gcc/x86_64-apple-darwin10/4.7.0/include/c++/string:42,
from /Users/parwrange/Desktop/ogre/ogre_src_v1-8-1/OgreMain/include/OgrePrerequisites.h:33,
from /Users/parwrange/Desktop/ogre/ogre_src_v1-8-1/OgreMain/include/OgreArchive.h:31,
from /Users/parwrange/Desktop/ogre/ogre_src_v1-8-1/OgreMain/include/OgreStableHeaders.h:41,
from /Users/parwrange/Desktop/ogre/ogre_src_v1-8-1/OgreMain/src/OgreAlignedAllocator.cpp:28:
/usr/local/gcc-4-7-svn/lib/gcc/x86_64-apple-darwin10/4.7.0/include/c++/cwchar:46:19: fatal error: wchar.h: No such file or directory
compilation terminated.
make[2]: *** [OgreMain/CMakeFiles/OgreMain.dir/src/OgreAlignedAllocator.cpp.o] Error 1
make[1]: *** [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2
make: *** [all] Error 2

In other words it looks like the header file wchar.h is missing.

I have been able to build other libraries with the gcc 4.7 installation. So I'm guessing that it is something specific with Ogre3d v1.8. Maybe something to do with inclusion order. But since I'm having problem finding other people with this issue I'm hoping that someone here have some good tips on what to do.

Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
user1716970
  • 743
  • 1
  • 8
  • 19

1 Answers1

2

Today I had the same problem but in different project than Ogre. Is it possible you're using 64bit OS and compile executable in 32bits?

If that's the case then you need a glibc-devel (or equivalent-depends on Unix flavor) package in 32bit version.

Try to do something like that:

locate wchar.h    //this will return some paths to wchar.h
                  //like /usr/include/wchar.h
//use this path:
rpm -qf /usr/include/wchar.h  //this will return package name that includes the file

yum search 'package-name'

You should have the package in x86_64 and i386/i686 version. If you have just one of them, you need to install the second one.

BTW I'm not sure if it's the glibc-devel, glibc-headers or any other name, because I had this problem few times, with different files, but in general this is the way to resolve the problem.

kolenda
  • 2,741
  • 2
  • 19
  • 30