+2 votes

The size of gdnative plugin for very simple cpp script is very large ( > 70 mb).
How to reduce it and is it safe to use -s and -g flags ?

asked Apr 3 in Engine by supper_raptor (667 points)

1 Answer

+1 vote

One way could be compile for release instead of debug, but, oh! 70 mb is very very large! maybe you are confusing the dynamic library with the static library which includes all the functions and not just the needed ones, because when I get the dynamic library it only weights 4.7 mb and that is just what it needs to include in the godot project.

answered Jun 29 by abrajam (31 points)

I get 4.7 mb for android and 70 mb for linux and windows.

You are not compiling right, I tried with ndk-build and I have 3.6 mb for the .so library, you are doing something wrong.

i have the same problem but my gdnative dynamic dll for windos is 128MB size, im using goot 3.2.2 stable in windows 7 32bits and MingW_64 . i asked here for some hint to reduce c++ bindings static libary size that in my case is about 140MB, because i think there are relationship betwen both sizes and the link phase(im beginer in c++) , so any tip about compilation would be great too.

UPDATE Checkout the scostruct file and add/edit the -strip/-s link flag, i resolved the problem linking manually in Mingw with -s flag and size decreased in 95%, i dont know in VS...

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.