GCC build problem (#include_next limits.h)

I had faced my problem with compiling with STLport 5.1.5, but looks like the issue is fixed is STLport 5.2.0. The issue is documented in STLport Release Notes. After getting a copy of STLport 5.2.1, the compilation went successfully without hiccups.


I have encountered this problem doing a cross-compile. When you execute a 'make depend' the Makefile will invoke the makedepend program as seen from this assignment:

MAKEDEPPROG=makedepend

makedepend only searches some default include directories starting with /usr/include

Since the #include_next directive means to include the next found instance of the named include file in the search path, this will fail if another one is not found.

For me, the solution was to direct makedepend to search my cross-compiler include directories first. I did this by changing the MAKEDEPPROG assignment to include the -I directive:

MAKEDEPPROG=makedepend -I < path/to/cross-compiler/include-fixed >

I suggest reading about the makedepend program (about which I knew nothing before). For example, it was not obvious to me that makedepend would not use an environment search path. The -I directive puts the specified search path before makedepend's default paths.