Page 1 of 1

Static linking

Posted: Tue Jul 10, 2007 22:29
by Pompei2
I see you have implemented the option to build CEGUI as a static lib. I tested it and it works ! :D that's great, I was waiting for this a long time (and I'm not the only one !). The only thing I had to figure out is that I need to add all the dependencies libs to my project, what I did not need to do when linking to the CEGUI dlls.

Good Job guys, I like this ;)

Posted: Wed Jul 11, 2007 06:59
by scriptkid
Hi,

glad you like it :) There was supposted to be a nice post about some of the latest additions, but appearantly that hasn't happened yet. There is also a working tree control now for example.

About your linking probleme: aren't the .libs correctly set after running the premake batch file?

Bye,

Posted: Wed Jul 11, 2007 09:52
by Pompei2
All is correctly set. I think it's not a problem, just a fact that you have to find out: when you use CEGUI libs statically you have to link the dependencies libs to your project too (pcre, freetype etc.) I just wrote it here so if someone searches the forum about this he can find it ;)

edit: Yes I saw the tree, unfortunately the demo doesn't seem to be compiled (on linux), There seem to be no makefiles for it.

Here is a patch to let it compile. For linking and makefiles, I don't know how to make them work :)

Code: Select all

--- Sample_TreeDemo.cpp.bak     2007-07-11 11:59:19.000000000 +0200
+++ Sample_TreeDemo.cpp 2007-07-11 12:02:48.000000000 +0200
@@ -11,7 +11,7 @@
 #include "windows.h"
 #include <mmsystem.h>
 #include <time.h>
-
+#endif

 const unsigned int TreeDemoSample::TreeID    = 1;
 const unsigned int TreeDemoSample::EditBoxID = 2;
@@ -40,7 +40,7 @@
 // int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)
 // #else
 int main(int argc, char *argv[])
-#endif
+// #endif
    {
    // This is a basic start-up for the sample application which is
    // object orientated in nature, so we just need an instance of
@@ -54,11 +54,11 @@
 int randInt(int low, int high)
    {
    int   num;
-   DWORD range;
+   size_t range;

    range = high - low + 1;
    if (range > RAND_MAX)
-      num = (int)(((DWORD)rand() * (DWORD)rand()) % range);
+      num = (int)(((size_t)rand() * (size_t)rand()) % range);
    else
       num = (rand()) % range;