NetBeans v6.0 C/C++ and Dependencies from Source

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

NetBeans v6.0 C/C++ and Dependencies from Source

Postby Rackle » Fri Jan 04, 2008 06:44

There are many C/C++ programming environment. Here's yet another but it does not yet compile Cegui. This first post will contain the steps I've taken so far; it'll be updated as solutions are found.

Note that I'm specifying my personal directories rather than generic directories. This allows me to more easily relay the information. Once the complete solution is found a nicer document will be presented.



Netbeans
Read the C/C++ Application Learning Trail to activate C/C++ within Netbeans. It contains links to download the latest version of Netbeans as well as all the necessary steps to activate the C/C++ module. You must be able to compile a simple "Hello World" or the "Welcome" project from "File > New Project > Samples > C/C++ > C/C++ > Welcome" within Netbeans before moving to the next step.

Create a project group
From the Netbeans menu: File > Project Group > New Group
Specify the Name: Cegui Dependencies
Select the "Free Group" option
Uncheck the option:
* Use currently Open Projects



Freeglut
SVN checkout into the directory: "C:\Programming\Libraries\freeglut"
https://freeglut.svn.sourceforge.net/sv ... t/freeglut

From the Netbeans menu: File > New Project > C/C++ > C/C++ Static Library
* Press the Next button until step 2. Project Name and Location
* Specify the Project Name: "freeglut_static"
* Specify the Project Location: "C:\Programming\Libraries\freeglut\netbeans"

Right click on "Header Files"
* Select "New Logical Folder" and name it "gl"

Right click on "gl"
* Select "Add existing item..."
* add every *.h from within
* "C:\Programming\Libraries\freeglut\include\gl"
* "C:\Programming\Libraries\freeglut\include\src"

Right click on "Source Files" and select "Add existing item..."
* add every *.c from within
* "C:\Programming\Libraries\freeglut\include\src"

Right click on "freeglut_static" and select "Properties..."
* Select the configuration: "Debug"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../include"
* Specify the Preprocessor Definitions: "_DEBUG FREEGLUT_STATIC _WIN32 _LIB"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/libfreeglut_d.a"

Right click on "freeglut_static" and select "Properties..."
* Select the configuration: "Release"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../include"
* Specify the Preprocessor Definitions: "NDEBUG FREEGLUT_STATIC _WIN32 _LIB"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/libfreeglut.a"



Freetype
Download Freetype
Extract into "C:\Programming\Libraries" resulting in "C:\Programming\Libraries\freetype-2.3.5"
Rename "freetype-2.3.5" to "freetype"

From the Netbeans menu: File > New Project > C/C++ > C/C++ Static Library
* Press the Next button until step 2. Project Name and Location
* Specify the Project Name: "freetype"
* Specify the Project Location: "C:\Programming\Libraries\freetype\netbeans"

Right click on "Header Files"
* Select "Add existing items from folders" and select "C:\Programming\Libraries\freetype\include"

Right click on ""
* Select "Add existing item..."
* add every *.h from within
* "C:\Programming\Libraries\freeglut\include\gl"
* "C:\Programming\Libraries\freeglut\include\src"

Right click on "Source Files" and select "Add existing item..."
* add the following items from the "C:\Programming\Libraries\freetype\src" directory
* autofit/autofit.c
* base/ftbase.c
* base /ftbitmap.c
* base/ftdebug.c
* base/ftgasp.c
* base/ftglyph.c
* base/ftinit.c
* base/ftstroke.c
* base/ftsystem.c
* bdf/bdf.c
* cache/ftcache.c
* cff/cff.c
* gzip/ftgzip.c
* lzw/ftlzw.c
* smooth/smooth.c

Right click on "Source Files"
* Select "New Logical Folder" and name it "FT_MODULES"

Right click on "FT_MODULES" and select "Add existing item..."
* add the following items from the "C:\Programming\Libraries\freetype\src" directory
* base/ftbbox.c
* base/ftmm.c
* base/ftpfr.c
* base/ftsynth.c
* base/fttype1.c
* base/ftwinfnt.c
* cid/type1cid.c
* pcf/pcf.c
* pfr/pfr.c
* psaux/psaux.c
* pshinter/pshinter.c
* psnames/psmodule.c
* raster/raster.c
* sfnt/sfnt.c
* truetype/truetype.c
* type1/type1.c
* type42/type42.c
* winfonts/winfnt.c

Right click on "freetype" and select "Properties..."
* Select the configuration: "Debug"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../include"
* Specify the Preprocessor Definitions: "_DEBUG _WIN32 _LIB FT_DEBUG_LEVEL_ERROR FT_DEBUG_LEVEL_TRACE FT2_BUILD_LIBRARY"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/libfreetype_d.a"

Right click on "freetype" and select "Properties..."
* Select the configuration: "Release"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../include"
* Specify the Preprocessor Definitions: "NDEBUG _WIN32 _LIB FT2_BUILD_LIBRARY"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/libfreetype.a"



PCRE
Download PCRE
Extract into "C:\Programming\Libraries\" resulting in "C:\Programming\Libraries\pcre-7.4"
rename "pcre-7.4" to "pcre"

Netbeans
* File > New Project > C/C++ > C/C++ Project From Existing Code

* Press the Next button until step 2. Build Tool
* Select the "Using a makefile generated by a 'configure' script" option
* Specify the Configure Script "C:\Programming\Libraries\pcre\configure"

* Press the Next button until step 3. Build Actions
* Specify the Working Directory "C:\Programming\Libraries\pcre"

* Press the Next button until step 4. Source Files
* Ensure that the currently specified folder is "C:\Programming\Libraries\pcre"

* Press the Next button until step 5. Code Assistance Configuration
* Add the "C:\Programming\Libraries\pcre" folder

* Press the Next button until step 6. Project Name and Location
* Specify the Project Name "pcre"
* Specify the Project Location "C:\Programming\Libraries\pcre\Netbeans"

* Let Netbeans finish parsing the project
* Right-click on the "pcre" project and select "Clean and Build"

The static library "libpcre.a" has been placed within "C:\Programming\Libraries\pcre\.libs"
copy "libpcre.a" to "C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\lib"

Todo: build a debug version



Lua
Download Lua
Extract into "C:\Programming\Libraries\" resulting in "C:\Programming\Libraries\lua-5.1.2"
rename "lua-5.1.2" to "lua"

Netbeans
From the Netbeans menu: File > New Project > C/C++ > C/C++ Static Library
* Press the Next button until step 2. Project Name and Location
* Specify the Project Name: "lua"
* Specify the Project Location: "C:\Programming\Libraries\lua\Netbeans"

Right click on "Header Files"
* Select "Add existing item..."
* add every *.h from within "C:\Programming\Libraries\lua\src"

Right click on "Source Files" and select "Add existing item..."
* add the following items from the "C:\Programming\Libraries\lua\src" directory
* lapi.c
* lauxlib.c
* lbaselib.c
* lcode.c
* ldblib.c
* ldebug.c
* ldo.c
* ldump.c
* lfunc.c
* lgc.c
* linit.c
* liolib.c
* llex.c
* lmathlib.c
* lmem.c
* loadlib.c
* lobject.c
* lopcodes.c
* loslib.c
* lparser.c
* lstate.c
* lstring.c
* lstrlib.c
* ltable.c
* ltablib.c
* ltm.c
* lundump.c
* lvm.c
* lzio.c

Right click on "lua" and select "Properties..."
* Select the configuration: "Debug"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../src"
* Specify the Preprocessor Definitions: "_DEBUG _WIN32 _LIB LUA_BUILD_AS_DLL"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/liblua_d.a"

Right click on "freetype" and select "Properties..."
* Select the configuration: "Release"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../src"
* Specify the Preprocessor Definitions: "NDEBUG _WIN32 _LIB LUA_BUILD_AS_DLL"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/liblua.a"



toLua++
Download toLua++
Not yet



Jpeglib
Download JpegLib
Extract into "C:\Programming\Libraries\" resulting in "C:\Programming\Libraries\jpeg-6b"
rename "jpeg-6b" to "jpeg"

Netbeans
* File > New Project > C/C++ > C/C++ Project From Existing Code
* Select the "Using a makefile generated by a 'configure' script" option
* Specify the Configure Script "C:\Programming\Libraries\jpeg\configure"

* Press the Next button until step 3. Build Actions
* Specify the Working Directory "C:\Programming\Libraries\jpeg"

* Press the Next button until step 4. Source Files
* Ensure that the currently specified folder is "C:\Programming\Libraries\jpeg"

* Press the Next button until step 5. Code Assistance Configuration
* Add the "C:\Programming\Libraries\jpeg" folder

* Press the Next button until step 6. Project Name and Location
* Specify the Project Name "Jpeg"
* Specify the Project Location "C:\Programming\Libraries\jpeg\Netbeans"

* Let Netbeans finish parsing the project
* Right-click on the "pcre" project and select "Clean and Build"

The static library "libjpeg.a" has been placed within "C:\Programming\Libraries\jpeg"
copy "libjpeg.a" to "C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\lib"

Todo: build a debug version



zlib
Download zlib
Extract into "C:\Programming\Libraries\" resulting in "C:\Programming\Libraries\zlib-1.2.3"
Rename "zlib-1.2.3" to "zlib"

Netbeans
* File > New Project > C/C++ > C/C++ Project From Existing Code
* Select the "Using a makefile generated by a 'configure' script" option
* Specify the Configure Script "C:\Programming\Libraries\zlib\configure"

* Press the Next button until step 3. Build Actions
* Specify the Working Directory "C:\Programming\Libraries\zlib"

* Press the Next button until step 4. Source Files
* Ensure that the currently specified folder is "C:\Programming\Libraries\zlib"

* Press the Next button until step 5. Code Assistance Configuration
* Add the "C:\Programming\Libraries\zlib" folder

* Press the Next button until step 6. Project Name and Location
* Specify the Project Name "zlib"
* Specify the Project Location "C:\Programming\Libraries\zlib\Netbeans"

* Let Netbeans finish parsing the project
* Right-click on the "zlib" project and select "Clean and Build"

The static library "libz.a" has been placed within "C:\Programming\Libraries\zlib"
copy "libz.a" to "C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\lib"

Todo: build a debug version



libpng
Download libpng
Extract into "C:\Programming\Libraries\" resulting in "C:\Programming\Libraries\libpng-1.2.24"
rename "libpng-1.2.24" to "libpng"

Netbeans
From the Netbeans menu: File > New Project > C/C++ > C/C++ Static Library
* Press the Next button until step 2. Project Name and Location
* Specify the Project Name: "libpng"
* Specify the Project Location: "C:\Programming\Libraries\libpng\Netbeans"

Right click on "Header Files"
* Select "Add existing item..."
* add the following items from within "C:\Programming\Libraries\libpng"
* png.h
* pngconf.h

Right click on "Source Files" and select "Add existing item..."
* add the following items from "C:\Programming\Libraries\libpng"
* png.c
* pngerror.c
* pngget.c
* pnggmem.c
* pngpread.c
* pngread.c
* pngrio.c
* pngrtran.c
* pngrutil.c
* pngset.c
* pngtrans.c
* pngwio.c
* pngwrite.c
* pngwtran.c
* pngwutil.c

Right click on "libpng" and select "Properties..."
* Select the configuration: "Debug"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../..;../../../zlib"
* Specify the Preprocessor Definitions: "_WIN32 _DEBUG DEBUG PNG_NO_MMX_CODE PNG_DEBUG=1 _CRT_SECURE_NO_WARNINGS"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/libpng_d.a"

Right click on "libpng" and select "Properties..."
* Select the configuration: "Release"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../..;../../../zlib"
* Specify the Preprocessor Definitions: "PNG_NO_MMX_CODE _WIN32 NDEBUG _CRT_SECURE_NO_WARNINGS"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/libpng.a"



Expat
http://sourceforge.net/project/download ... uperb-west
Extract into "C:\Programming\Libraries\" resulting in "C:\Programming\Libraries\expat-2.0.1"
Rename "expat-2.0.1" to "expat"

Netbeans
From the Netbeans menu: File > New Project > C/C++ > C/C++ Static Library
* Press the Next button until step 2. Project Name and Location
* Specify the Project Name: "expat"
* Specify the Project Location: "C:\Programming\Libraries\expat\Netbeans"

Right click on "Header Files"
* Select "Add existing item..."
* add the following items from within "C:\Programming\Libraries\expat\lib"
* ascii.h
* asciitab.h
* expat.h
* expat_external.h
* iasciitab.h
* internal.h
* latin1tab.h
* nametab.h
* utf8tab.h
* xmlrole.h
* xmltok.h
* xmltok_impl.h

Right click on "Source Files" and select "Add existing item..."
* add the following items from "C:\Programming\Libraries\expat\lib"
* xmlparse.c
* xmlrole.c
* xmltok.c
* xmltok_impl.c
* xmltok_ns.c

Right click on "expat" and select "Properties..."
* Select the configuration: "Debug"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../lib"
* Specify the Preprocessor Definitions: "_WIN32 _DEBUG _WINDOWS COMPILED_FROM_DSP _LIB"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/expat_d.a"

Right click on "expat" and select "Properties..."
* Select the configuration: "Release"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../lib"
* Specify the Preprocessor Definitions: "_WIN32 _WINDOWS NDEBUG _LIB COMPILED_FROM_DSP"
* Navigate to Archiver > General
* Specify the Output: "../../../../CEGUI/CEGUI_head_netbeans/dependencies/lib/expat.a"





CEGUI
Get Cegui HEAD from SVN into "C:\Programming\CEGUI\cegui_mk2\"
https://crayzedsgui.svn.sourceforge.net ... _mk2/trunk

Download dependencies
Extract into "C:\Programming\CEGUI\" resulting in "C:\Programming\CEGUI\cegui_mk2\dependencies"
Take care not to overwrite the files we've already placed in there. Eventually every dependency will be rebuild, removing the need for downloading the dependency. Ideally a Visual Studio/Netbean/Code Block solution/project would ease the pain of building dependencies from scratch.

* Rename "C:\Programming\CEGUI\cegui_mk2" to "C:\Programming\CEGUI\CEGUI_head_netbeans"

* Edit C:\Programming\CEGUI\CEGUI_head_netbeans\makefiles\premake\config.lua
* Remove the DirectX renderers
* Remove the Silly image codec
* Change the DEFAULT_IMAGE_CODEC to "tga"

*Create the file "C:\Programming\CEGUI\CEGUI_head_netbeans\makefiles\premake\build_gnu.bat" with content:
premake --file cegui.lua --target gnu
pause

*Execute "C:\Programming\CEGUI\CEGUI_head_netbeans\makefiles\premake\build_gnu.bat"

*Copy "C:\Programming\CEGUI\Silly_head\include\SILLYOptions.h" to "C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\include"

Netbeans
* File > New Project > C/C++ > C/C++ Project From Existing Code
* Select the "Using an existing makefile" option
* Specify Existing Makefile "C:/Programming/CEGUI/CEGUI_head_netbeans/makefiles/premake/Makefile"

* Press the Next button until step 3. Build Actions
* Specify the Working Directory "C:/Programming/CEGUI/CEGUI_head_netbeans/makefiles/premake"

* Press the Next button until step 4. Source Files
* Remove the currently specified folder
* Add the "C:\Programming\CEGUI\CEGUI_head_netbeans\include" folder
* Add the "C:\Programming\CEGUI\CEGUI_head_netbeans\src" folder

* Press the Next button until step 5. Code Assistance Configuration
* Add the "C:\Programming\CEGUI\CEGUI_head_netbeans\include" folder
* Add the "C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\include" folder
* Add the "C:\Programming\CEGUI\CEGUI_head_netbeans\Samples\common\include" folder
* (maybe not) Add the "C:\Programming\Gnu\cygwin\usr\include\mingw" folder

* Press the Next button until step 6. Project Name and Location
* Specify the Project Name "cegui"
* Specify the Project Location "C:\Programming\CEGUI\CEGUI_head_netbeans\Netbeans"

* Modify CEGUIDynamicModule.h as described in: http://www.cegui.org.uk/phpBB2/viewtopi ... 2976#12976

* Modify CEGUIBase.h such that

Code: Select all

#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
#   ifdef CEGUIBASE_EXPORTS
#       define CEGUIEXPORT __declspec(dllexport)
#   else
#       define CEGUIEXPORT __declspec(dllimport)
#   endif
#       define CEGUIPRIVATE
#else
#       define CEGUIEXPORT
#       define CEGUIPRIVATE
#endif

becomes:

Code: Select all

#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
#   ifdef CEGUIBASE_EXPORTS
#       define CEGUIEXPORT __declspec(dllexport)
#   else
#       define CEGUIEXPORT __declspec(dllimport)
#   endif
#       define CEGUIPRIVATE
#elif defined(__CYGWIN__) && !defined(CEGUI_STATIC)
#   ifdef CEGUIBASE_EXPORTS
#       define CEGUIEXPORT __attribute__((dllexport))
#   else
#       define CEGUIEXPORT __attribute__((dllimport))
#   endif
#       define CEGUIPRIVATE
#else
#       define CEGUIEXPORT
#       define CEGUIPRIVATE
#endif


* Modify CEGUISingleton.h such that

Code: Select all

#ifdef __MINGW32__
#endif

becomes:

Code: Select all

#if (defined(__MINGW32__) || defined(__CYGWIN__))


* Modify C:\Programming\CEGUI\CEGUI_head_netbeans\ScriptingModules\CEGUILua\LuaScriptModule\src
line 8384

Code: Select all

catch(CEGUI::Exception CEGUIDeadException(&e))

becomes

Code: Select all

catch(CEGUI::GenericException CEGUIDeadException(&e))


* Modify C:\Programming\CEGUI\CEGUI_head_netbeans\RendererModules\directx9GUIRenderer\d3d9renderer.cpp

Code: Select all

line  91: throw std::exception("Creation of VertexBuffer for Renderer object failed");
line 100: throw std::exception("Unable to retrieve device capabilities from Direct3DDevice9.");
line 672: throw std::exception("Unable to access required view port information from Direct3DDevice9.");
become

Code: Select all

line  91: throw String("Creation of VertexBuffer for Renderer object failed");
line 100: throw String("Unable to retrieve device capabilities from Direct3DDevice9.");
line 672: throw String("Unable to access required view port information from Direct3DDevice9.");


* Modify C:\Programming\CEGUI\CEGUI_head_netbeans\Samples\common\src

Code: Select all

CEGUISample.h   line  31: #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined (CEGUI_STATIC)
CEGuiSample.cpp line  36: #if defined( __WIN32__ ) || defined( _WIN32 )
CEGuiSample.cpp line 145: #if defined( __WIN32__ ) || defined( _WIN32 )
Win32CEGuiRendererSelector.h line 31: #if defined( __WIN32__ ) || defined( _WIN32 )
Win32CEGuiRendererSelector.h line 29: #include <tchar.h>
becomes

Code: Select all

CEGUISample.h   line  31: #if (defined( __WIN32__ ) || defined( _WIN32 ) || defined(__CYGWIN__)) && !defined (CEGUI_STATIC)
CEGuiSample.cpp line  36: #if defined( __WIN32__ ) || defined( _WIN32 ) || defined(__CYGWIN__)
CEGuiSample.cpp line 145: #if defined( __WIN32__ ) || defined( _WIN32 ) || defined(__CYGWIN__)
Win32CEGuiRendererSelector.h line 31: #if defined( __WIN32__ ) || defined( _WIN32 ) || defined(__CYGWIN__)
Win32CEGuiRendererSelector.h line 29: //#include <tchar.h>


* Modify C:\Programming\CEGUI\CEGUI_head_netbeans\Samples\common\src\Sample_Demo4.cpp
* Add: #include "CEGUIDefaultResourceProvider.h"
* Add within bool Demo4Sample::initialiseSample(), after using namespace CEGUI;

Code: Select all

    DefaultResourceProvider* rp = reinterpret_cast<DefaultResourceProvider*>(System::getSingleton().getResourceProvider());
    rp->setResourceGroupDirectory("fonts",      "../samples/datafiles/fonts/");
    rp->setResourceGroupDirectory("imagesets",      "../samples/datafiles/imagesets/");
    rp->setResourceGroupDirectory("layouts",      "c:/programming/_Projects/CeguiTestBed/");
    rp->setResourceGroupDirectory("looknfeels",      "../samples/datafiles/looknfeel/");
    rp->setResourceGroupDirectory("lua_scripts",   "../samples/datafiles/lua_scripts/");
    rp->setResourceGroupDirectory("schemes",      "../samples/datafiles/schemes/");
    Font::setDefaultResourceGroup("fonts");
    Imageset::setDefaultResourceGroup("imagesets");
    WindowManager::setDefaultResourceGroup("layouts");
    WidgetLookManager::setDefaultResourceGroup("looknfeels");
    ScriptModule::setDefaultResourceGroup("lua_scripts");
    Scheme::setDefaultResourceGroup("schemes");


* Temporary change:
* Copy libpng.a to depenedencies\lib\png.lib
* Copy libjpg.a to depenedencies\lib\jpg.lib
* Copy libz.a to depenedencies\lib\z.lib
* Modify C:\Programming\CEGUI\CEGUI_head_netbeans\makefiles\premake\ImageCodecModules\SILLYImageCodec\makefile
* Append "-ljpeg -lpng -z" to LDFLAGS

* Temporary change:
* Modify C:\Programming\CEGUI\CEGUI_head_netbeans\makefiles\premake\RendererModules\DirectX9GUIRenderer\makefile
* Append to CPPFLAGS: -I "C:\Program Files\Microsoft Visual Studio 8\DirectxSDK\Include"
* Append to LDFLAGS: -L"C:\Program Files\Microsoft Visual Studio 8\DirectxSDK\Lib\x86"

* Temporary changes
* Add "-lglut" to LDFLAGS in "C:\Programming\CEGUI\CEGUI_head_netbeans\makefiles\premake\Samples\common\makefile"
* Comment line 151 in "C:\Programming\CEGUI\CEGUI_head_netbeans\Samples\common\src\CEGuiOpenGLBaseApplication.cpp"

* Modify C:\Programming\CEGUI\CEGUI_head_netbeans\makefiles\premake\RendererModules\DirectX9GUIRenderer\premake.lua
* Add library("uuid")

* Let Netbeans finish parsing the project
* Right-click on the "CEGUI_head_netbeans" project and select "Clean and Build"

* Copy from "C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\bin" to "C:\Programming\CEGUI\CEGUI_head_netbeans\bin"
* freeglut.dll
* freeglut_d.dll

* Copy to "C:\Programming\CEGUI\CEGUI_head_netbeans\bin"
* glut32.dll (was already on my C: drive)

* Temporarily fake "release" versions of the following by renaming
* CEGUITGAImageCodec_d.dll to CEGUITGAImageCodec.dll
* CEGUIExpatParser_d.dll to CEGUIExpatParser.dll
* CEGUIFalagardWRBase_d.dll to CEGUIFalagardWRBase.dll

* Modify C:\Programming\CEGUI\CEGUI_head_netbeans\makefiles\premake\Samples\common\premake.lua
* Copy C:/Programming/Gnu/cygwin/lib/w32api/libwinmm.a to C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\lib\libwinmm.a
* Copy library("C:/Programming/Gnu/cygwin/lib/w32api/winmm.a", "")
* library C:/Programming/Gnu/cygwin/lib/w32api/libgdi32.a to C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\lib\libgdi32.lib
* Add to the section: "if OPENGL_RENDERER and SAMPLES_GL then", below "library("freeglut", "_d")"
* library("winmm", "")
* library("gdi32", "")
Last edited by Rackle on Mon Feb 11, 2008 04:52, edited 16 times in total.

User avatar
fjeronimo
CEGUI Tools Developer (Retired)
Posts: 59
Joined: Tue Sep 11, 2007 16:57
Location: Lisbon, Portugal
Contact:

Postby fjeronimo » Fri Jan 04, 2008 11:04

Hi Rackle,

As you know I'm currently in the process of rebuilding the dependencies myself in VS, and CRT is usually a pain. Trying to link (or even worse, mix) libraries built with different versions of VS, usually leads to a full load of linking errors. There are workarounds, but the best approach is to get the affected external source code and build with the same compiler version.

In your case, I would recommend rebuilding all the dependencies with Netbeans. It will probably be more time consuming, but it's safer and the more consistent option IMO. You could also document the steps needed, so that we can release the build instructions for Netbeans as well as for VS.

I've sent you an email with more details.
Frederico Jerónimo
Ignite Games - http://www.ignite-games.com
Ignite Games Institutional Site - http://we.ignite-games.com

User avatar
fjeronimo
CEGUI Tools Developer (Retired)
Posts: 59
Joined: Tue Sep 11, 2007 16:57
Location: Lisbon, Portugal
Contact:

Postby fjeronimo » Fri Jan 04, 2008 15:46

You can also use Dependency Walker (http://www.dependencywalker.com/) to try to figure out if there are any other dependency problems.
Frederico Jerónimo

Ignite Games - http://www.ignite-games.com

Ignite Games Institutional Site - http://we.ignite-games.com

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Sat Jan 05, 2008 02:34

Rebuilding Freetype and Pcre with Cygwin removed the CRT error messages encountered before (now removed from my original post).

gnu, Cygwin, ./configure and makefile are all new to me so I'm mostly in the dark and _maybe_ stumbling toward the solution. If anyone spots a problem or can offer guidance please do so.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Sat Jan 05, 2008 18:04

Fixed the singleton link error by adding a __cygwin__ define right beside __ming32__. As more compilers are added all these defines are bound to become messy.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sat Jan 05, 2008 19:59

Rackle wrote:As more compilers are added all these defines are bound to become messy.


Probably something that could be thought about is, once you know what all the possible combinations are it should be possible to create some kind of "platform detection header" which would define a minimal number of defines needed, and those get used for the conditionals instead.

Maybe.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Sun Jan 06, 2008 20:39

Having trouble with Silly:

Code: Select all

==== Building CEGUISILLYImageCodec ====

Linking CEGUISILLYImageCodec

../../../../dependencies/lib/SILLY_d.lib(SILLYPNGImageLoader.o):

In function `_ZN5SILLY17PNG_read_functionEP14png_struct_defPhj':

/cygdrive/c/Programming/CEGUI/Silly_head/src/loaders/SILLYPNGImageLoader.cpp:49:

undefined reference to `_png_get_io_ptr'
...
undefined reference to `_jpeg_read_header'


When building Silly_d.lib I linked it with libjpeg.a, libpng.a, and libz.a. I thought that these libraries would be added/merged/appended within silly_d.lib but these error messages appear to say this is not the case. I'm confused, perplexed, and unsure how to proceed.

User avatar
fjeronimo
CEGUI Tools Developer (Retired)
Posts: 59
Joined: Tue Sep 11, 2007 16:57
Location: Lisbon, Portugal
Contact:

Postby fjeronimo » Sun Jan 06, 2008 20:53

Hmm. Quite strange indeed. How big is the SILLY_d.lib file?

Also, did you try to open SILLY_d.lib in dependency walker and check if it depends on libjpeg, libpng or zlib (it shouldn't!)?
Frederico Jerónimo

Ignite Games - http://www.ignite-games.com

Ignite Games Institutional Site - http://we.ignite-games.com

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Sun Jan 06, 2008 23:31

Can't use it as "No DOS or PE signature found. This file is not a valid 32-bit or 64-bit Windows modules". However I can open silly_d.dll.

Found the command "objdump -t silly_d.lib > contents.txt" which pours the contents of the .lib file into a text file; there's too much information to display on the screen. In there I see

Code: Select all

SILLYPNGImageLoader.o:     file format pe-i386

SYMBOL TABLE:
[  0](sec -2)(fl 0x00)(ty   0)(scl 103) (nx 1) 0x00000000 SILLYPNGImageLoader.cpp File

[  2](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 1) 0x00000000 __ZN5SILLY17PNG_read_functionEP14png_struct_defPhj
AUX tagndx 0 ttlsiz 0x0 lnnos 0 next 0

...

[ 71](sec  0)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x00000000 _png_get_io_ptr


And I also see the "_jpeg_read_header".

I would say that the png, jpeg, and z libraries are present within the silly_d.lib library. But I'm not entirely certain of how this works. I'm a good driver but couldn't repair a car engine. Similarly I can write code but know very little about the compilation and linking steps.
Last edited by Rackle on Mon Jan 07, 2008 00:37, edited 1 time in total.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Mon Jan 07, 2008 00:37

Found another command: objdump -p -j idata silly_d.lib

According to this post this is the equivalent of the ldd.exe program to print shared library dependencies.

Sadly this does not help me find a solution.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Mon Jan 07, 2008 11:47

Overcame the problem in ImageCodecModules\SILLYImageCodec by linking the project to png.lib, jpg.lib, and z.lib. It's not the solution I was looking for, and not the way I wanted to implement it, but it's good enough for now.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed Jan 09, 2008 00:39

Pushed through the problems and obtained something, the samples compiling, however it still does not work.

When starting Sample_FirstWindow_d.exe the application complains about not finding the CEGUISILLYImageCodec module in spite of CEGUISILLYImageCodec_d.dll being present. Naturally I tried renaming CEGUISILLYImageCodec_d.dll to CEGUISILLYImageCodec.dll but that resulted in a stack dump

Code: Select all

Exception: STATUS_ACCESS_VIOLATION at eip=00000000
eax=00000000 ebx=00000000 ecx=61108B28 edx=10FD46C8 esi=611021A0 edi=00408570
ebp=0022C618 esp=0022C40C program=C:\Programming\CEGUI\CEGUI_head_netbeans\bin\Sample_FirstWindow_d.exe, pid 4068, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame     Function  Args
End of stack trace


I need to go back to Silly and figure out where I went wrong.

Another problem I'm seeing is that I probably should define __WIN32__ _WIN32 within Netbeans as I intend to run on that platform rather than __APPLE__ or __linux__. I also need to review the changes I've made (forced) throughout as some were done to move forward at any cost.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed Jan 09, 2008 13:47

Started from the beginning by changing config.lua such that it does not include Silly and uses tga by default. Now trying to rebuild Freeglut but having problems with the #include <TCHAR.H>.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed Jan 09, 2008 18:54

I tried creating a dummy/emtpy tchar.h file within the freeglut-2.4.0\src directory but now when compiling I receive the
freeglut_callbacks.c:293: warning:
'glutWindowStatusFunc' defined locally after being referenced with dllimport linkage

error. And yes, I do see the word "warning" rather than the word "error". Weirdness. Here's the full text

Code: Select all

$ make
make  all-recursive
make[1]: Entering directory `/cygdrive/c/programming/libraries/freeglut-2.4.0'
Making all in src
make[2]: Entering directory `/cygdrive/c/programming/libraries/freeglut-2.4.0/src'
source='freeglut_callbacks.c' object='libglut_la-freeglut_callbacks.lo' libtool=yes \
        depfile='.deps/libglut_la-freeglut_callbacks.Plo' tmpdepfile='.deps/libglut_la-freeglut_callbacks.TPlo' \
        depmode=gcc3 /bin/sh ../depcomp \
        /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -Wall -pedantic -Werro
r -c -o libglut_la-freeglut_callbacks.lo `test -f freeglut_callbacks.c || echo './'`freeglut_callbacks.c
rm -f .libs/libglut_la-freeglut_callbacks.lo
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -Wall -pedantic -Werror -c freeglut_callbacks.c -MT libglut_la-free
glut_callbacks.lo -MD -MP -MF .deps/libglut_la-freeglut_callbacks.TPlo  -DDLL_EXPORT -DPIC -o .libs/libglut_la-freeglut_
callbacks.lo
freeglut_callbacks.c:293: warning: 'glutWindowStatusFunc' defined locally after being referenced with dllimport linkage
make[2]: *** [libglut_la-freeglut_callbacks.lo] Error 1
make[2]: Leaving directory `/cygdrive/c/programming/libraries/freeglut-2.4.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/c/programming/libraries/freeglut-2.4.0'
make: *** [all] Error 2


Can anyone make sense of this?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Jan 09, 2008 19:22

It's possible a preprocessor define is required to switch from 'import' to 'export' mode (like you do in msvc++).

Without the define it defaults to import mode, which makes the warning appear since you're actually building the library which contains the function, and should be exporting as opposed to importing.

Just a thought off the top of my head.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 26 guests