godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.68k stars 509 forks source link

Can't generate cpp binding #124

Closed Elghat closed 6 years ago

Elghat commented 6 years ago

Hi i have a problem when i want to generate the cpp binding i Get this error

[gregoire@gregoire-pc` godot-cpp]$ scons godotbinpath="../godot_fork/bin/godot_binary" p=linux  
scons: Reading SConscript files ...
OSError: [Errno 2] No such file or directory:
  File "/home/gregoire/Desktop/Projet Godot 3.0/SimpleLibrary/godot-cpp/SConstruct", line 87:
    subprocess.call([os.path.expanduser(godot_bin_path), '--gdnative-generate-json-api', json_api_file])
  File "/usr/lib/python2.7/subprocess.py", line 168:
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 390:
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1025:
    raise child_exception

Os=Manjaro

garyo commented 6 years ago

Try ls -l ../godot_fork/bin/godot_binary; maybe that's not the actual godot binary. Does it run when you just start it directly as ../godot_fork/bin/godot_binary?

Elghat commented 6 years ago

This is what i get with ls -l ../godot_fork/bin/godot_binary

[gregoire@gregoire-pc godot-cpp]$ ls -l ../godot_fork/bin/godot_binary
ls: cannot access '../godot_fork/bin/godot_binary': No such file or directory
garyo commented 6 years ago

Indeed. You have to point that at your actual godot tools binary, wherever it is on your system.

Elghat commented 6 years ago

I tried your command in my 'godot' wich is the folder containing the engine and i tried it in my 'SimpleLibrary' folder but nothing

I don't have a folder named 'godot tools binary'

And i don't understand what you mean with 'You have to point that at your actual godot tools binary'

Sorry i'm a verry newbie at this so i'm trying to learn ^^

thankjura commented 6 years ago

Are you have godot application installed? for my case: make linux64 USE_CLANG=yes REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/usr/bin/godot.x11.tools.64.llvm

for your case: make linux64 USE_CLANG=yes REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/path/to/godot (specify path to the godot binary)

thankjura commented 6 years ago

You must firstly compile godot https://github.com/godotengine/godot

Elghat commented 6 years ago

I already compiled godot

thankjura commented 6 years ago

I already compiled godot

good! now you run: make linux64 USE_CLANG=yes REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/path/to/your/compiled/godot.binary

Elghat commented 6 years ago

This is what i get

[gregoire@gregoire-pc godot-cpp]$ make linux64 USE_CLANG=yes REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/home/gregoire/Public/Git/godot/bin/
scons n=godot-cpp use_llvm=yes regenerate_bindings=yes target=debug headers=../godot_headers godotbinpath=/home/gregoire/Public/Git/godot/bin/ -j4 p=linux a=64
scons: Reading SConscript files ...
OSError: [Errno 13] Permission denied:
  File "/home/gregoire/Desktop/Projet Godot 3.0/SimpleLibrary/godot-cpp/SConstruct", line 87:
    subprocess.call([os.path.expanduser(godot_bin_path), '--gdnative-generate-json-api', json_api_file])
  File "/usr/lib/python2.7/subprocess.py", line 168:
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 390:
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1025:
    raise child_exception
make: *** [Makefile:28: linux64] Error 2
thankjura commented 6 years ago

/home/gregoire/Public/Git/godot/bin/ - it's directory. You must specify path to binary file what is files in this directory?

Maybe /home/gregoire/Public/Git/godot/bin/godot.x11.tools.64.llvm ?

Elghat commented 6 years ago

The only file in the directory is godot.x11.tools.64.llvm

And when i make the command i get this error

make linux64 USE_CLANG=yes REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/home/gregoire/Public/Git/godot/bin/godot.x11.tools.64.llvm
scons n=godot-cpp use_llvm=yes regenerate_bindings=yes target=debug headers=../godot_headers godotbinpath=/home/gregoire/Public/Git/godot/bin/godot.x11.tools.64.llvm -j4 p=linux a=64
scons: Reading SConscript files ...
OSError: [Errno 2] No such file or directory:
  File "/home/gregoire/Desktop/Projet Godot 3.0/SimpleLibrary/godot-cpp/SConstruct", line 87:
    subprocess.call([os.path.expanduser(godot_bin_path), '--gdnative-generate-json-api', json_api_file])
  File "/usr/lib/python2.7/subprocess.py", line 168:
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 390:
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1025:
    raise child_exception
make: *** [Makefile:28: linux64] Error 2
thankjura commented 6 years ago

../godot_headers directory exists? run:

ls -alh ../godot_headers

from godot-cpp folder

thankjura commented 6 years ago

try this:

make linux64 USE_CLANG=yes HEADERS=/home/gregoire/Public/Git/godot/modules/gdnative/include/ REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/home/gregoire/Public/Git/godot/bin/godot.x11.tools.64.llvm

Elghat commented 6 years ago

i get this

[gregoire@gregoire-pc godot-cpp]$ ls -alh ../godot_headers
total 284K
drwxr-xr-x 8 gregoire gregoire 4,0K  8 avr 22:39 .
drwxr-xr-x 6 gregoire gregoire 4,0K  8 avr 22:39 ..
drwxr-xr-x 2 gregoire gregoire 4,0K  8 avr 22:39 arvr
drwxr-xr-x 2 gregoire gregoire 4,0K  8 avr 22:39 gdnative
-rw-r--r-- 1 gregoire gregoire 163K  8 avr 22:39 gdnative_api.json
-rw-r--r-- 1 gregoire gregoire  73K  8 avr 22:39 gdnative_api_struct.gen.h
drwxr-xr-x 8 gregoire gregoire 4,0K  8 avr 22:39 .git
drwxr-xr-x 3 gregoire gregoire 4,0K  8 avr 22:39 images
-rw-r--r-- 1 gregoire gregoire 1,1K  8 avr 22:39 LICENSE
drwxr-xr-x 2 gregoire gregoire 4,0K  8 avr 22:39 nativescript
drwxr-xr-x 2 gregoire gregoire 4,0K  8 avr 22:39 pluginscript
-rw-r--r-- 1 gregoire gregoire 6,0K  8 avr 22:39 README.md
thankjura commented 6 years ago

Hm. This file /home/gregoire/Public/Git/godot/bin/godot.x11.tools.64.llvm exist? run ls -al /home/gregoire/Public/Git/godot/bin/

Elghat commented 6 years ago

I have the file but i'ts not "/home/gregoire/Public/Git/godot/bin/godot.x11.tools.64.llvm" i'ts /home/gregoire/Public/Git/godot/bin/godot.x11.tools.64

[gregoire@gregoire-pc godot-cpp]$ ls -al /home/gregoire/Public/Git/godot/bin/godot.x11.tools.64
-rwxr-xr-x 1 gregoire gregoire 201079112  6 avr 22:53 /home/gregoire/Public/Git/godot/bin/godot.x11.tools.64
thankjura commented 6 years ago

correct path: make linux64 USE_CLANG=yes REGENERATE_BINDINGS=yes GODOT_BIN_PATH=/home/gregoire/Public/Git/godot/bin/godot.x11.tools.64

Elghat commented 6 years ago

seems worked

ranlib bin/libgodot-cpp.linux.64.a
scons: done building targets.
[gregoire@gregoire-pc godot-cpp]$