0 votes

Why my C++ module works in Godot itself, but when I compile an application, it does not work? It says that such class does not exist.

asked Feb 9, 2017 in Engine by Kovalski (83 points)

1 Answer

+1 vote
Best answer

Because when Godot exports a game, it uses another binary which doesn't contain the editor and is compiled with optimizations. These binaries are in "export templates", which you probably have installed before exporting.

You already compiled your module for the editor. What you have to do is to also compile it in the export template you are using. I never did that myself yet, but you may find more info about your problem is this previous question: https://godotengine.org/qa/2044/export-problem-custom-godot-build

Basically I think you have to use this command:
scons platform=<your platform> tools=no target=release (platform is x11 for linux and windows for windows, I don't know for others)
And then copy the resulting binary at the same location as where your export templates are (.godot/templates (on Linux) or /AppDataRoaming/Godot/Templates on windows, maybe).

answered Feb 9, 2017 by Zylann (21,017 points)
selected Feb 9, 2017 by Kovalski

Thanks! It's works!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.