[opensource-dev] Linux build error: missing binary operator before token "(" (was: Hacking up to Visual Studio 2010 ...)

Nicky D. sl.nicky.ml at googlemail.com
Sat Feb 19 11:30:25 PST 2011

> [19:13:30]: LogScan (1s)
> [19:13:30]: [LogScan] from /usr/include/c++/4.1.3/cmath:53,
> [19:13:30]: [LogScan] from
> /var/opt/teamcity/checkout/L-oz_viewer-autobuild2010/latest/indra/llcommon/linden_common.h:48,
> [19:13:30]: [LogScan] from
> /var/opt/teamcity/checkout/L-oz_viewer-autobuild2010/latest/indra/newview/tests/lldateutil_test.cpp:26:
> [19:13:30]: [LogScan] /usr/include/bits/huge_val.h:28:18: error: missing
> binary operator before token "("
> [19:13:30]: [LogScan] /usr/include/bits/huge_val.h:30:20: error: missing
> binary operator before token "("
> With "build" in the second command instead of "configure", I'm getting the
> same error, though not just for /usr/include/bits/huge_val.h but many more
> system headers, too.

Tried it today, getting that too. Huge slew of errors.

Even though this looks intimidating, the reason is really simple.

In OZ's version of json there is a file features.h in
../include/json/. Metaphorical
speaking there he laid the bomb.
It is then trigged in cmake/JsonCpp.cmake and newview/CMakeList.txt

JsonCpp.cmake  sets JSONCPP_INCLUDE_DIRS to ${LIBS_PREBUILD_DIR)/include/json.
newview/CMakeList.txt adds JSONCPP_INCLUDE_DIRS to the system include dirs.

Now the the problem with gcc is, that adding include dirs with -I
makes them be searched
before the system include dirs.
And there our little bomb goes off. Because now the compiler findes
the features.h file
first in ../include/json. When it fact it needs the system one from

One solution might be to use the -I- switch or -iquote for new gcc
versions. But lucky
enough there is a trivially simple fix, just use
${LIBS_PREBUILD_DIR)/include for

I attached a patch that does just this. Standalone builds might need
some extra hackery,
I did not try one of those yet.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 14877.patch
Type: text/x-patch
Size: 1323 bytes
Desc: not available
Url : http://lists.secondlife.com/pipermail/opensource-dev/attachments/20110219/f64027f7/attachment.bin 

More information about the opensource-dev mailing list