From graygemail at gmail.com Wed Aug 10 08:28:32 2016 From: graygemail at gmail.com (greg) Date: Wed, 10 Aug 2016 14:28:32 +0200 Subject: [CastXML] Basic usage of castxml Message-ID: Hi, I am very new to Castxml. If i understand, it should generate a .xml from the C++ source code with a description of class name, arguments, functions,... ? My possible goal would be to wrap a C++ library to C#. Using the exported .xml to generate a C# wrapper generator. i have a test header file like this one: ---------------------------------------- #ifndef Test_H #define Test_H class Test { protected: int _variableInteger; public: Test() {_variableInteger = 51;}; ~Test() {}; }; #endif // Test_H ---------------------------------------- I tried to test it. I downloaded a binary version of Castxml here: https://midas3.kitware.com/midas/item/318228 Note: I have Visual Studio 2013 under Windows 7. I extracted it on C:\MyFolder i put my "test.h" file in: C:\MyFolder\CastXML\bin i tried this command line: castxml.exe --castxml-cc-msvc cl "Test.h" I have this error message: error: '--castxml-cc-msvc' compiler command failed: 'cl' '-c' '-FoNUL' 'C:\MyFolder\CastXML/share/castxml/detect_vs.cpp' Le fichier sp??cifi?? est introuvable What do i have to do to make it work ? Do i need to do other installation tasks before ? Do i need to build Castxml from source ? (why?) When i try: castxml.exe --version I have the result.: castxml version 0.1-gf1bb3c2 CastXML project maintained and supported by Kitware (kitware.com). clang version 3.8.0 (tags/RELEASE_380/final) Target: x86_64-pc-windows-msvc Thread model: posix InstalledDir: Is it normal to have "InstalledDir" empty ? Thanks. Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Wed Aug 10 08:40:40 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 10 Aug 2016 08:40:40 -0400 Subject: [CastXML] Basic usage of castxml In-Reply-To: References: Message-ID: <634b4155-ec79-a5e1-d778-bc6caf999818@kitware.com> On 08/10/2016 08:28 AM, greg wrote: > i tried this command line: > castxml.exe --castxml-cc-msvc cl "Test.h" > I have this error message: > > error: '--castxml-cc-msvc' compiler command failed: > > 'cl' '-c' '-FoNUL' 'C:\MyFolder\CastXML/share/castxml/detect_vs.cpp' > Le fichier sp??cifi?? est introuvable You need to run it from an environment where the `cl` compiler tool can run. Use something like "Visual Studio 2013 Command Prompt". -Brad From graygemail at gmail.com Wed Aug 10 08:53:02 2016 From: graygemail at gmail.com (greg) Date: Wed, 10 Aug 2016 14:53:02 +0200 Subject: [CastXML] Basic usage of castxml In-Reply-To: <634b4155-ec79-a5e1-d778-bc6caf999818@kitware.com> References: <634b4155-ec79-a5e1-d778-bc6caf999818@kitware.com> Message-ID: Thanks. castxml was lunched. I had this error: error: invalid argument '-std=c++11' not allowed with 'C/ObjC' To solve it i modify the file extension of "test.h" to "test.hpp". Now i have no error, but ... no message and no output. i tried: castxml.exe --castxml-cc-msvc cl "Test.hpp" -o "c:\myoutput.xml" but it doesn't work better. 2016-08-10 14:40 GMT+02:00 Brad King : > On 08/10/2016 08:28 AM, greg wrote: > > i tried this command line: > > castxml.exe --castxml-cc-msvc cl "Test.h" > > I have this error message: > > > > error: '--castxml-cc-msvc' compiler command failed: > > > > 'cl' '-c' '-FoNUL' 'C:\MyFolder\CastXML/share/castxml/detect_vs.cpp' > > Le fichier sp??cifi?? est introuvable > > You need to run it from an environment where the `cl` compiler tool > can run. Use something like "Visual Studio 2013 Command Prompt". > > -Brad > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Wed Aug 10 09:11:16 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 10 Aug 2016 09:11:16 -0400 Subject: [CastXML] Basic usage of castxml In-Reply-To: References: <634b4155-ec79-a5e1-d778-bc6caf999818@kitware.com> Message-ID: <3d6a9cd5-17d9-3bff-d376-983101fd5eb5@kitware.com> On 08/10/2016 08:53 AM, greg wrote: > Thanks. castxml was lunched. > I had this error: > error: invalid argument '-std=c++11' not allowed with 'C/ObjC' > To solve it i modify the file extension of "test.h" to "test.hpp". > Now i have no error, but ... no message and no output. > > i tried: > castxml.exe --castxml-cc-msvc cl "Test.hpp" -o "c:\myoutput.xml" > but it doesn't work better. See `castxml --help` for usage. You need to add the `--castxml-gccxml` option to activate output. -Brad From syamajala at gmail.com Mon Aug 15 09:48:26 2016 From: syamajala at gmail.com (Seshu Yamajala) Date: Mon, 15 Aug 2016 09:48:26 -0400 Subject: [CastXML] Can I get the value of a member variable in a constructor? Message-ID: Here is an example of some code I would like to parse: //test.hpp enum Type { TEST_TYPE = 0; }; class Test { private: int type; public: Test(); }; Test::Test() { type = TEST_TYPE; }; Is there a way to somehow get type = TEST_TYPE? The way I am currently doing it is to use pygccxml to get the line numbers of the constructor, read those lines in as a string and just look for type = something; -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Mon Aug 15 09:54:01 2016 From: brad.king at kitware.com (Brad King) Date: Mon, 15 Aug 2016 09:54:01 -0400 Subject: [CastXML] Can I get the value of a member variable in a constructor? In-Reply-To: References: Message-ID: On 08/15/2016 09:48 AM, Seshu Yamajala wrote: > Test::Test() > { > type = TEST_TYPE; > }; > > Is there a way to somehow get type = TEST_TYPE? No. No information about function bodies is included in the output. -Brad