Invalid use of incomplete type compilation error


#1

Hi, I just downloaded the last version of bsf from github and got the compilation of invalid use of type in the Linux environment. I used it to build the last version with no problem.

Is there any specific switch to configure in cmake to get pass this error? I am using the latest version of g++ (ver 7.3.0) and clang (6.0.1).

The complete error message I got:
[ 86%] Building CXX object Source/Plugins/bsfRenderBeast/CMakeFiles/bsfRenderBeast.dir/BsRenderBeast.cpp.o
In file included from /home/tangth/bsfdev/bsf/Source/Foundation/bsfUtility/Prerequisites/BsPrerequisitesUtil.h:286:0,
from /home/tangth/bsfdev/bsf/Source/Foundation/bsfCore/BsCorePrerequisites.h:5,
from /home/tangth/bsfdev/bsf/Source/Foundation/bsfEngine/BsPrerequisites.h:5,
from /home/tangth/bsfdev/bsf/Source/Plugins/bsfRenderBeast/BsRenderBeastPrerequisites.h:5,
from /home/tangth/bsfdev/bsf/Source/Plugins/bsfRenderBeast/BsRenderBeast.h:5,
from /home/tangth/bsfdev/bsf/Source/Plugins/bsfRenderBeast/BsRenderBeast.cpp:3:
/home/tangth/bsfdev/bsf/Source/Foundation/bsfUtility/Allocators/BsMemoryAllocator.h: In instantiation of ‘void bs::bs_delete(T*) [with T = bs::ct::GpuParticleSimulation::Pimpl; Alloc = bs::GenAlloc]’:
/home/tangth/bsfdev/bsf/Source/Plugins/bsfRenderBeast/Shading/BsGpuParticleSimulation.h:133:13: required from here
/home/tangth/bsfdev/bsf/Source/Foundation/bsfUtility/Allocators/BsMemoryAllocator.h:267:11: error: invalid use of incomplete type ‘struct bs::ct::GpuParticleSimulation::Pimpl’
(ptr)->~T();

In file included from /home/tangth/bsfdev/bsf/Source/Plugins/bsfRenderBeast/BsRenderBeast.cpp:35:0:
/home/tangth/bsfdev/bsf/Source/Plugins/bsfRenderBeast/Shading/BsGpuParticleSimulation.h:101:10: note: forward declaration of ‘struct bs::ct::GpuParticleSimulation::Pimpl’
struct Pimpl;
       ^~~~~
Source/Plugins/bsfRenderBeast/CMakeFiles/bsfRenderBeast.dir/build.make:62: recipe for target 'Source/Plugins/bsfRenderBeast/CMakeFiles/bsfRenderBeast.dir/BsRenderBeast.cpp.o' failed
make[2]: *** [Source/Plugins/bsfRenderBeast/CMakeFiles/bsfRenderBeast.dir/BsRenderBeast.cpp.o] Error 1
CMakeFiles/Makefile2:292: recipe for target 'Source/Plugins/bsfRenderBeast/CMakeFiles/bsfRenderBeast.dir/all' failed
make[1]: *** [Source/Plugins/bsfRenderBeast/CMakeFiles/bsfRenderBeast.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

#2

I compared the latest version with the last version I have.
The file, BsGpuParticleSimulation.h is not there in the last version.


#3

This was a broken commit which didn’t compile on GCC, it’s fixed now.


#4

thanks for the quick response and fix. Now it compiles with no errors in my Linux machine.