Creating a new actuator linker errors

Hi all,

I’m trying to figure out how to add an new actuator to the BGE. I’ve managed to workout how to get a new actuator and add it to an object. Now I’m working on the actual code for the actuator. I’ve created the header and source for it and written the basic class based on what other actuators have done. I’ve added a new case to ConvertActuators.cpp for my new actuator. Again, copying the basics from previous actuators. I’ve also added KX_TEST_ACT to enum KX_ACTUATOR_TYPE. The only thing my actuator class gets passed at the moment is the game object. I’ve also added the .cpp and .h files to CMakeList.txt in the blender/source/gameengine/GameLogic/. However, when I compile I get the following error:

collect2: Id returned 1 exit status
No file found

Here’s the build output:


Linking CXX executable ..\..\bin\blender.exe
Creating library file: ..\..\bin\libblender.dll.a
..\..\lib\libge_logic.a(SCA_TestActuator.cpp.obj):SCA_TestActuator.cpp:(.text$_ZN16SCA_TestActuator7GetTypeEv[SCA_TestActuator::GetType()]+0x1): undefined reference to `SCA_TestActuator::Type'
..\..\lib\libge_logic.a(SCA_TestActuator.cpp.obj):SCA_TestActuator.cpp:(.text$_ZN16SCA_TestActuator8NewProxyEb[SCA_TestActuator::NewProxy(bool)]+0x18): undefined reference to `SCA_TestActuator::Type'
..\..\lib\libge_logic.a(SCA_TestActuator.cpp.obj):SCA_TestActuator.cpp:(.text$_ZN16SCA_TestActuator8GetProxyEv[SCA_TestActuator::GetProxy()]+0xf): undefined reference to `SCA_TestActuator::Type'
collect2: ld returned 1 exit status
mingw32-make.exe[2]: *** [bin/blender.exe] Error 1
mingw32-make.exe[1]: *** [source/creator/CMakeFiles/blender.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
18:08:34: The process "C:\MinGW\bin\mingw32-make.exe" exited with code 2.
Error while building project Blender (target: Desktop)
When executing build step 'Make'

There is no declaration or implementation of TestActuator::Type in my new actuator class, so I don’t know where this error is coming from. Furthermore, I can’t find anything in the other actuators source relating to ::Type. None of the others seem to define it as part of their class. I figure I’m missing something, but I can’t find what it is.

Any help/suggestions would be much appreciated. Thank you :smiley:

Nevermind, I’m just being dumb! Actuator::Test is part of the Python interface. I’d added Py_Header to the class but not defined any of the Python interface. I wonder why Qt didn’t return anything when I searched for PropertyActuator::Type? Odd.