Re: [AD] [A4.4.1.1] Windows profile build fails

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2011-03-11, Edgar <edgarreynaldo@xxxxxxxxxx> wrote:
> 
>  From running 'make -B -n' and examining the output, here is the command 
> that builds the Allegro profile library :
> 
> /"C:\Tools\CMake\CMake 2.8\bin\cmake.exe" -E cmake_link_script 
> CMakeFiles\allegro.dir\link.txt --verbose=/
> 
> The contents of allegro/build/CMakeFiles/allegro.dir/link.txt are :
> 
> /C:\mingw\bin\gcc.exe    -shared -o lib\alleg44-profile.dll 
> -Wl,--out-implib,lib\liballeg44-profile.dll.a 
> -Wl,--major-image-version,4,--minor-image-version,4 
> -Wl,@CMakeFiles\allegro.dir\objects1.rsp -lkernel32 -luser32 -lgdi32 
> -lcomdlg32 -lole32 -Wl,-Bstatic -ldinput -Wl,-Bdynamic -lddraw 
> -Wl,-Bstatic -ldxguid -Wl,-Bdynamic -lwinmm -Wl,-Bstatic -ldsound 
> -Wl,-Bdynamic -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 
> -loleaut32 -luuid -lcomdlg32 -ladvapi32/
> 
> If I guess correctly, the undefined references to 'mcount' are because 
> the '-pg' flag was missing during the profiling library build.

Probably right.

> I looked at allegro/CMakeLists.txt and on lines 314-321 it sets 
> CMAKE_EXE_LINKER_FLAGS_PROFILE to "-pg" if COMPILER_GCC is set :
> 
> /if(COMPILER_GCC)
>     set(CMAKE_C_FLAGS_PROFILE "-pg"
>         CACHE STRING "profiling flags")
>     set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE}"
>         CACHE STRING "profiling flags")
>     set(CMAKE_EXE_LINKER_FLAGS_PROFILE "-pg"
>         CACHE STRING "profiling flags")
> endif(COMPILER_GCC)/
> 
> So, shouldn't it be linking with the '-pg' flag then? Or is there some 
> COMPILER_MINGW variable that needs to be checked.
> 
> How do you set a libraries linking flags with cmake?

You can edit variables in the cmake GUI.  You may have to select
"Advanced view" or something like that.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/