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

2011-02-19 Thread Nicky D.
 [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
/usr/include/features.h.

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
JSONCPP_INCLUDE_DIRS.

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

Cheers,
   Nicky
# HG changeset patch
# User Nicky nickyd...@yahoo.com
# Date 1298143658 -3600
# Node ID ab363082f660e186ce0bfef8bf455b6d932c2663
# Parent  07163388fcb99b292843648c6256946cc622976f
Do not add jsonpath/include/json as an include director. Instead use jsonpath/include.
Otherwise include/json/features.h will mask /usr/include/features.

diff -r 07163388fcb9 -r ab363082f660 indra/cmake/JsonCpp.cmake
--- a/indra/cmake/JsonCpp.cmake	Fri Feb 18 12:50:16 2011 -0500
+++ b/indra/cmake/JsonCpp.cmake	Sat Feb 19 20:27:38 2011 +0100
@@ -18,5 +18,5 @@
   elseif (LINUX)
 set(JSONCPP_LIBRARIES libjson_linux-gcc-4.3.2_libmt)
   endif (WINDOWS)
-  set(JSONCPP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/json)
+  set(JSONCPP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
 endif (STANDALONE)
diff -r 07163388fcb9 -r ab363082f660 indra/newview/lltranslate.cpp
--- a/indra/newview/lltranslate.cpp	Fri Feb 18 12:50:16 2011 -0500
+++ b/indra/newview/lltranslate.cpp	Sat Feb 19 20:27:38 2011 +0100
@@ -33,7 +33,7 @@
 #include llversioninfo.h
 #include llviewercontrol.h
 
-#include reader.h
+#include json/reader.h
 
 // These two are concatenated with the language specifiers to form a complete Google Translate URL
 const char* LLTranslate::m_GoogleURL = http://ajax.googleapis.com/ajax/services/language/translate?v=1.0q=;;
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Re: [opensource-dev] Linux build error: missing binary operator before token (

2011-02-19 Thread Boroondas Gupte
On 02/19/2011 08:30 PM, Nicky D. wrote:
 [...]
 [19:13:30]: [LogScan] /usr/include/bits/huge_val.h:30:20: error: missing
 binary operator before token (
 [...]
 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
 /usr/include/features.h.
That analysis looks correct, so go ask Oz about that Eternal Glory he
offered on IRC. :-)

 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
 JSONCPP_INCLUDE_DIRS.

 I attached a patch that does just this.
I just tested, and reverting eeb812d81330
https://bitbucket.org/jenn_linden/viewer-vs2010/changeset/eeb812d81330
(the changeset that switched to the new json download) works as a
workaround, too. Though, I guess your change is the preferred way to fix
this issue, because

   1. there probably was a reason for updating jsoncpp
   2. the other jsoncpp headers in the package also have very generic
  names, so using the containing dir as a way of namespacing will
  probably avoid further conflicts in the future


 Standalone builds might need
 some extra hackery,
 I did not try one of those yet.
Since 7690f4cb5e81
https://bitbucket.org/jenn_linden/viewer-vs2010/changeset/7690f4cb5e81, the
jsoncpp include was probably broken for standalone anyway. (Can't test,
as standalone fails due to other (unrelated) errors.)

Cheers,
Boroondas
___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

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

2011-02-18 Thread Boroondas Gupte
On 02/18/2011 01:56 AM, Oz Linden (Scott Lawrence) wrote:
 [...]

 Then check out:

 https://bitbucket.org/oz_linden/viewer-autobuild2010

 cd into the top level of that directory, and run:

 autobuild configure -c OpenSourceRelWithDebInfo

 autobuild configure -c OpenSourceRelWithDebInfo

 and let me know if it works (and if not, see if you can figure out why
 not).  On our build farm, I'm getting an error:

 _[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.

Boroondas

___
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges