lizh06 / ticpp

Automatically exported from code.google.com/p/ticpp
0 stars 0 forks source link

Problem compiling my program against TinyXML++ #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

#include<ticpp.h>

using namespace ticpp;

Then try and compile my program (specifically the particular source file in
my program that includes ticpp.h) using g++ v4.2.3 via the line:

g++ -o src/channellisthandler.o -c -O0 -Wall -g -Isrc -Iinclude
-I/usr/local/include -I/usr/local/lib -I/usr/include/ace
src/channellisthandler.cpp

What is the expected output? What do you see instead?

The expected result is for my program to compile successfully by g++
recognizing the ticpp namespace. Instead, I see:

src/channellisthandler.cpp: In member function ‘void
mcm::ChannelListHandler::loadChannelList()’:

src/channellisthandler.cpp:128: error: ‘ticpp’ has not been declared

src/channellisthandler.cpp:128: error: expected `;' before ‘xmldoc’

src/channellisthandler.cpp:129: error: ‘xmldoc’ was not declared in this 
scope

src/channellisthandler.cpp:131: error: expected type-specifier before 
‘ticpp’

src/channellisthandler.cpp:131: error: expected `)' before ‘:’ token

src/channellisthandler.cpp:131: error: expected `{' before ‘:’ token

src/channellisthandler.cpp:131: error: expected primary-expression before
‘:’ token

src/channellisthandler.cpp:131: error: expected `;' before ‘:’ token

src/channellisthandler.cpp:157: error: ‘ticpp’ has not been declared

src/channellisthandler.cpp:157: error: ‘pChannel’ was not declared in this
scope

src/channellisthandler.cpp:157: error: ‘xmldoc’ was not declared in this 
scope

src/channellisthandler.cpp:159: error: ‘ticpp’ has not been declared

src/channellisthandler.cpp:159: error: ‘ticpp’ has not been declared

src/channellisthandler.cpp:159: error: ‘childIt’ was not declared in this 
scope

src/channellisthandler.cpp:164: error: ‘ticpp’ has not been declared

src/channellisthandler.cpp:164: error: ‘pNumberElem’ was not declared in
this scope

src/channellisthandler.cpp:166: error: expected type-specifier before 
‘ticpp’

src/channellisthandler.cpp:166: error: expected `)' before ‘:’ token

src/channellisthandler.cpp:166: error: expected `{' before ‘:’ token

src/channellisthandler.cpp:166: error: expected primary-expression before
‘:’ token

src/channellisthandler.cpp:166: error: expected `;' before ‘:’ token

src/channellisthandler.cpp:172: error: ‘ticpp’ has not been declared

src/channellisthandler.cpp:172: error: ‘pNameElem’ was not declared in this
scope

src/channellisthandler.cpp:174: error: expected type-specifier before 
‘ticpp’

src/channellisthandler.cpp:174: error: expected `)' before ‘::’ token

src/channellisthandler.cpp:174: error: expected `{' before ‘::’ token

src/channellisthandler.cpp:174: error: ‘::Exception’ has not been declared

src/channellisthandler.cpp:174: error: ‘e’ was not declared in this scope

src/channellisthandler.cpp:174: error: expected `;' before ‘)’ token

src/channellisthandler.cpp:179: error: ‘pNumberElem’ was not declared in
this scope

src/channellisthandler.cpp:180: error: ‘pNameElem’ was not declared in this
scope

What version of the product are you using? On what operating system?

TinyXML++ v2.5.3 on Ubuntu Linux Hardy v8.04

Please provide any additional information below.

This problem seems to be baffling me. I have ticpp.h in /usr/include and it
definitely has the "namespace ticpp {}" definition in it. I'm not quite
sure why g++ won't recognize the ticpp namespace.

Original issue reported on code.google.com by james.ho...@gmail.com on 16 May 2008 at 8:53

GoogleCodeExporter commented 9 years ago
you need to #define TIXML_USE_TICPP before including ticpp.h
I often do this in a preprocessor define in project settings.

Original comment by rjmy...@gmail.com on 16 May 2008 at 10:45

GoogleCodeExporter commented 9 years ago
invalid conversion from ‘ticpp::Node*’ to ‘ticpp::Element*’

trying to get that example running!

    ticpp::Element* pem =  doc.FirstChildElement()->NextSibling();

invalid conversion from ‘ticpp::Node*’ to ‘ticpp::Element*’

Original comment by dirks...@googlemail.com on 17 May 2008 at 6:49

GoogleCodeExporter commented 9 years ago
rjmyst3: Thanks, that seemed to do the trick. Is that mentioned in any 
documentation?
If not, I think there should be a quick getting started guide which includes 
those
details. Thanks!

Original comment by james.ho...@gmail.com on 19 May 2008 at 1:05

GoogleCodeExporter commented 9 years ago
sounds like you should update the docs :)

Original comment by rjmy...@gmail.com on 21 May 2008 at 12:43