My test with gxx-generater cannot work

I get the following when running test.sh, and I get a folder named simple_test_bindings with no files, I can find what it is wrong, I need help, thanks!

`DongdeMacBook-Pro:test mxl$ sudo ./test.sh
Password:
CLANG_ROOT: /Users/mxl/bin/clang+llvm-3.1
NDK_ROOT: /Users/mxl/bin/android-ndk
CXX_GENERATOR_ROOT: /Volumes/macdata/MyDev/tools/cxx-generator/cxx-generator/test/…
PYTHON_BIN: /opt/local/bin/python2.7
Generating bindings for simpletest with Android headers…

  • LD_LIBRARY_PATH=/Users/mxl/bin/clang+llvm-3.1/lib
  • /opt/local/bin/python2.7 /Volumes/macdata/MyDev/tools/cxx-generator/cxx-generator/test/…/generator.py /Volumes/macdata/MyDev/tools/cxx-generator/cxx-generator/test/…/test/test.ini -s testandroid -o ./simple_test_bindings
    Using userconfig
    [(‘androidndkdir’, ‘/DevTools/android/android-ndk-r8’), (‘clangllvmdir’, ‘/Volumes/macdata/MyDev/tools/clang+llvm-3.1/clang+llvm-3.1-x86_64-apple-darwin11’), (‘cxxgeneratordir’, ‘/Volumes/macdata/MyDev/tools/cxx-generator/cxx-generator’)]

… Generating bindings for target spidermonkey

… … Processing section testandroid

No option ‘classes_have_no_parents’ in section: ‘testandroid’
DongdeMacBook-Pro:test mxl$`

I had same problem yesterday: I just added this variable (with no value) in the .ini file and it worked

Great Philippe, you are right. But it cannot work until I delete all std::string. how do you deal with this string?
here is the log:

`Errors in parsing headers:

  1. <severity = Warning,
    location = <SourceLocation file None, line 0, column 0>,
    details = “argument unused during compilation: ‘-nostdinc++’”>
  2. <severity = Fatal,
    location = <SourceLocation file ‘/Volumes/macdata/MyDev/tools/cxx-generator/cxx-generator/test/simple_test/simple_class.h’, line 4, column 10>,
    details = “‘string’ file not found”>`

I had not this problem.
Check your paths, I think that “” definition can’t be found…

I download a new ndk and link it, it works!

Hi Philippe,

I am also facing the same problem but not able to understand your statement. Where do I need to add variable in .ini file and in which .ini file?

Philippe Bobis wrote:

I had same problem yesterday: I just added this variable (with no value) in the .ini file and it worked

@Paras: in the cxx-generator/test directory, you have a model of test.ini file (take a look at https://github.com/funkaster/cxx-generator)
Regards

Hi Philippe,

james helped me. It is working now.

Thanks,
Paras

Philippe Bobis wrote:

@Paras: in the cxx-generator/test directory, you have a model of test.ini file (take a look at https://github.com/funkaster/cxx-generator)
Regards

Hi Philippe,

What if I ’d like make SimpleNativeClass to be the subclass of cocos2d::CCNode? how can I do this? It will show me Errors as follow:

Errors in parsing headers:

  1. <severity = Warning,
    location = <SourceLocation file None, line 0, column 0>,
    details = “argument unused during compilation: ‘-nostdinc++’”>
  2. <severity = Fatal,
    location = <SourceLocation file ‘/Users/xiongzhend/Dev/bindings-generator-master/test/simple_test/SimpleLayer.h’, line 14, column 10>,
    details = “‘cocos2d.h’ file not found”>

Thanks.

hi @xiong zhen
‘cocos2d.h’ file not found" I got the same problem, have you solve it?

xiong zhen wrote:

Philippe Bobis wrote:
> @Paras: in the cxx-generator/test directory, you have a model of test.ini file (take a look at https://github.com/funkaster/cxx-generator)
> Regards
>
Hi Philippe,
>
What if I ’d like make SimpleNativeClass to be the subclass of cocos2d::CCNode? how can I do this? It will show me Errors as follow:
>
>
Errors in parsing headers:

  1. <severity = Warning,
    location = <SourceLocation file None, line 0, column 0>,
    details = “argument unused during compilation: ‘-nostdinc++’”>
  2. <severity = Fatal,
    location = <SourceLocation file ‘/Users/xiongzhend/Dev/bindings-generator-master/test/simple_test/SimpleLayer.h’, line 14, column 10>,
    details = “‘cocos2d.h’ file not found”>
    >
    >
    Thanks.

OK, I’ve solved this problem:http://cocos2d-x.org/boards/20/topics/31124
“refer to what has been done in ‘tools/tojs/cocos2dx.ini’”
照着tools/tojs/cocos2dx.ini写就OK啦~

Can you give the .ini file sample which can include “cocos2d.h”,
Thanks! :slight_smile:

FYI, bindings-generator uses c-libraries from ‘android-ndk’. It fetches include-headers from gnu-std-c lib which resides in android ndk, but there are many versions of std-c lib for each versions. For an example, android-ndk-r9c is shipped with std-lib for 4.6 and 4.8, not for 4.7. With my environment bindings-generator requires library for 4.7, so I cloned stdlib v4.8 as v4.7 and it is now working. :slight_smile: