[SOLVED] CEGUI problem

Problems building or running the engine, queries about how to use features etc.
Post Reply
brkpnt
Gnoblar
Posts: 4
Joined: Tue Jan 10, 2012 9:23 pm

[SOLVED] CEGUI problem

Post by brkpnt » Tue Jan 10, 2012 9:34 pm

Hello (:
My problem is that when i try to build my application CEGUI-OGRE, cmake shows "undefined reference to" in the functions of CEGUI.

When i make configure all seems ok. Cmake finds the libraries, and all... I think. I dont know what happends.

findCEGUI.cmake

Code: Select all

#
# Try to find Cegui library on both Windows and Linux systems
# 
# The following values will get defined:
#   CEGUI_FOUND - True if cegui lib was found
#   CEGUI_INCLUDE_DIR - Include libraries for cegui usage
#   CEGUI_LIBRARIES - Library paths for cegui
#
# Please set your environmental variables to include CEGUI_HOME, which should point to the CEGUI SDK
#
SET(CEGUI_FOUND "No")
MARK_AS_ADVANCED(CEGUI_FOUND)

IF (UNIX)
    SET(CEGUI_INC_SEARCH_PATH
   /usr/include/cegui
   /usr/include/CEGUI
   /usr/include/OGRE
   /usr/local/include/cegui
   /usr/local/include/CEGUI
     )
     
     SET(CEGUI_LIB_SEARCH_PATH
        /lib
        /usr/lib
   /usr/lib32
   /usr/lib64
   /usr/local/lib
   /usr/local/lib32
   /usr/local/lib64
     )
 
   SET(CEGUIBASE_LIBNAMES CEGUIBase)
   SET(CEGUI_LIBNAMES CEGUIOgreRenderer OgreGUIRenderer
	CEGUIExpatParser CEGUIFalagardWRBase CEGUIFreeImageCodec
	CEGUITinyXMLParser)
ENDIF(UNIX)


IF(WIN32)
    # For the OgreSDK should be the prefared place to get the CEGUI files
    # The samples line is there to help building with the standard setup (Missing OgreCEGUIRenderer.h)

    SET(CEGUI_INC_SEARCH_PATH
   $ENV{OGRE_HOME}/include
   $ENV{OGRE_HOME}/include/CEGUI
   $ENV{OGRE_HOME}/samples/include
   $ENV{CEGUI_HOME}/include
   $ENV{CEGUI_HOME}/include/CEGUI
   $ENV{CEGUI_EXTRA_INCLUDE_DIR}
   $ENV{CEGUI_EXTRA_INCLUDE_DIR}/include
     )
     
     SET(CEGUI_LIB_SEARCH_PATH
   $ENV{OGRE_HOME}/lib
   $ENV{OGRE_HOME}/bin
   $ENV{OGRE_HOME}/bin/debug
   $ENV{OGRE_HOME}/bin/release
   $ENV{CEGUI_HOME}/lib
   $ENV{CEGUI_HOME}/bin
   $ENV{CEGUI_HOME}/bin/debug
   $ENV{CEGUI_HOME}/bin/release
   /OgreSDK/lib
   /OgreSDK/bin
   /OgreSDK/bin/debug
   /OgreSDK/bin/release
     )

   IF(MSVC)
      SET(CEGUI_LIBNAMES_DEB CEGUIOgreRenderer_d OgreGUIRenderer_d)   
      SET(CEGUI_LIBNAMES_REL CEGUIOgreRenderer OgreGUIRenderer)
      SET(CEGUIBASE_LIBNAMES_DEB CEGUIBase_d)   
      SET(CEGUIBASE_LIBNAMES_REL CEGUIBase)   
   ELSE(MSVC)
      SET(CEGUI_LIBNAMES CEGUIOgreRenderer OgreGUIRenderer)
      SET(CEGUIBASE_LIBNAMES CEGUIBase)   
   ENDIF(MSVC)
ENDIF(WIN32)

SET(CEGUI_ALL_FOUND 1)

# Include paths search
FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h ${CEGUI_INC_SEARCH_PATH})

IF(NOT CEGUI_INCLUDE_DIR)
   MESSAGE("WARNING: CEGUI.h not found under ${CEGUI_INC_SEARCH_PATH}")
   SET(CEGUI_ALL_FOUND 0)
ENDIF(NOT CEGUI_INCLUDE_DIR)

# Include paths search, renderer
FIND_PATH(CEGUI_EXTRA_INCLUDE_DIR OgreCEGUIRenderer.h ${CEGUI_INC_SEARCH_PATH})

IF(NOT CEGUI_EXTRA_INCLUDE_DIR)
   MESSAGE("WARNING: OgreCEGUIRenderer.h not found under ${CEGUI_INC_SEARCH_PATH}")
   SET(CEGUI_ALL_FOUND 0)
ENDIF(NOT CEGUI_EXTRA_INCLUDE_DIR)

# Cegui ogre renderer library
# Target compiler specific, as MSVC holds Debug and release separate
IF(MSVC)
   # Cegui library
   FIND_LIBRARY(CEGUI_CEGUI_LIB_RELEASE NAME ${CEGUIBASE_LIBNAMES_REL} PATHS ${CEGUI_LIB_SEARCH_PATH})
   FIND_LIBRARY(CEGUI_CEGUI_LIB_DEBUG NAME ${CEGUIBASE_LIBNAMES_DEB} PATHS ${CEGUI_LIB_SEARCH_PATH})

   IF(CEGUI_CEGUI_LIB_DEBUG AND CEGUI_CEGUI_LIB_RELEASE)
      SET(CEGUI_CEGUI_LIB optimized ${CEGUI_CEGUI_LIB_RELEASE} debug ${CEGUI_CEGUI_LIB_DEBUG})
   ELSE(CEGUI_CEGUI_LIB_DEBUG AND CEGUI_CEGUI_LIB_RELEASE)
      MESSAGE("WARNING: CEGUI library CEGUIBase not found under ${CEGUI_LIB_SEARCH_PATH}")
      SET(CEGUI_ALL_FOUND 0)
   ENDIF(CEGUI_CEGUI_LIB_DEBUG AND CEGUI_CEGUI_LIB_RELEASE)

   FIND_LIBRARY(CEGUI_OGRE_LIB_RELEASE ${CEGUI_LIBNAMES_REL} PATHS ${CEGUI_LIB_SEARCH_PATH})
   FIND_LIBRARY(CEGUI_OGRE_LIB_DEBUG ${CEGUI_LIBNAMES_DEB} PATHS ${CEGUI_LIB_SEARCH_PATH})

   IF(CEGUI_OGRE_LIB_DEBUG AND CEGUI_OGRE_LIB_RELEASE)
      SET(CEGUI_OGRE_LIB optimized ${CEGUI_OGRE_LIB_RELEASE} debug ${CEGUI_OGRE_LIB_DEBUG})
   ELSE(CEGUI_OGRE_LIB_DEBUG AND CEGUI_OGRE_LIB_RELEASE)
      MESSAGE("WARNING: CEGUI OGRE library CEGUIOgreRenderer not found under ${CEGUI_LIB_SEARCH_PATH}")
      SET(CEGUI_ALL_FOUND 0)
   ENDIF(CEGUI_OGRE_LIB_DEBUG AND CEGUI_OGRE_LIB_RELEASE)
ELSE(MSVC)
   # Cegui library
   FIND_LIBRARY(CEGUI_CEGUI_LIB NAME ${CEGUIBASE_LIBNAMES} PATHS ${CEGUI_LIB_SEARCH_PATH})

   IF(NOT CEGUI_CEGUI_LIB)
      MESSAGE("WARNING: CEGUI library CEGUIBase not found under ${CEGUI_LIB_SEARCH_PATH}")
      SET(CEGUI_ALL_FOUND 0)
   ENDIF(NOT CEGUI_CEGUI_LIB)


   FIND_LIBRARY(CEGUI_OGRE_LIB ${CEGUI_LIBNAMES} PATHS ${CEGUI_LIB_SEARCH_PATH})

   IF(NOT CEGUI_OGRE_LIB)
      MESSAGE("WARNING: CEGUI OGRE library CEGUIOgreRenderer not found under ${CEGUI_LIB_SEARCH_PATH}")
      SET(CEGUI_ALL_FOUND 0)
   ENDIF(NOT CEGUI_OGRE_LIB)
ENDIF(MSVC)

# Extra paths for include of CEGUI (for CEGUIOgreRenderer.h)
IF(CEGUI_EXTRA_INCLUDE_DIR)
    SET(CEGUI_INCLUDE_DIR ${CEGUI_EXTRA_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR})
ENDIF(CEGUI_EXTRA_INCLUDE_DIR)

SET(CEGUI_LIBRARIES ${CEGUI_CEGUI_LIB} ${CEGUI_OGRE_LIB})

IF(CEGUI_INCLUDE_DIR AND CEGUI_CEGUI_LIB AND CEGUI_OGRE_LIB AND CEGUI_ALL_FOUND)
    SET(CEGUI_FOUND "Yes")
ENDIF(CEGUI_INCLUDE_DIR AND CEGUI_CEGUI_LIB AND CEGUI_OGRE_LIB AND CEGUI_ALL_FOUND)

MARK_AS_ADVANCED(CEGUI_INCLUDE_DIR)
MARK_AS_ADVANCED(CEGUI_LIBRARIES)
MARK_AS_ADVANCED(CEGUI_LIBNAMES)
MARK_AS_ADVANCED(CEGUI_EXTRA_INCLUDE_DIR)
MARK_AS_ADVANCED(CEGUI_CEGUI_LIB)
MARK_AS_ADVANCED(CEGUI_OGRE_LIB)
my CmakeLists.txt

Code: Select all

#/*
#-----------------------------------------------------------------------------
#Filename:    CMakeLists.txt
#-----------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.6)
 
project(OgreApp)
 
if(WIN32)
	set(CMAKE_MODULE_PATH "$ENV{OGRE_HOME}/CMake/;${CMAKE_MODULE_PATH}")
	set(OGRE_SAMPLES_INCLUDEPATH
		$ENV{OGRE_HOME}/Samples/include
	)
endif(WIN32)
 
if(UNIX)
	if(EXISTS "/usr/local/lib/OGRE/cmake")

	  set(CMAKE_MODULE_PATH "/usr/local/lib/OGRE/cmake/;${CMAKE_MODULE_PATH}")
	  set(OGRE_SAMPLES_INCLUDEPATH "/usr/local/share/OGRE/samples/Common/include/") # We could just *assume* that developers uses this basepath : /usr/local

	elseif(EXISTS "/usr/lib/OGRE/cmake")

	  set(CMAKE_MODULE_PATH "/usr/lib/OGRE/cmake/;${CMAKE_MODULE_PATH}")
	  set(OGRE_SAMPLES_INCLUDEPATH "/usr/share/OGRE/samples/Common/include/") # Otherwise, this one

	else ()
	  message(SEND_ERROR "Failed to find module path.")
	endif(EXISTS "/usr/local/lib/OGRE")
endif(UNIX)
 
if (CMAKE_BUILD_TYPE STREQUAL "")
  # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
  # differentiation between debug and release builds.
  set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
 
set(CMAKE_DEBUG_POSTFIX "_d")
 
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/dist")
 
find_package(OGRE REQUIRED)
 
#if(NOT "${OGRE_VERSION_NAME}" STREQUAL "Cthugha")
#  message(SEND_ERROR "You need Ogre 1.7 Cthugha to build this.")
#endif()
 
find_package(OIS REQUIRED)
 
if(NOT OIS_FOUND)
	message(SEND_ERROR "Failed to find OIS.")
endif()
 
# Find Boost
if (NOT OGRE_BUILD_PLATFORM_IPHONE)
	if (WIN32 OR APPLE)
		set(Boost_USE_STATIC_LIBS TRUE)
	else ()
		# Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit
		set(Boost_USE_STATIC_LIBS ${OGRE_STATIC})
	endif ()
	if (MINGW)
		# this is probably a bug in CMake: the boost find module tries to look for
		# boost libraries with name libboost_*, but CMake already prefixes library
		# search names with "lib". This is the workaround.
		set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "")
	endif ()
	set(Boost_ADDITIONAL_VERSIONS "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" )
	# Components that need linking (NB does not include header-only components like bind)
	set(OGRE_BOOST_COMPONENTS thread date_time)
	find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
	if (NOT Boost_FOUND)
		# Try again with the other type of libs
		set(Boost_USE_STATIC_LIBS NOT ${Boost_USE_STATIC_LIBS})
		find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
	endif()
	find_package(Boost QUIET)
 
	# Set up referencing of Boost
	include_directories(${Boost_INCLUDE_DIR})
	add_definitions(-DBOOST_ALL_NO_LIB)
	set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${Boost_LIBRARIES})
endif()

find_package (CEGUI REQUIRED)

if(NOT CEGUI_FOUND)
	message(SEND_ERROR "Failed to find CEGUI.")
else (NOT CEGUI_FOUND)
	message ("CEGUI found")
endif()
 
set(HDRS
	./BaseApplication.h
	./TutorialApplication.h
)
 
set(SRCS
	./BaseApplication.cpp
	./TutorialApplication.cpp
)
 
include_directories( ${OIS_INCLUDE_DIRS}
	${OGRE_INCLUDE_DIRS}
	${OGRE_SAMPLES_INCLUDEPATH}
	${CEGUI_INCLUDE_DIR}
)
 
add_executable(OgreApp WIN32 ${HDRS} ${SRCS})
 
set_target_properties(OgreApp PROPERTIES DEBUG_POSTFIX _d)
 
target_link_libraries(OgreApp ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES})
 
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dist/bin)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dist/media)
 
# post-build copy for win32
if(WIN32 AND NOT MINGW)
	add_custom_command( TARGET OgreApp PRE_BUILD
		COMMAND if not exist .\\dist\\bin mkdir .\\dist\\bin )
	add_custom_command( TARGET OgreApp POST_BUILD
		COMMAND copy \"$(TargetPath)\" .\\dist\\bin )
endif(WIN32 AND NOT MINGW)

if(MINGW OR UNIX)
	set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/dist/bin)
endif(MINGW OR UNIX)
 
if(WIN32)
 
	install(TARGETS OgreApp
		RUNTIME DESTINATION bin
		CONFIGURATIONS All)
 
	install(DIRECTORY ${CMAKE_SOURCE_DIR}/dist/Media
		DESTINATION ./
		CONFIGURATIONS Release RelWithDebInfo Debug
	)
 
	install(FILES ${CMAKE_SOURCE_DIR}/dist/bin/plugins.cfg
		${CMAKE_SOURCE_DIR}/dist/bin/resources.cfg
		DESTINATION bin
		CONFIGURATIONS Release RelWithDebInfo
	)
 
	install(FILES ${CMAKE_SOURCE_DIR}/dist/bin/plugins_d.cfg
		${CMAKE_SOURCE_DIR}/dist/bin/resources_d.cfg
		DESTINATION bin
		CONFIGURATIONS Debug
	)
 
        # NOTE: for the 1.7.1 sdk the OIS dll is called OIS.dll instead of libOIS.dll
        # so you'll have to change that to make it work with 1.7.1
	install(FILES ${OGRE_PLUGIN_DIR_REL}/OgreMain.dll
		${OGRE_PLUGIN_DIR_REL}/RenderSystem_Direct3D9.dll
		${OGRE_PLUGIN_DIR_REL}/RenderSystem_GL.dll
		${OGRE_PLUGIN_DIR_REL}/libOIS.dll
		DESTINATION bin
		CONFIGURATIONS Release RelWithDebInfo
	)
 
	install(FILES ${OGRE_PLUGIN_DIR_DBG}/OgreMain_d.dll
		${OGRE_PLUGIN_DIR_DBG}/RenderSystem_Direct3D9_d.dll
		${OGRE_PLUGIN_DIR_DBG}/RenderSystem_GL_d.dll
		${OGRE_PLUGIN_DIR_DBG}/libOIS_d.dll
		DESTINATION bin
		CONFIGURATIONS Debug
	)
 
   # as of sdk 1.7.2 we need to copy the boost dll's as well
   # because they're not linked statically (it worked with 1.7.1 though)
   install(FILES ${Boost_DATE_TIME_LIBRARY_RELEASE}
      ${Boost_THREAD_LIBRARY_RELEASE}
      DESTINATION bin
      CONFIGURATIONS Release RelWithDebInfo
   )
 
   install(FILES ${Boost_DATE_TIME_LIBRARY_DEBUG}
      ${Boost_THREAD_LIBRARY_DEBUG}
      DESTINATION bin
      CONFIGURATIONS Debug
   )
endif(WIN32)

if(UNIX)
 
	install(TARGETS OgreApp
		RUNTIME DESTINATION bin
		CONFIGURATIONS All)
 
	install(DIRECTORY ${CMAKE_SOURCE_DIR}/dist/media
		DESTINATION ./
		CONFIGURATIONS Release RelWithDebInfo Debug
	)
 
	install(FILES ${CMAKE_SOURCE_DIR}/dist/bin/plugins.cfg
		${CMAKE_SOURCE_DIR}/dist/bin/resources.cfg
		DESTINATION bin
		CONFIGURATIONS Release RelWithDebInfo Debug
	)
 
endif(UNIX)
What i am doing wrong?

Thanks! and sorry for my bad english.
Last edited by brkpnt on Wed Jan 11, 2012 3:08 pm, edited 1 time in total.
0 x

brkpnt
Gnoblar
Posts: 4
Joined: Tue Jan 10, 2012 9:23 pm

Re: CEGUI problem

Post by brkpnt » Wed Jan 11, 2012 2:32 am

Now i trying with this: (whiout cmake)

Code: Select all

#include <CEGUI/CEGUI.h>
#include <CEGUI/RendererModules/Ogre/CEGUIOgreRenderer.h>

int main ()
{
  CEGUI::OgreRenderer::bootstrapSystem();
}
when i try to comile whit

Code: Select all

$ g++ main.cpp -lCEGUIBase -lCEGUIOgreRenderer -lCEGUIExpatParser -lCEGUIFalagardWRBase -lOgreMain
I get linker errors:

Code: Select all

/tmp/cc2JAyi5.o: In function `main':
main.cpp:(.text+0x5): undefined reference to `CEGUI::OgreRenderer::bootstrapSystem()'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::operator+(CEGUI::String const&, CEGUI::String const&)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::String::~String()'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::System::getSingleton()'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::EventSet::subscribeEvent(CEGUI::String const&, CEGUI::SubscriberSlot)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::Renderer::EventDisplaySizeChanged'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::String::npos'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::Exception::Exception(CEGUI::String const&, CEGUI::String const&, CEGUI::String const&, int)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::operator+(CEGUI::String const&, char const*)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `typeinfo for CEGUI::Renderer'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::Renderer::EventNamespace'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::EventSet::subscribeScriptedEvent(CEGUI::String const&, CEGUI::String const&)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::Size::operator!=(CEGUI::Size const&) const'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::EventSet::subscribeScriptedEvent(CEGUI::String const&, unsigned int, CEGUI::String const&)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::System::getResourceProvider() const'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `typeinfo for CEGUI::Exception'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::operator+(CEGUI::String const&, unsigned char const*)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::Renderer::~Renderer()'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::Exception::~Exception()'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::Rect::offset(CEGUI::Vector2 const&)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::EventSet::fireEvent(CEGUI::String const&, CEGUI::EventArgs&, CEGUI::String const&)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::Rect::operator=(CEGUI::Rect const&)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::EventSet::subscribeEvent(CEGUI::String const&, unsigned int, CEGUI::SubscriberSlot)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::operator+(unsigned char const*, CEGUI::String const&)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::Renderer::Renderer()'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::String::grow(unsigned long)'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::String::build_utf8_buff() const'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libCEGUIOgreRenderer.so: undefined reference to `CEGUI::System::renderGUI()'
collect2: ld returned 1 exit status
I compiled CEGUI from source and successfully installed, i use static libraries, under ubuntu, and samples run correctly in OpenGL and irrlicht.

What i'm doing wrong? thanks!
0 x

hoppelmoppel
Greenskin
Posts: 107
Joined: Tue May 10, 2011 12:33 am

Re: [SOLVED] CEGUI problem

Post by hoppelmoppel » Wed Jan 11, 2012 10:52 pm

Please post your solution. It could help others sometime.
0 x

brkpnt
Gnoblar
Posts: 4
Joined: Tue Jan 10, 2012 9:23 pm

Re: [SOLVED] CEGUI problem

Post by brkpnt » Thu Jan 12, 2012 11:45 am

The solution was a good FIndCEGUI.cmake

Code: Select all

    # - Locate CEGUI LIBRARIES
    # This module defines
    #  CEGUI_FOUND, if false, do not try to link to CEGUI
    #  CEGUI_INCLUDE_DIR, where to find headers.
    #  CEGUI_LIBRARIES, the LIBRARIES to link against
    #  CEGUI_BINARY_REL - location of the main CEGUI binary (win32 non-static only, release)
    #  CEGUI_BINARY_DBG - location of the main CEGUI binaries (win32 non-static only, debug)
    #
    #
    # 	Modules :
    #  CEGUI_${COMPONENT}_FOUND - ${COMPONENT} is available
    #  CEGUI_${COMPONENT}_INCLUDE_DIRS - additional include directories for ${COMPONENT}
    #  CEGUI_${COMPONENT}_LIBRARIES - link these to use ${COMPONENT} 
    #  CEGUI_${COMPONENT}_BINARY_REL - location of the component binary (win32 non-static only, release)
    #  CEGUI_${COMPONENT}_BINARY_DBG - location of the component binary (win32 non-static only, debug)
    #
    #	WindowsRenderer:
    #		Falagard
    #	Renderer:
    #		Direct3D9Renderer Direct3D10Renderer Direct3D11Renderer IrrlichtRenderer NullRenderer OgreRenderer OpenGLRenderer
    #	ImageCodec:
    #		CoronaImageCodec DevILImageCodec FreeImageImageCodec SILLYImageCodec STBImageCodec TGAImageCodec
    #	Parser:
    #		ExpatParser LibxmlParser RapidXMLParser TinyXMLParser XercesParser)
    #	Script:
    #		LuaScriptModule
     
     
    include(FindPkgMacros)
    include(PreprocessorUtils)
    findpkg_begin(CEGUI)
    set(CEGUI_FIND_REQUIRED 1)
     
    # Get path, convert backslashes as ${ENV_${var}}
    getenv_path(CEGUI_HOME)
    getenv_path(CEGUI_DIR)
    getenv_path(CEGUI_ROOT)
    getenv_path(PROGRAMFILES)
     
    # Determine whether to search for a dynamic or static build
    if (CEGUI_STATIC)
      set(CEGUI_LIB_SUFFIX "_Static")
    else ()
      set(CEGUI_LIB_SUFFIX "")
    endif ()
     
    set(CEGUI_LIBRARY_NAMES "CEGUIBase${CEGUI_LIB_SUFFIX}")
    get_debug_names(CEGUI_LIBRARY_NAMES)
     
    # construct search paths from environmental hints and
    # OS specific guesses
    if (WIN32)
      set(CEGUI_PREFIX_GUESSES
        ${ENV_PROGRAMFILES}/cegui
        ${ENV_PROGRAMFILES}/CEGUI
        C:/CEGUI-SDK
        C:/lib/cegui
        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;CEGUI_HOME]
        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;CEGUI_DIR]
        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;CEGUI_ROOT]
      )
    elseif (UNIX)
      set(CEGUI_PREFIX_GUESSES
        /opt/cegui
        /opt/CEGUI
        /usr
        /usr/local
        $ENV{HOME}/cegui
        $ENV{HOME}/CEGUI
      )
    endif ()
     
    set(CEGUI_PREFIX_PATH
    	$ENV{CEGUI_HOME} $ENV{CEGUI_DIR} $ENV{CEGUI_ROOT}
    	${CEGUI_PREFIX_GUESSES}
    )
     
    create_search_paths(CEGUI)
     
     
    # redo search if any of the environmental hints changed
    set(CEGUI_WINDOWSRENDERER_COMPONENTS 
    	Falagard
    )
    set(CEGUI_RENDERER_COMPONENTS 
    	Direct3D9Renderer Direct3D10Renderer Direct3D11Renderer IrrlichtRenderer NullRenderer OgreRenderer OpenGLRenderer
    )
    set(CEGUI_IMAGECODEC_COMPONENTS 
    	CoronaImageCodec DevILImageCodec FreeImageImageCodec SILLYImageCodec STBImageCodec TGAImageCodec
    )
    set(CEGUI_PARSER_COMPONENTS 
    	ExpatParser LibxmlParser RapidXMLParser TinyXMLParser XercesParser
    )
    set(CEGUI_SCRIPT_COMPONENTS 
    	LuaScriptModule
    )
    set(CEGUI_COMPONENTS ${CEGUI_WINDOWSRENDERER_COMPONENTS} ${CEGUI_RENDERER_COMPONENTS} ${CEGUI_IMAGECODEC_COMPONENTS} ${CEGUI_PARSER_COMPONENTS} ${CEGUI_SCRIPT_COMPONENTS})
     
    set(CEGUI_RESET_VARS 
      CEGUI_CONFIG_INCLUDE_DIR CEGUI_INCLUDE_DIR 
      CEGUI_LIBRARY_REL CEGUI_LIBRARY_DBG)
     
    foreach (comp ${CEGUI_COMPONENTS})
      set(CEGUI_RESET_VARS ${CEGUI_RESET_VARS}
        CEGUI_${comp}_INCLUDE_DIR CEGUI_${comp}_LIBRARY_FWK
        CEGUI_${comp}_LIBRARY_DBG CEGUI_${comp}_LIBRARY_REL
      )
    endforeach (comp)
    set(CEGUI_PREFIX_WATCH ${CEGUI_PREFIX_PATH})
    clear_if_changed(CEGUI_PREFIX_WATCH ${CEGUI_RESET_VARS})
     
    # try to locate CEGUI via pkg-config
    use_pkgconfig(CEGUI_PKGC "CEGUI${CEGUI_LIB_SUFFIX}")
     
    # locate CEGUI include files
    find_path(CEGUI_CONFIG_INCLUDE_DIR NAMES CEGUIConfig.h HINTS ${CEGUI_INC_SEARCH_PATH} ${CEGUI_FRAMEWORK_INCLUDES} ${CEGUI_PKGC_INCLUDE_DIRS})
    find_path(CEGUI_INCLUDE_DIR NAMES CEGUI.h HINTS ${CEGUI_INC_SEARCH_PATH} ${CEGUI_FRAMEWORK_INCLUDES} ${CEGUI_PKGC_INCLUDE_DIRS})
    set(CEGUI_INCOMPATIBLE FALSE)
     
    if (CEGUI_INCLUDE_DIR)
      # determine CEGUI version
      file(READ ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h CEGUI_TEMP_VERSION_CONTENT)
      get_preprocessor_entry(CEGUI_TEMP_VERSION_CONTENT CEGUI_VERSION_MAJOR CEGUI_VERSION_MAJOR)
      get_preprocessor_entry(CEGUI_TEMP_VERSION_CONTENT CEGUI_VERSION_MINOR CEGUI_VERSION_MINOR)
      get_preprocessor_entry(CEGUI_TEMP_VERSION_CONTENT CEGUI_VERSION_PATCH CEGUI_VERSION_PATCH)
      get_preprocessor_entry(CEGUI_TEMP_VERSION_CONTENT CEGUI_VERSION_NAME CEGUI_VERSION_NAME)
      set(CEGUI_VERSION "${CEGUI_VERSION_MAJOR}.${CEGUI_VERSION_MINOR}.${CEGUI_VERSION_PATCH}")
      pkg_message(CEGUI "Found CEGUI ${CEGUI_VERSION_NAME} (${CEGUI_VERSION})")
     
      # determine configuration settings
      set(CEGUI_CONFIG_HEADERS
        ${CEGUI_CONFIG_INCLUDE_DIR}/CEGUIConfig.h
      )
      foreach(CFG_FILE ${CEGUI_CONFIG_HEADERS})
        if (EXISTS ${CFG_FILE})
          set(CEGUI_CONFIG_HEADER ${CFG_FILE})
          break()
        endif()
      endforeach()
     
      if (CEGUI_CONFIG_HEADERS)
        file(READ ${CEGUI_CONFIG_HEADERS} CEGUI_TEMP_CONFIG_CONTENT)
        has_preprocessor_entry(CEGUI_TEMP_CONFIG_CONTENT CEGUI_STATIC_LIB CEGUI_CONFIG_STATIC)
        get_preprocessor_entry(CEGUI_TEMP_CONFIG_CONTENT CEGUI_THREAD_SUPPORT CEGUI_CONFIG_THREADS)
        get_preprocessor_entry(CEGUI_TEMP_CONFIG_CONTENT CEGUI_THREAD_PROVIDER CEGUI_CONFIG_THREAD_PROVIDER)
        get_preprocessor_entry(CEGUI_TEMP_CONFIG_CONTENT CEGUI_NO_FREEIMAGE CEGUI_CONFIG_FREEIMAGE)
        if (CEGUI_CONFIG_STATIC AND CEGUI_STATIC)
        elseif (CEGUI_CONFIG_STATIC OR CEGUI_STATIC)
          pkg_message(CEGUI "Build type (static, dynamic) does not match the requested one.")
          set(CEGUI_INCOMPATIBLE TRUE)
        endif ()
      else ()
        pkg_message(OGRE "Could not determine Ogre build configuration.")
        set(CEGUI_INCOMPATIBLE TRUE)
      endif ()
    else ()
      set(CEGUI_INCOMPATIBLE FALSE)
    endif ()
     
    find_library(CEGUI_LIBRARY_REL NAMES ${CEGUI_LIBRARY_NAMES} HINTS ${CEGUI_LIB_SEARCH_PATH} ${CEGUI_PKGC_LIBRARY_DIRS} ${CEGUI_FRAMEWORK_SEARCH_PATH} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
    find_library(CEGUI_LIBRARY_DBG NAMES ${CEGUI_LIBRARY_NAMES_DBG} HINTS ${CEGUI_LIB_SEARCH_PATH} ${CEGUI_PKGC_LIBRARY_DIRS} ${CEGUI_FRAMEWORK_SEARCH_PATH} PATH_SUFFIXES "" "debug")
    make_library_set(CEGUI_LIBRARY)
     
     
    if (CEGUI_INCOMPATIBLE)
      set(CEGUI_LIBRARY "NOTFOUND")
    endif ()
     
     
    set(CEGUI_INCLUDE_DIR ${CEGUI_CONFIG_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR})
    list(REMOVE_DUPLICATES CEGUI_INCLUDE_DIR)
    findpkg_finish(CEGUI)
    add_parent_dir(CEGUI_INCLUDE_DIRS CEGUI_INCLUDE_DIR)
     
    mark_as_advanced(CEGUI_CONFIG_INCLUDE_DIR)
     
    if (NOT CEGUI_FOUND)
      return()
    endif ()
     
     
     
    get_filename_component(CEGUI_LIBRARY_DIR_REL "${CEGUI_LIBRARY_REL}" PATH)
    get_filename_component(CEGUI_LIBRARY_DIR_DBG "${CEGUI_LIBRARY_DBG}" PATH)
    set(CEGUI_LIBRARY_DIRS ${CEGUI_LIBRARY_DIR_REL} ${CEGUI_LIBRARY_DIR_DBG})
     
    # find binaries
    if (NOT CEGUI_STATIC)
    	if (WIN32)
    		find_file(CEGUI_BINARY_REL NAMES "CEGUIBase.dll" HINTS ${CEGUI_BIN_SEARCH_PATH}
              PATH_SUFFIXES "" release relwithdebinfo minsizerel)
    		find_file(CEGUI_BINARY_DBG NAMES "CEGUIBase_d.dll" HINTS ${CEGUI_BIN_SEARCH_PATH}
              PATH_SUFFIXES "" debug )
    	endif()
     
    	get_filename_component(CEGUI_BINARY_DIR_REL "${CEGUI_BINARY_REL}" PATH)
    	get_filename_component(CEGUI_BINARY_DIR_DBG "${CEGUI_BINARY_DBG}" PATH)
    	set(CEGUI_LIBRARY_DIRS ${CEGUI_BINARY_DIR_REL} ${CEGUI_BINARY_DIR_DBG})
    	mark_as_advanced(CEGUI_BINARY_REL CEGUI_BINARY_DBG CEGUI_BINARY_DIR_REL CEGUI_BINARY_DIR_DBG)
    endif()
     
     
    # look for Falagard component
    findpkg_begin(CEGUI_Falagard)
    find_path(CEGUI_Falagard_INCLUDE_DIR NAMES CEGUIFalNamedArea.h HINTS ${CEGUI_INCLUDE_DIRS} PATH_SUFFIXES falagard CEGUI/falagard)
    set(CEGUI_Falagard_INCLUDE_DIR_TMP ${CEGUI_Falagard_INCLUDE_DIR})
    find_path(CEGUI_Falagard_INCLUDE_DIR NAMES FalModule.h HINTS ${CEGUI_INCLUDE_DIRS} PATH_SUFFIXES WindowRendererSets/Falagard CEGUI/WindowRendererSets/Falagard)
    set(CEGUI_Falagard_INCLUDE_DIR ${CEGUI_Falagard_INCLUDE_DIR} ${CEGUI_Falagard_INCLUDE_DIR_TMP})
    set(CEGUI_Falagard_LIBRARY_NAMES "CEGUIFalagardWRBase${CEGUI_LIB_SUFFIX}")
    get_debug_names(CEGUI_Falagard_LIBRARY_NAMES)
    find_library(CEGUI_Falagard_LIBRARY_REL NAMES ${CEGUI_Falagard_LIBRARY_NAMES} HINTS ${CEGUI_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
    find_library(CEGUI_Falagard_LIBRARY_DBG NAMES ${CEGUI_Falagard_LIBRARY_NAMES_DBG} HINTS ${CEGUI_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
    make_library_set(CEGUI_Falagard_LIBRARY)
    findpkg_finish(CEGUI_Falagard)
     
     
    foreach (comp ${CEGUI_RENDERER_COMPONENTS})
    	findpkg_begin(CEGUI_${comp})
    	string(REPLACE "Renderer" "" compName ${comp})
    	find_path(CEGUI_${comp}_INCLUDE_DIR NAMES CEGUI${comp}.h HINTS ${CEGUI_INCLUDE_DIRS} PATH_SUFFIXES RendererModules/${compName} CEGUI/RendererModules/${compName})
    	set(CEGUI_${comp}_LIBRARY_NAMES "CEGUI${comp}${CEGUI_LIB_SUFFIX}")
    	get_debug_names(CEGUI_${comp}_LIBRARY_NAMES)
    	find_library(CEGUI_${comp}_LIBRARY_REL NAMES ${CEGUI_${comp}_LIBRARY_NAMES} HINTS ${CEGUI_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
    	find_library(CEGUI_${comp}_LIBRARY_DBG NAMES ${CEGUI_${comp}_LIBRARY_NAMES_DBG} HINTS ${CEGUI_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
    	make_library_set(CEGUI_${comp}_LIBRARY)
    	findpkg_finish(CEGUI_${comp})
    endforeach (comp)
     
    foreach (comp ${CEGUI_IMAGECODEC_COMPONENTS})
    	findpkg_begin(CEGUI_${comp})
    	find_path(CEGUI_${comp}_INCLUDE_DIR NAMES CEGUI${comp}.h HINTS ${CEGUI_INCLUDE_DIRS} PATH_SUFFIXES ImageCodecModules/${comp} CEGUI/ImageCodecModules/${comp})
    	set(CEGUI_${comp}_LIBRARY_NAMES "CEGUI${comp}${CEGUI_LIB_SUFFIX}")
    	get_debug_names(CEGUI_${comp}_LIBRARY_NAMES)
    	find_library(CEGUI_${comp}_LIBRARY_REL NAMES ${CEGUI_${comp}_LIBRARY_NAMES} HINTS ${CEGUI_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
    	find_library(CEGUI_${comp}_LIBRARY_DBG NAMES ${CEGUI_${comp}_LIBRARY_NAMES_DBG} HINTS ${CEGUI_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
    	make_library_set(CEGUI_${comp}_LIBRARY)
    	findpkg_finish(CEGUI_${comp})
    endforeach (comp)
     
    foreach (comp ${CEGUI_PARSER_COMPONENTS})
    	findpkg_begin(CEGUI_${comp})
    	find_path(CEGUI_${comp}_INCLUDE_DIR NAMES CEGUI${comp}.h HINTS ${CEGUI_INCLUDE_DIRS} PATH_SUFFIXES XMLParserModules/${comp} CEGUI/XMLParserModules/${comp})
    	set(CEGUI_${comp}_LIBRARY_NAMES "CEGUI${comp}${CEGUI_LIB_SUFFIX}")
    	get_debug_names(CEGUI_${comp}_LIBRARY_NAMES)
    	find_library(CEGUI_${comp}_LIBRARY_REL NAMES ${CEGUI_${comp}_LIBRARY_NAMES} HINTS ${CEGUI_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
    	find_library(CEGUI_${comp}_LIBRARY_DBG NAMES ${CEGUI_${comp}_LIBRARY_NAMES_DBG} HINTS ${CEGUI_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
    	make_library_set(CEGUI_${comp}_LIBRARY)
    	findpkg_finish(CEGUI_${comp})
    endforeach (comp)
     
    foreach (comp ${CEGUI_SCRIPT_COMPONENTS})
    	findpkg_begin(CEGUI_${comp})
    	string(REPLACE "ScriptModule" "" compName ${comp})
    	find_path(CEGUI_${comp}_INCLUDE_DIR NAMES CEGUI${compName}.h HINTS ${CEGUI_INCLUDE_DIRS} PATH_SUFFIXES ScriptingModules/${comp} CEGUI/ScriptingModules/${comp})
    	set(CEGUI_${comp}_LIBRARY_NAMES "CEGUI${comp}${CEGUI_LIB_SUFFIX}")
    	get_debug_names(CEGUI_${comp}_LIBRARY_NAMES)
    	find_library(CEGUI_${comp}_LIBRARY_REL NAMES ${CEGUI_${comp}_LIBRARY_NAMES} HINTS ${CEGUI_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
    	find_library(CEGUI_${comp}_LIBRARY_DBG NAMES ${CEGUI_${comp}_LIBRARY_NAMES_DBG} HINTS ${CEGUI_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
    	make_library_set(CEGUI_${comp}_LIBRARY)
    	findpkg_finish(CEGUI_${comp})
    endforeach (comp)
     
     
     
    clear_if_changed(CEGUI_PREFIX_WATCH)

i obtained it from g00gle code
0 x

Post Reply