Error while building CEGUI with VS 2010

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
BrightBit
Not too shy to talk
Not too shy to talk
Posts: 35
Joined: Mon May 30, 2011 03:30
Contact:

Error while building CEGUI with VS 2010

Postby BrightBit » Thu May 24, 2012 19:07

Hello CEGUI community,

Building the CEGUIOgreRenderer results in the following error:

Code: Select all

1>LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc100-mt-1_47.lib'

I specified all directories of my dependencies correctly in the config.lua. All targets (except CEGUIOgreRenderer) can be compiled without errors. The problem might be the naming convention: As the error reads it is looking for a 'libboost_thread-vc100-mt-1_47.lib' but there is only a 'boost_thread-vc100-mt-1_47.lib', i.e. the leading 'lib' is missing. I was about to change the name in the Visual Studio project file but I was unable to find the corresponding entry. It seems to not even exist. What am I doing wrong?

Edit: I feel stupid now. There are just dynamic versions of boost libraries on my PC but cegui is asking for static ones, i.e. libboost_*** == static vs. boost_*** == dynamic!


Greetings
BrightBit
"Yeah so if you ever need info about anyone [...] Just ask. [...] They 'trust me'. Dumb fucks." - Mark Zuckerberg (Facebook CEO)

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

Re: Error while building CEGUI with VS 2010

Postby CrazyEddie » Fri May 25, 2012 07:55

Hi,

What config are you building? As far as I know, the default set up is for boost to auto-decide which lib to link to based on various configuration items - this would seem to indicate you're building static libs (and therefore boost wanting to link to a static lib is the right thing). I think there is a preprocessor macro you can define to prevent that, this would allow you to specify your own lib to link to.

I now have to add the obligatory disclaimer and say that CEGUI does not use boost, nowhere in any of the build files or source files for CEGUI will you find anything related to boost. This dependency is dragged in solely by using Ogre.

Let us know how you get on, as others are bound to be running into similar issues.

CE.

User avatar
BrightBit
Not too shy to talk
Not too shy to talk
Posts: 35
Joined: Mon May 30, 2011 03:30
Contact:

Re: Error while building CEGUI with VS 2010

Postby BrightBit » Fri May 25, 2012 08:46

Hi CrazyEddie,

sorry for not posting the configuration file before. I should have seen by myself that this file could help you to help me:

Code: Select all

--
-- CEGUI premake configuration script
--

--- These control whether certain build configurations will be available in the
--- generated solutions.  You can set to false (or comment) any build configs
--- you will not be using.
WANT_RELEASE_WITH_SYMBOLS_BUILD = false
WANT_STATIC_BUILD = false

--- This controls which version of the C/C++ runtime and which version of the
--- dependencies are used when linking the static build configurations.
---
--- false: use the static c/c++ runtime option and the 'static' dependencies.
--- true: use the DLL c/c++ runtime option and the 'dynamic' dependencies.
STATIC_BUILD_WITH_DYNAMIC_DEPS = false

-- comment this to disable debug suffixes for dynamic module dlls
-- if you want to use another suffix, just change the string :)
-- all the debug cegui libraries are built with this suffix
DEBUG_DLL_SUFFIX = "_d"

-- Iterator debugging setting
--
-- This controls the level of debugging and other checks done for STL iterators
-- in the debug build for the MSVC++ compilers.
-- Setting this to false can improve performance of debug builds at the expense
-- of safety / debug checks on iterators.
FULLY_CHECKED_DEBUG_ITERATORS = true

-- SDK / dependency paths
-- { base, include_suffix, library_suffix }
-- base can be absolute or relative to the root cegui_mk2 dir
IRRLICHT_PATHS = { "irrlicht-1.7.1", "include", "lib/Win32-visualstudio" }
OGRE_PATHS = { "C:/Programming/OgreBuild", "include/OGRE", "lib" }
OIS_PATHS = { "C:/Programming/OgreBuild", "include/OIS", "lib" }
-- Set this to where your RapidXML package headers are to be found
RAPIDXML_PATHS = { "rapidxml-1.13", "", "" }

-- Python / boost::python (required to build python extension modules)
PYTHON_PATHS = { "C:/Python26", "include", "libs" }
BOOST_PYTHON_PATHS = { "C:/Programming/boost_1_47", "", "lib" }


-- Extra SDK / dependency paths.
--
-- Here you can set up any additional paths you require for the various projects
-- in CEGUI.  This is useful if, for example, you are using some SDK that has
-- additional external dependencies of it's own (for example, boost used with
-- Ogre).  All you need to do is add an entry in the following table to indicate
-- the base directory, include sub-directory, library-subdirectory, and optionally
-- the name of the CEGUI project to add the paths to (if no project is given, the
-- paths are added to /all/ projects).
--
-- NB: Each entry should be surrounded by curly braces, with each entry
-- separated with a comma and appearing within the existing braces.
--
-- For example, to add the OgreSDK boost paths to build for the Ogre renderer
-- module and sample helper with Ogre support, you might have:
--
-- CEGUI_EXTRA_PATHS = {
--     { "../../OgreSDK/boost_1_42", "", "lib", "CEGUIOgreRenderer" },
--     { "../OgreSDK/boost_1_42", "", "lib", "CEGUISampleHelper" }
-- }
--
CEGUI_EXTRA_PATHS = {
   { "C:/Programming/boost_1_47", "", "lib", "CEGUIOgreRenderer" }
}

--- Irrlicht SDK Version
--- 14 is means 1.4 or 1.5.x and 16 means 1.6 or 1.7.x (and above?)
CEGUI_IRR_SDK_VERSION = 16

--- OIS API version to be used in the Ogre samples base app.
--- true: use older numKeyboards / numMice
--- false: use getNumberOfDevices
CEGUI_OLD_OIS_API = false

--- Lua version
--- 51 is 5.1 (and above?) From 0.7.0 onwards, lua 5.0 is no longer supported.
CEGUI_LUA_VER = 51

--- Freetype library
--- CEGUI uses the freetype library for some of it's font support.  To disable
--- the use of freetype, set this to false.
CEGUI_USE_FREETYPE = true

--- PCRE library
--- CEGUI uses the pcre library for it's regular expression based string
--- validation as used in the Editbox (and derived classes, such as Spinner).
--- To disable the use of PCRE (and therefore the validation factilities), set
--- this to false.  (Attempts to set validation string will throw).
CEGUI_USE_PCRE_REGEX = true

--- CEGUI::DefaultLogger
--- To disable compilation and use of the CEGUI::DefaultLogger, set this to
--- false.
---
--- Note: If you disable this, you MUST provide an alternative CEGUI::Logger
--- based class and instantiate it before creating the main CEGUI::System object.
CEGUI_USE_DEFAULT_LOGGER = true

--- BiDirectional text support.
--- To enable support for bi-directional text in CEGUI, set CEGUI_BIDI_SUPPORT
--- to true.
--- With bidirectional support enabled, CEGUI_USE_MINIBIDI then controls whether
--- that support is provided viaan embedded copy of minibidi (true) or an
--- external copy of the fribidi library (false).
CEGUI_BIDI_SUPPORT = false;
CEGUI_USE_MINIBIDI = true;

--- MinizipResourceProvider
--- To enable compilation and inclusion into CEGUIBase of the MinizipResourceProvider
--- set the following to true.
---
--- The MinizipResourceProvider enables resources to be loaded from a zip compressed
--- archive.
MINIZIP_RESOURCE_PROVIDER = true

-------------
-- Renderers
-- this controls which renderer modules are built
OPENGL_RENDERER = false
DIRECT3D9_RENDERER = false
DIRECT3D10_RENDERER = false
DIRECT3D11_RENDERER = false
IRRLICHT_RENDERER = false
OGRE_RENDERER = true
NULL_RENDERER = false

----------------
-- Image Codecs
-- this controls which image codecs are built
TGA_IMAGE_CODEC = false
SILLY_IMAGE_CODEC = false
DEVIL_IMAGE_CODEC = false
FREEIMAGE_IMAGE_CODEC = true
CORONA_IMAGE_CODEC = false
STB_IMAGE_CODEC = false

-- this setting selects the default image codec module
-- can be either "tga", "silly", "devil", "freeimage", "stb" or "corona"
-- SILLY was written for CEGUI
DEFAULT_IMAGE_CODEC = "freeimage"

---------------
-- Window Renderers
-- controls window renderers built
FALAGARD_WR = true

-- default WR
-- available: falagard
DEFAULT_WINDOW_RENDERER = "falagard"




---------------
-- XML parsers
-- this controls which xml parser modules are built
EXPAT_PARSER = true
XERCES_PARSER = false
TINYXML_PARSER = false
RAPIDXML_PARSER = false
LIBXML_PARSER = false

-- this selects the default XML parser module
-- can be either "expat", "xerces", "tinyxml", "rapidxml" or "libxml"
DEFAULT_XML_PARSER = "expat"


-------
-- Lua
-- this controls whether CEGUILua is enabled
LUA_SCRIPT_MODULE = false

-- disable this for a smaller and faster, but less safe Lua module
-- only affects Release builds. Debug and ReleaseWithSymbols always
-- enable this
LUA_SCRIPT_MODULE_SAFE = false

-- enable this to build the bundled tolua++ as a static library
TOLUA_STATIC = false


-------
-- Python
-- this controls whether building the Python extension modules is enabled
PYTHON_EXTENSION_MODULE = false


-----------
-- Samples
-- remember you have to edit CEGUISamplesConfig.h as well this just controls
-- dependencies etc. if the renderer is disabled this has no effect
SAMPLES_GL = false
SAMPLES_DX9 = false
SAMPLES_DX10 = false
SAMPLES_IRRLICHT = false
SAMPLES_OGRE = false

-- this setting controls if the samples should be included in the same
-- solution as the core libraries. If this setting is disabled you can
-- still generate a seperate solution for the samples
--
-- due to a missing feature in premake enabling this will cause the
-- output files to be placed in cegui_mk2/bin and not cegui_mk2/Samples/bin
--
SAMPLES_INCLUDED = false


I also tried WANT_STATIC_BUILD = true with STATIC_BUILD_WITH_DYNAMIC_DEPS = true but it also didn't help.
"Yeah so if you ever need info about anyone [...] Just ask. [...] They 'trust me'. Dumb fucks." - Mark Zuckerberg (Facebook CEO)

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

Re: Error while building CEGUI with VS 2010

Postby CrazyEddie » Sat May 26, 2012 06:26

Hi,

Thanks. Do you get the error building the DLL CEGUI libraries or only when building the static CEGUI libraries?

You could try adding a preprocessor definition BOOST_ALL_DYN_LINK on affected projects, this should force it to use the dynamic libs (unless some other strangeness is happening somewhere else).

HTH

CE

User avatar
BrightBit
Not too shy to talk
Not too shy to talk
Posts: 35
Joined: Mon May 30, 2011 03:30
Contact:

Re: Error while building CEGUI with VS 2010

Postby BrightBit » Sat May 26, 2012 22:03

I get this error for every permutation of true and false for WANT_STATIC_BUILD and STATIC_BUILD_WITH_DYNAMIC_DEPS. Now I recompiled Ogre and CEGUI to use boost's static libs but I will definitely try what you've said to see if it helps (and to decrease the size of my project a bit).

Just in case I did something wrong: Which parameters in the config.lua should be set to true and which to false to link boost dynamically?

Thank you so far for your help.


Greetings
BrightBit
"Yeah so if you ever need info about anyone [...] Just ask. [...] They 'trust me'. Dumb fucks." - Mark Zuckerberg (Facebook CEO)

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

Re: Error while building CEGUI with VS 2010

Postby CrazyEddie » Sun May 27, 2012 18:46

There are no boost specific settings in config.lua, since CEGUI does not use boost in any way, shape or form. The only reason you're having this issue at all is because Ogre exposes its boost dependency to client code - so here it's being dragged in in when building CEGUI, and later it will be your own apps that you build against Ogre that drag it in, too :(

As I understand it, there is a boost header that handles automatically determining which configuration of lib it thinks it needs and then brings it in for linking via those #pragma comment(lib, ...) type constructs (that I hate!). With this in mind, the project that is (indirectly) including boost's autolink header would need to be configured to link against the DLL c/c++ runtime (this should be how things are configured via premake for the dynamic CEGUI builds). For the static CEGUI builds, normally it will use the static c/c++ runtime unless STATIC_BUILD_WITH_DYNAMIC_DEPS is set to true - when that happens, it should again be using the dynamic c/c++ runtime. As far as I know (and I'm no expert) it is this c/c++ runtime setting that boost uses to determine which config of boost lib it will try to link with.

The default config is:
WANT_STATIC_BUILD = false
STATIC_BUILD_WITH_DYNAMIC_DEPS = false

This default setting is obviously is the config that gets used/tested the most and as far as I recall, nobody has reported the issue you're getting (so it's really hard to know what's going on with that).

As far as I know the only config that should cause the static boost to be brought in is:
WANT_STATIC_BUILD = true
STATIC_BUILD_WITH_DYNAMIC_DEPS = false

Now I have to ask a really silly question - if this is 'obvious' to you, no offence is intended :) After editing the config.lua file, are you remembering to regenerate the solution and project files by re-running premake (i.e via one of the batch files)? And yes, this means you have to re-convert them every time - a real pita I know :).

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 1 guest