Book a Demo

Author Topic: Problem reverse engineering C++ code  (Read 3099 times)

roberthauck

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Problem reverse engineering C++ code
« on: September 27, 2006, 03:05:49 am »
Hello

I have a c++ header file like that:

#ifndef XMLPARSER_H
#define XMLPARSER_H

struct SceneObject
{

   std::string objectname;
   
   SceneObject(std::string oname){objectname = oname;}

};

class XMLParser
{

public:

   XMLParser();
   ~XMLParser();

//General XML loading and writing
   bool WriteXMLFile(std::string filename);
};
#endif

If I import it into EA 6.5.797 I get the following error:

There was an error parsing XMLParser.h on line 41.  Unexpected symbol: SceneObject
You may need to define a language macro.

Line 41 is "struct SceneObject"

If I define a Preprocessor Macro, it gives me an error on the next line with the {.

Am I doing something wrong?

Thank you

Robert

Bokkie

  • EA User
  • **
  • Posts: 80
  • Karma: +0/-0
  • Lima Bravo!
    • View Profile
Re: Problem reverse engineering C++ code
« Reply #1 on: September 27, 2006, 05:24:37 am »
Hi Robert,

I've copied your code into a .h file, reversed engineered it to C++ and no errors where reported. Perhaps you should check your settings once more...

Regards, M.
Lima Bravo!

roberthauck

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem reverse engineering C++ code
« Reply #2 on: September 27, 2006, 05:36:49 am »
Hi

I found the error, I deleted code, just to show you the struct, but the error is actually at the line when I define the namespace for Xercec:

XERCES_CPP_NAMESPACE_USE

If I delete that line, it works without errors. I now made a Preprocessor Macro for that, and it imports the header file without errors. Is that the correct way of doing it? ???

Thank you for your help

Robert

Bokkie

  • EA User
  • **
  • Posts: 80
  • Karma: +0/-0
  • Lima Bravo!
    • View Profile
Re: Problem reverse engineering C++ code
« Reply #3 on: September 27, 2006, 05:40:54 am »
using namespace xercesc_2_7;
Lima Bravo!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile