jsoncpp integration on linux fails

6532e3e5e09db6f966770fdf86c03345
0
hellhound_01 104 Jan 02, 2013 at 14:25 c++ library

I’m trying to integrate jsoncpp to my project linux support. My platform is a 32-bit xubuntu with gcc version 4.7.2. I tried to use the debian package, also a build from latest jsoncpp sources, both results in same issue.

I used CMake for my builds. The jsoncpp includes and library are found successfully. But when I add the includes to my CMake includes (The jsoncpp headers are included with cmake command INCLUDE_DIRECTORIES), the build of my empty brConfig class (which has only one #include<string> in line 51) fails with the following error:

[100%] Building CXX object CMakeFiles/brCore.dir/src/brConfig.cpp.o
In file included from /usr/include/c++/4.7/i686-linux-gnu/bits/c++config.h:414:0,
from /usr/include/c++/4.7/string:40, from /home/hellhound/Repository/binrevengine/modules/brCore/trunk/include/brCore/brConfig.h:51,
from /home/hellhound/Repository/binrevengine/modules/brCore/trunk/src/brConfig.cpp:25:
/usr/include/c++/4.7/i686-linux-gnu/bits/os_defines.h:45:19: Fehler: fehlender binärer Operator vor Token
"(" In file included from /usr/include/c++/4.7/cwchar:46:0, from /usr/include/c++/4.7/bits/postypes.h:42,
from /usr/include/c++/4.7/bits/char_traits.h:42, from /usr/include/c++/4.7/string:42,
from /home/hellhound/Repository/binrevengine/modules/brCore/trunk/include/brCore/brConfig.h:51,
from /home/hellhound/Repository/binrevengine/modules/brCore/trunk/src/brConfig.cpp:25: /usr/include/wchar.h:75:43:
Fehler: fehlender binärer Operator vor Token "(" In file included from /usr/include/sched.h:43:0,
from /usr/include/pthread.h:25, from /usr/include/c++/4.7/i686-linux-gnu/bits/gthr-default.h:41,
from /usr/include/c++/4.7/i686-linux-gnu/bits/gthr.h:150, from /usr/include/c++/4.7/ext/atomicity.h:34,
from /usr/include/c++/4.7/bits/basic_string.h:41, from /usr/include/c++/4.7/string:54,
from /home/hellhound/Repository/binrevengine/modules/brCore/trunk/include/brCore/brConfig.h:51,
from /home/hellhound/Repository/binrevengine/modules/brCore/trunk/src/brConfig.cpp:25:
/usr/include/i386-linux-gnu/bits/sched.h:133:20: Fehler: fehlender binärer Operator vor Token "(" /usr/include/i386-linux-gnu/bits/sched.h:171:20:
Fehler: fehlender binärer Operator vor Token "(" In file included from /usr/include/c++/4.7/cwchar:46:0,
from /usr/include/c++/4.7/bits/postypes.h:42, from /usr/include/c++/4.7/bits/char_traits.h:42, from /usr/include/c++/4.7/string:42,
from /home/hellhound/Repository/binrevengine/modules/brCore/trunk/include/brCore/brConfig.h:51,
from /home/hellhound/Repository/binrevengine/modules/brCore/trunk/src/brConfig.cpp:25:
/usr/include/wchar.h:104:1: Fehler: "__BEGIN_NAMESPACE_C99" bezeichnet keinen Typ /usr/include/wchar.h:107:1:
Fehler: "__END_NAMESPACE_C99" bezeichnet keinen Typ /usr/include/wchar.h:135:1:
Fehler: "__END_NAMESPACE_STD" bezeichnet keinen Typ /usr/include/wchar.h:149:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:153:39:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:157:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:161:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:164:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:165:1:
Fehler: "__END_NAMESPACE_STD" bezeichnet keinen Typ /usr/include/wchar.h:194:56:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:195:1:
Fehler: "__END_NAMESPACE_STD" bezeichnet keinen Typ /usr/include/wchar.h:235:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:237:1:
Fehler: "__END_NAMESPACE_STD" bezeichnet keinen Typ /usr/include/wchar.h:254:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:264:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:275:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:281:32:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:284:45:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:285:1:
Fehler: "__END_NAMESPACE_STD" bezeichnet keinen Typ /usr/include/wchar.h:323:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:327:51:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:332:6:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:335:65:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:336:1:
Fehler: "__END_NAMESPACE_STD" bezeichnet keinen Typ /usr/include/wchar.h:354:31:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:358:29:
Fehler: "mbstate_t" bezeichnet keinen Typ /usr/include/wchar.h:358:46:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:364:10:
Fehler: "mbstate_t" wurde nicht deklariert /usr/include/wchar.h:364:26:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:368:10:
Fehler: "mbstate_t" wurde nicht deklariert /usr/include/wchar.h:368:38:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:372:4:
Fehler: "mbstate_t" wurde nicht deklariert /usr/include/wchar.h:372:32:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:374:9:
Fehler: "mbstate_t" wurde nicht deklariert /usr/include/wchar.h:374:37:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:375:1:
Fehler: "__END_NAMESPACE_STD" bezeichnet keinen Typ /usr/include/wchar.h:413:5:
Fehler: "mbstate_t" wurde nicht deklariert /usr/include/wchar.h:413:33:
Fehler: expected initializer before "__THROW" /usr/include/wchar.h:414:1:
Fehler: "__gthrw_pthread_cond_wait" kann nicht als Funktion verwendet werden
/usr/include/c++/4.7/i686-linux-gnu/bits/gthr-default.h:
In Funktion "int __gthread_cond_timedwait(__gthread_cond_t*, __gthread_mutex_t*, const __gthread_time_t*)":
/usr/include/c++/4.7/i686-linux-gnu/bits/gthr-default.h:886:74: Fehler: "__gthrw_pthread_cond_timedwait"
kann nicht als Funktion verwendet werden /usr/include/c++/4.7/i686-linux-gnu/bits/gthr-default.h:
In Funktion "int __gthread_cond_destroy(__gthread_cond_t*)": /usr/include/c++/4.7/i686-linux-gnu/bits/gthr-default.h:907:48:
Fehler: "__gthrw_pthread_cond_destroy" kann nicht als Funktion verwendet werden make[2]:
*** [CMakeFiles/brCore.dir/src/brConfig.cpp.o] Fehler 1 make[1]:
*** [CMakeFiles/brCore.dir/all] Fehler 2 make: *** [all] Fehler 2

It seems to me that the issue is invoked by the std::string include.
Here is my simple class:

#ifndef BINREV_CONFIG_H__
#define BINREV_CONFIG_H__

#include <string>   // compile fails here if I add JSON includes to CMAKE

namespace binrev{
namespace brCore{

class CORE_LIBRARY_API brConfig
{
   public:
     brConfig();    
     virtual ~brConfig();

};
}//ns-brCore
}//ns-binrev
#endif //BINREV_CONFIG_H__

I could build and compile my sources successfully on windows platform using MSYS/MinGW with GCC 4.5.0 and
MSVC 2010. Any idea what is going wrong?

0 Replies

Please log in or register to post a reply.

No replies have been made yet.