¿How i can reduce the c++ bindings library size?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By peeterdog

I making a simple plugin from godot engine docs c++ examples and after compiling it(and after resolve some stuff that is not pertinent here) i have a dll of 128MB for a single test class, so im not a pro on c++ but I think there must be a way to turn off some unused stuff in the linked(and mandatory) bindings library.

godot 3.2.2 stable on windows 7 32bits MinGW_64 compiler

if anybody answer please explain it step by step.
anticipated ty
sorry for the primitive english

related question here but without answer =(

peeterdog | 2020-07-30 22:28

:bust_in_silhouette: Reply From: nonunknown

ok, I’m starting with gdnative too, but as far as I know, there is no way to reduce this, I mean this DLL (windows) or SO (linux) contains a compilation of all godot classes necessary for a GDNative class to work.

In case if you are doing a plugin for public release, why not just share the .h** and cpp file with a tutorial on how to compile?

If you are doing a plugin for your game only, what you can do is follow the docs to reduce godot build size, so it will remove unused classes in your godot:

maybe you already know this doc, but for others who doesnt…
I’ve made one and reduced godot build size from 69 to 14MB
also this post from calinou helped me!

thanks bro, vey helpful.

peeterdog | 2020-07-31 11:18

:bust_in_silhouette: Reply From: peeterdog

AJAP!!! the SConstruct file is the rsponsable…
despite i’ve used target=release in my scons command line the link flag -s dont work, i tryed editing sconstruct file but is not for newbis so i decided to link the stuff appart for myself and my dll size is now s 1,8MB (was 128MB without strip).

Whe point here is that sconstruct file is the original from tutorial and is a crap. there are many Godot developers and i belive that somebody in the team can take a couple of free hours to improve the oficial docs, especially in c++ part(the most powerfull and difficult Godot feature)

I has many issues compiling the bindings an a lot more with the c++ plugin tutorial(old windows 32…third world you know =P), that is frustrating for newbies = less new godot users = less funding, …

.anyway …i love Godot engine and i hope to have soon a better documetation with more an better examples. not only in c++/nativescript.

for any newbie with problems i recomend dont give up, Godot worth it.

can you please post what you’ve done to archieve this?

nonunknown | 2020-07-31 11:54