Git Product home page Git Product logo

Comments (22)

Zylann avatar Zylann commented on July 17, 2024

I compiled it recently for 2.1 master and it worked. I have no idea of what's going on in 2.2 Oo

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

I have no idea of what's going on in 2.2

@Zylann neither do I, of the 3 voxel terrain modules I've tried all have failed to compile in 2.2 with more or less the same error. I'll down grade to 2.1 later on tomorrow and see if that works

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

What do you call 2.2? I don't see this branch on Godot Github.

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

@Zylann Sorry about that, it seems to be 2.1 but for some reason the version godot reports is 2.2. The branch I cloned and compiled from (Which doesn't work with godot_voxel) is 2.1

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

@Zylann Just tried to compile with 2.0 and it fails with the same error

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

I'll try to compile it when I get back home

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

Aaaahhh I should have seen that from the beginning:

The error you get happens in modules/register_module_types.cpp:61:31.
This file is not part of my module, it's supposed to have been generated by SCons.

The voxel module is inside my register_module_types.cpp file, however for some reason, I also noticed another module I'm making doesn't appears as well in this file, and I have no idea why...
maybe something changed that made the module remain undetected?

I see the python code called by SCons finds modules if they match the following path pattern: "modules/"+x+"/register_types.h".
I din't see where is the problem :/

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

Got it: you have to name the module's folder "voxel", not "godot_voxel".

The reason why is that Godot SCons scripts are detecting the directory name as the module name. But of course the repo name doesn't matches, because I choosed it as... well, a Github repo name.
That's annoying, but it should fix your problem :)

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

@Zylann That has fixed the first issue but I've seem to have run into a new one. Now when I try to compile I get the following error

modules/voxel/voxel_terrain.cpp: In member function 'void VoxelTerrain::update_blocks()': modules/voxel/voxel_terrain.cpp:97:32: warning: unused variable 'err' [-Wunused-variable] Variant::CallError err; // wut ^ In file included from core/resource.h:35:0, from core/script_language.h:32, from ./scene/main/node.h:36, from modules/voxel/voxel_terrain.h:4, from modules/voxel/voxel_terrain.cpp:1: core/reference.h: In instantiation of 'void Ref<T>::unref() [with T = VoxelLibrary]': core/reference.h:308:8: required from 'Ref<T>::~Ref() [with T = VoxelLibrary]' modules/voxel/voxel_mesher.h:12:7: required from 'void memdelete(T*) [with T = VoxelMesher]' core/reference.h:292:13: required from 'void Ref<T>::unref() [with T = VoxelMesher]' core/reference.h:308:8: required from 'Ref<T>::~Ref() [with T = VoxelMesher]' modules/voxel/voxel_terrain.h:30:44: required from here core/reference.h:290:17: error: invalid use of incomplete type 'class VoxelLibrary' if (reference && reference->unreference()) { ^ In file included from modules/voxel/voxel_mesher.h:7:0, from modules/voxel/voxel_terrain.h:6, from modules/voxel/voxel_terrain.cpp:1: modules/voxel/voxel.h:6:7: note: forward declaration of 'class VoxelLibrary' class VoxelLibrary;

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

I deleted all .obj files and compiled again the module, I don't get this error :/
Maybe I have forgot to push some changes, I'll check that

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

@Zylann They aren't any objs in /modules

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

Yeah sorry I was talking about the binary files generated by the compiler, they are .o or .a with other ones.
Edit: same with a git reset to the latest repo's commit. No error...

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

@Zylann I deleted all .a and .o files from my godot dir and ran into the same issue when compiling

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

Yeah I just meant "I cleaned and build".
Anyways, I also tried to completely remove the module from my project, re-clone it from Github, compile it out of the box with the engine... and no error. There is something strange going on Oo
I'm using the Visual Studio compiler, btw.
I'm going to try cleaning everything including the engine itself, but I don't feel that will change much.

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

I'm going to reclone this and godot and see if it will build then

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

@Zylann It still fails to build. What platform are you building on and with what compiler?

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

I'm building on Windows with Visual Studio 2015. Well I just use the scons p=windows target=debug command.

It looks like your compiler is confused by this:

    // voxel_terrain.h
    Ref<VoxelMesher> get_mesher() { return _mesher; }

Because Ref is header-only, it tries to compile the case where the refcount becomes zero and deletes VoxelMesher. But VoxelMesher contains a Ref<VoxelLibrary>, which is forward-declared to avoid cyclic inclusion. So the destructor of VoxelLibrary is unknown at the time (but it definitely exists):

    error: invalid use of incomplete type 'class VoxelLibrary' 
        if (reference && reference->unreference()) { ^

I wonder if that's a compiler bug or if that's a real code issue :s
What happens if you prepend _FORCE_INLINE_ to get_mesher()? Not sure if it helps but could be worth trying. If it doesn't do anything, try to move the implementation to the .cpp file.

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

I tried building for windows using and got the same error and I tried building using clang and got a new error

core/reference.h:290:29: error: member access into incomplete type 'VoxelLibrary' if (reference && reference->unreference()) { ^ core/reference.h:308:3: note: in instantiation of member function 'Ref<VoxelLibrary>::unref' requested here unref(); ^ modules/voxel/voxel_mesher.h:12:7: note: in instantiation of member function 'Ref<VoxelLibrary>::~Ref' requested here class VoxelMesher : public Reference { ^ core/reference.h:292:4: note: in instantiation of function template specialization 'memdelete<VoxelMesher>' requested here memdelete(reference); ^ core/reference.h:87:3: note: in instantiation of member function 'Ref<VoxelMesher>::unref' requested here unref(); ^ core/reference.h:223:3: note: in instantiation of member function 'Ref<VoxelMesher>::ref' requested here ref(p_from); ^ modules/voxel/voxel_terrain.h:30:44: note: in instantiation of member function 'Ref<VoxelMesher>::Ref' requested here Ref<VoxelMesher> get_mesher() { return _mesher; } ^ modules/voxel/voxel.h:6:7: note: forward declaration of 'VoxelLibrary' class VoxelLibrary;

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

Yeah that's the same thing... did you tried to use inline or .cpp implementation?
Another try, put #include "voxel_library.h" as the last include in voxel_mesher.h? This one should do the trick, I verified and in fact I don't think it would cause cyclic inclusion.

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

What happens if you prepend FORCE_INLINE to get_mesher()?

Mind explaining what that is/how to do it? (I'm really not a C++ person)

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

Replace this line:

    Ref<VoxelMesher> get_mesher() { return _mesher; }

By this:

    _FORCE_INLINE_ Ref<VoxelMesher> get_mesher() { return _mesher; }

But I'm not sure on this one.

Try this first;
In voxel_mesher.h, add this after all the #includes:

#include "voxel_library.h"

from godot_voxel.

cyian-1756 avatar cyian-1756 commented on July 17, 2024

@Zylann That seems to have fixed it (Adding #include "voxel_library.h"), Godot compiles and runs. Thanks for the help!

from godot_voxel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.