You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
macbook-pro:Jzon v2-0 will$ g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
g++ -Wall -I. jsonWriterMain.cpp Jzon.cpp -o jsonWriter
In file included from jsonWriterMain.cpp:4:
Jzon.h:42: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::TypeException::TypeException()’:
Jzon.h:44: error: expected class-name before ‘(’ token
Jzon.h: At global scope:
Jzon.h:48: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::ValueException::ValueException()’:
Jzon.h:50: error: expected class-name before ‘(’ token
Jzon.h: At global scope:
Jzon.h:54: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::NotFoundException::NotFoundException()’:
Jzon.h:56: error: expected class-name before ‘(’ token
Jzon.h: In member function ‘virtual bool Jzon::Node::Has(const std::string&) const’:
Jzon.h:110: warning: statement has no effect
Jzon.h: In member function ‘virtual Jzon::Node& Jzon::Node::Get(const std::string&) const’:
Jzon.h:112: warning: statement has no effect
Jzon.h: In member function ‘virtual Jzon::Node& Jzon::Node::Get(size_t) const’:
Jzon.h:113: warning: statement has no effect
/usr/include/c++/4.2.1/bits/stl_pair.h: At global scope:
/usr/include/c++/4.2.1/bits/stl_pair.h: In instantiation of ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>’:
Jzon.h:208: instantiated from here
/usr/include/c++/4.2.1/bits/stl_pair.h:84: error: forming reference to reference type ‘Jzon::Node&’
Jzon.h: In member function ‘Jzon::NamedNode Jzon::Object::iterator::operator_()’:
Jzon.h:208: error: no matching function for call to ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(std::basic_string<char, std::char_traits, std::allocator >&, Jzon::Node&)’
/usr/include/c++/4.2.1/bits/stl_pair.h:80: note: candidates are: std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string<char, std::char_traits, std::allocator >, T2 = Jzon::Node&]
/usr/include/c++/4.2.1/bits/stl_pair.h:69: note: std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>&)
Jzon.h: In member function ‘const Jzon::NamedNode Jzon::Object::const_iterator::operator()’:
Jzon.h:225: error: no matching function for call to ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::basic_string<char, std::char_traits, std::allocator >&, Jzon::Node&)’
/usr/include/c++/4.2.1/bits/stl_pair.h:80: note: candidates are: std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string<char, std::char_traits, std::allocator >, T2 = Jzon::Node&]
/usr/include/c++/4.2.1/bits/stl_pair.h:69: note: std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>&)
In file included from Jzon.cpp:22:
Jzon.h:42: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::TypeException::TypeException()’:
Jzon.h:44: error: expected class-name before ‘(’ token
Jzon.h: At global scope:
Jzon.h:48: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::ValueException::ValueException()’:
Jzon.h:50: error: expected class-name before ‘(’ token
Jzon.h: At global scope:
Jzon.h:54: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::NotFoundException::NotFoundException()’:
Jzon.h:56: error: expected class-name before ‘(’ token
Jzon.h: In member function ‘virtual bool Jzon::Node::Has(const std::string&) const’:
Jzon.h:110: warning: statement has no effect
Jzon.h: In member function ‘virtual Jzon::Node& Jzon::Node::Get(const std::string&) const’:
Jzon.h:112: warning: statement has no effect
Jzon.h: In member function ‘virtual Jzon::Node& Jzon::Node::Get(size_t) const’:
Jzon.h:113: warning: statement has no effect
/usr/include/c++/4.2.1/bits/stl_pair.h: At global scope:
/usr/include/c++/4.2.1/bits/stl_pair.h: In instantiation of ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>’:
Jzon.h:208: instantiated from here
/usr/include/c++/4.2.1/bits/stl_pair.h:84: error: forming reference to reference type ‘Jzon::Node&’
Jzon.h: In member function ‘Jzon::NamedNode Jzon::Object::iterator::operator()’:
Jzon.h:208: error: no matching function for call to ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(std::basic_string<char, std::char_traits, std::allocator >&, Jzon::Node&)’
/usr/include/c++/4.2.1/bits/stl_pair.h:80: note: candidates are: std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string<char, std::char_traits, std::allocator >, T2 = Jzon::Node&]
/usr/include/c++/4.2.1/bits/stl_pair.h:69: note: std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>&)
Jzon.h: In member function ‘const Jzon::NamedNode Jzon::Object::const_iterator::operator()’:
Jzon.h:225: error: no matching function for call to ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::basic_string<char, std::char_traits, std::allocator >&, Jzon::Node&)’
/usr/include/c++/4.2.1/bits/stl_pair.h:80: note: candidates are: std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string<char, std::char_traits, std::allocator >, _T2 = Jzon::Node&]
/usr/include/c++/4.2.1/bits/stl_pair.h:69: note: std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>&)
Jzon.h: In constructor ‘Jzon::Writer::Writer(const Jzon::Node&, const Jzon::Format&)’:
Jzon.h:380: warning: ‘Jzon::Writer::root’ will be initialized after
Jzon.h:378: warning: ‘Jzon::FormatInterpreter* Jzon::Writer::fi’
Jzon.cpp:843: warning: when initialized here
Jzon.h: In constructor ‘Jzon::Writer::Writer(const Jzon::Node&, const std::string&, const Jzon::Format&)’:
Jzon.h:380: warning: ‘Jzon::Writer::root’ will be initialized after
Jzon.h:378: warning: ‘Jzon::FormatInterpreter* Jzon::Writer::fi’
Jzon.cpp:847: warning: when initialized here
Jzon.cpp: In member function ‘bool Jzon::Parser::assemble()’:
Jzon.cpp:1060: warning: enumeration value ‘T_SEPARATOR_NODE’ not handled in switch
Jzon.cpp:1060: warning: enumeration value ‘T_SEPARATOR_NAME’ not handled in switch
The text was updated successfully, but these errors were encountered:
I am getting this compilation error with g++. And my main.cpp is the example for this link: http://code.google.com/p/jzon/wiki/WritingFiles
My g++ version output is:
macbook-pro:Jzon v2-0 will$ g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
g++ -Wall -I. jsonWriterMain.cpp Jzon.cpp -o jsonWriter
In file included from jsonWriterMain.cpp:4:
Jzon.h:42: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::TypeException::TypeException()’:
Jzon.h:44: error: expected class-name before ‘(’ token
Jzon.h: At global scope:
Jzon.h:48: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::ValueException::ValueException()’:
Jzon.h:50: error: expected class-name before ‘(’ token
Jzon.h: At global scope:
Jzon.h:54: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::NotFoundException::NotFoundException()’:
Jzon.h:56: error: expected class-name before ‘(’ token
Jzon.h: In member function ‘virtual bool Jzon::Node::Has(const std::string&) const’:
Jzon.h:110: warning: statement has no effect
Jzon.h: In member function ‘virtual Jzon::Node& Jzon::Node::Get(const std::string&) const’:
Jzon.h:112: warning: statement has no effect
Jzon.h: In member function ‘virtual Jzon::Node& Jzon::Node::Get(size_t) const’:
Jzon.h:113: warning: statement has no effect
/usr/include/c++/4.2.1/bits/stl_pair.h: At global scope:
/usr/include/c++/4.2.1/bits/stl_pair.h: In instantiation of ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>’:
Jzon.h:208: instantiated from here
/usr/include/c++/4.2.1/bits/stl_pair.h:84: error: forming reference to reference type ‘Jzon::Node&’
Jzon.h: In member function ‘Jzon::NamedNode Jzon::Object::iterator::operator_()’:
Jzon.h:208: error: no matching function for call to ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(std::basic_string<char, std::char_traits, std::allocator >&, Jzon::Node&)’
/usr/include/c++/4.2.1/bits/stl_pair.h:80: note: candidates are: std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string<char, std::char_traits, std::allocator >, T2 = Jzon::Node&]
/usr/include/c++/4.2.1/bits/stl_pair.h:69: note: std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>&)
Jzon.h: In member function ‘const Jzon::NamedNode Jzon::Object::const_iterator::operator()’:
Jzon.h:225: error: no matching function for call to ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::basic_string<char, std::char_traits, std::allocator >&, Jzon::Node&)’
/usr/include/c++/4.2.1/bits/stl_pair.h:80: note: candidates are: std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string<char, std::char_traits, std::allocator >, T2 = Jzon::Node&]
/usr/include/c++/4.2.1/bits/stl_pair.h:69: note: std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>&)
In file included from Jzon.cpp:22:
Jzon.h:42: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::TypeException::TypeException()’:
Jzon.h:44: error: expected class-name before ‘(’ token
Jzon.h: At global scope:
Jzon.h:48: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::ValueException::ValueException()’:
Jzon.h:50: error: expected class-name before ‘(’ token
Jzon.h: At global scope:
Jzon.h:54: error: expected class-name before ‘{’ token
Jzon.h: In constructor ‘Jzon::NotFoundException::NotFoundException()’:
Jzon.h:56: error: expected class-name before ‘(’ token
Jzon.h: In member function ‘virtual bool Jzon::Node::Has(const std::string&) const’:
Jzon.h:110: warning: statement has no effect
Jzon.h: In member function ‘virtual Jzon::Node& Jzon::Node::Get(const std::string&) const’:
Jzon.h:112: warning: statement has no effect
Jzon.h: In member function ‘virtual Jzon::Node& Jzon::Node::Get(size_t) const’:
Jzon.h:113: warning: statement has no effect
/usr/include/c++/4.2.1/bits/stl_pair.h: At global scope:
/usr/include/c++/4.2.1/bits/stl_pair.h: In instantiation of ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>’:
Jzon.h:208: instantiated from here
/usr/include/c++/4.2.1/bits/stl_pair.h:84: error: forming reference to reference type ‘Jzon::Node&’
Jzon.h: In member function ‘Jzon::NamedNode Jzon::Object::iterator::operator()’:
Jzon.h:208: error: no matching function for call to ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(std::basic_string<char, std::char_traits, std::allocator >&, Jzon::Node&)’
/usr/include/c++/4.2.1/bits/stl_pair.h:80: note: candidates are: std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string<char, std::char_traits, std::allocator >, T2 = Jzon::Node&]
/usr/include/c++/4.2.1/bits/stl_pair.h:69: note: std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>&)
Jzon.h: In member function ‘const Jzon::NamedNode Jzon::Object::const_iterator::operator()’:
Jzon.h:225: error: no matching function for call to ‘std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::basic_string<char, std::char_traits, std::allocator >&, Jzon::Node&)’
/usr/include/c++/4.2.1/bits/stl_pair.h:80: note: candidates are: std::pair<_T1, _T2>::pair() [with _T1 = std::basic_string<char, std::char_traits, std::allocator >, _T2 = Jzon::Node&]
/usr/include/c++/4.2.1/bits/stl_pair.h:69: note: std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>::pair(const std::pair<std::basic_string<char, std::char_traits, std::allocator >, Jzon::Node&>&)
Jzon.h: In constructor ‘Jzon::Writer::Writer(const Jzon::Node&, const Jzon::Format&)’:
Jzon.h:380: warning: ‘Jzon::Writer::root’ will be initialized after
Jzon.h:378: warning: ‘Jzon::FormatInterpreter* Jzon::Writer::fi’
Jzon.cpp:843: warning: when initialized here
Jzon.h: In constructor ‘Jzon::Writer::Writer(const Jzon::Node&, const std::string&, const Jzon::Format&)’:
Jzon.h:380: warning: ‘Jzon::Writer::root’ will be initialized after
Jzon.h:378: warning: ‘Jzon::FormatInterpreter* Jzon::Writer::fi’
Jzon.cpp:847: warning: when initialized here
Jzon.cpp: In member function ‘bool Jzon::Parser::assemble()’:
Jzon.cpp:1060: warning: enumeration value ‘T_SEPARATOR_NODE’ not handled in switch
Jzon.cpp:1060: warning: enumeration value ‘T_SEPARATOR_NAME’ not handled in switch
The text was updated successfully, but these errors were encountered: