Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build with latest godot git version... #1

Closed
hradec opened this issue Nov 22, 2017 · 4 comments · Fixed by #2
Closed

Can't build with latest godot git version... #1

hradec opened this issue Nov 22, 2017 · 4 comments · Fixed by #2

Comments

@hradec
Copy link

hradec commented Nov 22, 2017

I'm getting this error:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o src/godot_openhmd.os -c -DOHMD_STATIC -DDRIVER_OCULUS_RIFT -DDRIVER_DEEPOON -DDRIVER_HTC_VIVE -DDRIVER_PSVR -DDRIVER_NOLO -fPIC -g -O3 -std=c++14 -fPIC -DOHMD_STATIC -Ilibusb -Ilibusb/libusb -Ilibusb/libusb/os -Ihidapi/hidapi -Iopenhmd/include -I. -I/RAID/atomo/home/rhradec/dev/godot.git/modules/gdnative/include -Iglad src/godot_openhmd.c
cc1: warning: command line option '-std=c++14' is valid for C++/ObjC++ but not for C
src/godot_openhmd.c: In function 'get_openhmd_data':
src/godot_openhmd.c:47:21: error: 'godot_gdnative_api_struct {aka const struct godot_gdnative_api_struct}' has no member named 'godot_alloc'
   openhmd_data = api->godot_alloc(sizeof(openhmd_data_struct));
                     ^~
src/godot_openhmd.c: In function 'release_openhmd_data':
src/godot_openhmd.c:75:7: error: 'godot_gdnative_api_struct {aka const struct godot_gdnative_api_struct}' has no member named 'godot_free'
    api->godot_free(openhmd_data);

examining the godot headers, the godot_alloc() is indeed defined there... so not sure what's going on!

I'll keep digging, but any help would be greatly appreciated!

cheers...
-H

@BastiaanOlij
Copy link
Member

Hey @hradec , there are a bunch of changes that went through in the last week or so that I need to update in this project.

One thing that is very important and possibly the cause of your particular issue is that the headers in the godot_header repo are outdated. They will hopefully be updated soon now that Godot 3 has gone into feature freeze. Assuming you are building Godot 3 from source as well you can set an environment variable to point to \modules\gdnative\include

Other then that the tres file needs to be replaced by a gdnlib file that is structured differently, I've done this for the openvr repo already though I'm still having some issues with it crashing on the objects it exposes. Hope to have that fixed sometime this week.

@hradec
Copy link
Author

hradec commented Nov 22, 2017

Before anything, thanks for the quick reply!!! really appreciate!! :)

Yep, I'm building from godot 3.0.

Actually, this error is happening after I've updated the godot_headers_path to the proper include path of my godot 3.0 folder, in the SConstruct file, like this:

godot_headers_path = ARGUMENTS.get("headers", "../godot.git/modules/gdnative/include")

So, it seens it's not only that.

I was able to get it to compile further by adding this to the ./src/godot_openhmd.c file:

#define godot_gdnative_api_struct godot_gdnative_core_api_struct

since it seens the godot_gdnative_core_api_struct is the one that holds godot_alloc and others.

but then I got more errors:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o src/godot_openhmd.os -c -DOHMD_STATIC -DDRIVER_OCULUS_RIFT -DDRIVER_DEEPOON -DDRIVER_HTC_VIVE -DDRIVER_PSVR -DDRIVER_NOLO -fPIC -g -O3 -std=c++14 -fPIC -DOHMD_STATIC -Ilibusb -Ilibusb/libusb -Ilibusb/libusb/os -Ihidapi/hidapi -Iopenhmd/include -I. -I/RAID/atomo/home/rhradec/dev/godot.git/modules/gdnative/include -Iglad src/godot_openhmd.c
cc1: warning: command line option '-std=c++14' is valid for C++/ObjC++ but not for C
src/godot_openhmd.c: In function 'openhmd_close_controller_device':
src/godot_openhmd.c:216:8: error: 'godot_gdnative_core_api_struct {aka const struct godot_gdnative_core_api_struct}' has no member named 'godot_arvr_remove_controller'; did you mean 'godot_color_contrasted'?
   api->godot_arvr_remove_controller(openhmd_data->controller_tracker_mapping[p_index].tracker);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
        godot_color_contrasted

and it seems the godot_arvr_remove_controller is not in the godot_gdnative_core_api_struct... so I would guess that godot 3.0 has splitted the functionality into 2 or more structures?

I'll keep digging (as time permits), since I can't wait to get my DK1 to work in godot 3.0!

If you have any more pointers to share, maybe I can get this working for you! ;)

anyhow, thanks loads for this driver anyway!! really cool!!!

cheers...
-H

@BastiaanOlij
Copy link
Member

Yes a number of things were renamed very recently.

Have a look at the most recent changes to godot_openvr:
https://github.com/BastiaanOlij/godot_openvr/blob/render_components/src/godot_openvr.cpp

You'll see the API struct has been broken up into 3 parts which now need to be initialised.
I changed the prefix here to see if that fixed an issue I was dealing with, you actually set this prefix in the new gdnlib file:
https://github.com/BastiaanOlij/godot_openvr/blob/render_components/demo/bin/godot_openvr.gdnlib
It can stay godot_ or we can also rename it for openhmd.

The godot_openhmd.tres file needs to be similarly changed to a gdnlib file with that new layout.

I need to find time to do the final refactoring changes to the openvr implementation so I know what I still need to change and retrofit the same changes here and to the reference implementation. But yeah if you have some time that be good. There are more changes then this, Karroffel and Endragor have been doing a lot of changes to make GDNative libraries deployable on iOS and android

@BastiaanOlij
Copy link
Member

See PR #2, that should fix the issues. I haven't tested it other then checking if it'll run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants