Hi Sam,
Yes it is possible! (Well, Ecere is Free Open Source Software, anything is possible -- Use the Source, Luke!)
But not only is it possible, it's even
relatively easy.
I suggest you create a new Configuration for your project that you call '
Static'.
Then in that configuration you need to replace 'ecere' by the name of a statically built Ecere library. By default the 'make install' installs a '
Vanilla' static library under Ecere SDK/lib:
ecereVanilla. This is a stripped down version of Ecere with the basic GUI functionality, but it doesn't include stuff like the 3D engine, networking, additional graphics file formats support (only supports bmp & pcx), to achieve a minimum file size. If you require additional functionality, you can build the 'Static' configuration of the Ecere runtime library, which includes everything (you can use the sdk/ecere/ecere.epj, and select the active configuration to build that from the IDE). Make sure you include e.g.
C:\Program Files (x86)\Ecere SDK\lib in the Global Settings dialog's Compilers/Directories/Libraries paths, I'm not sure whether the installer only adds 'bin' by default (Where the Dynamic library ecere.dll resides).
You will also need to add all the additional libraries that Ecere requires on the link line.
On Windows, for Vanilla this will be:
kernel32 user32 gdi32 winmm mpr imm32 zTo build your applications with the full-featured Ecere statically, you will need all the libraries.
On windows those are:
dxguid ddraw dinput winmm opengl32 ws2_32 kernel32 user32 gdi32 mpr advapi32 shell32 winspool imm32 ungif jpeg png z freetypeYou will also need to add to the Additional libraries paths each library's path in the sdk/deps folder.
For any platform you can find the full list of libraries required in the ecere.epj Linker tab.
Now if you want the built-in graphics of the Ecere library to work (icons etc.), you will need to add those as well as resources in your application, inside your project's
Resoures section, under a folder named '
ecere'. You can point those to the resources under sdk/ecere/res/vanilla/, the hierarchy should match exactly to that one. The vanilla resources are bmp files disguised as png because the Vanilla config doesn't include PNG support. If you use the full support version of the library, then you could include the real resources directly under sdk/ecere/res/.
Finally, in your application you need to replace 'import "ecere"' by 'import
static "ecere"'.
When using multiple configurations, I usually add a
ECERE_STATIC preprocessor definition (in the Project Settings/Compiler tab) for the Static configuration, and then in the code I write:
- Code: Select all
#ifdef ECERE_STATIC
import static "ecere"
#else
import "ecere"
#endif
I am hoping to simplify this whole process in the future, e.g. by having a simple checkbox in the project settings to link statically, or even providing a Static configuration by default. I'm not sure if we have a Mantis issue for this yet, you could register one as a feature if we don't
For now I added a '
staticLink' sample in the sdk/samples/eC/staticLink/ folder, you should get it if you do a pull on the sdk. It should be useful as a starting point for a new project with a Static configuration or as a reference. For the Ecere resources, it expects the SDK source folder to be on the same drive in the \sdk\ folder.
Please let me know if you're having any problem setting this up

All the best,
Jerome