[Marble-devel] HOWTO (in progress) - build a libmarble application on windows with Qt Creator, MinGW, CMake

Sylvain Paré sylvain.pare at gmail.com
Tue May 11 18:22:33 CEST 2010


Hi Simon,
Thank you for your help!
It point me out that I did a mistake when adding mingw and qmake in my
%PATH.
So I succeed to build my makefile in Qt Create with cmake just after having
my paths well defined.

So I style don't know how to indicate to cmake the path of mingw , qo my
dirt copy of qt's  mingw is still in place but
if I sum up stages to build marble with Qt creator:
(refert to my previous mail to details informations, and I wtil will make a
propore howto at the end)

   - installation of Qt
   - installation of CMake
   - add mingw's path and qmake's path in the environment variable
   - svn co marble; create 'marble-build' dir
   - as explained
here<http://doc.qt.nokia.com/qtcreator-1.1/creator-cmake-support.html>import
the marble\CMakeLists.txt passing "-DQTONLY=ON ../" argument
   - cmake terminate normally
   - then build it
   - and try to execute => libmarblewidget.dll is missing..

I do not have time today to test it further but I made a dirt copy/past of
libmarblewidget.dll near marble.exe and then marble could launch but no map.

FYI  -DQTONLY=on is needed :
ERROR: Could not find KDE4 kde4-config
Call Stack (most recent call first):
CMakeLists.txt:25 (find_package)
-- Configuring incomplete, errors occurred!

Cu tomorrow  for the next update.

Sylvain

ps: I did it in the console:  cmake -G "MinGW Makefiles" -DQTONLY=on ..
;mingw32-make; mingw32-make install. And then marble was properly launchable
with map ( except openstreetmap which staid blue, no dl) . So in Qt creator
it just miss an install stage.



2010/5/11 Simon Schmeißer <mail_to_wrt at gmx.de>

> Hi Sylvain,
>
> Am Montag, 10. Mai 2010 19:37:41 schrieb Sylvain Paré:
> > Hello every one,
> >
> > As I told it some times ago I am trying to build my application using
> > libmarble on windows(xp) with Qt Creator.
> > I will post here all the whole process and problems encountered
> gradually.
> > You are welcome to help me to solves those issues if you have answers! :)
> >
> > At last when the work-through will be found, I will sum it up here as a
> > proposal for an HOWTO on the KDE Techbase.
> >
> cool
>
> > So here is the beginning until the first blocking point :
> >
> > First build Marble:
> >
> >    - installation of Qt sdk
> > 2010.02.1<
> http://get.qt.nokia.com/qtsdk/qt-sdk-win-opensource-2010.02.1.exe
> > >(Qt Creator 1.3.1 Qt 4.6.2 MinGW 3.15 GCC4.4.0)
> >    - installation CMAKE
> > 2.8.1<http://www.cmake.org/files/v2.8/cmake-2.8.1-win32-x86.exe>,
> > during the installation check the box " Add CMake to the system"
> >    - following this http://edu.kde.org/marble/obtain.php => svn co
> marble;
> >    create 'marble-build' dir in the new checked out folder
> >    - as explained
> > here<http://doc.qt.nokia.com/qtcreator-1.1/creator-cmake-support.html
> >impor
> > t the marble\CMakeLists.txt passing "-DQTONLY=ON ../" argument
> >    - you obtain this message error :
> >
> > CMake Error: CMake was unable to find a build program corresponding to
> > "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to
> > select a different build tool.
> > CMake Error: CMake was unable to find a build program corresponding to
> > "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to
> > select a different build tool.
> > CMake Error: Error required internal CMake variable not set, cmake may be
> > not be built correctly.
> > Missing variable is:
> > CMAKE_C_COMPILER_ENV_VAR
> > CMake Error: Error required internal CMake variable not set, cmake may be
> > not be built correctly.
> > Missing variable is:
> > CMAKE_C_COMPILER
> > CMake Error: Could not find cmake module
> > file:D:/marbleSVN/marble-build/CMakeFiles/CMakeCCompiler.cmake
> > CMake Error: Error required internal CMake variable not set, cmake may be
> > not be built correctly.
> > Missing variable is:
> > CMAKE_CXX_COMPILER_ENV_VAR
> > CMake Error: Error required internal CMake variable not set, cmake may be
> > not be built correctly.
> > Missing variable is:
> > CMAKE_CXX_COMPILER
> > CMake Error: Could not find cmake module
> > file:D:/marbleSVN/marble-build/CMakeFiles/CMakeCXXCompiler.cmake
> > CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
> > CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
> > -- Configuring incomplete, errors occurred!
> >
> >    - I haven't found yet how to solve this (i.e indicate to CMake the
> path
> >    of MinGW, I set an environment variable but it did not fix this.. if
> you
> >    have the answer.) properly so I just copy/paste C:\Qt\2010.02.1\mingw
> >  to C:\mingw
> >    - now when you retry to import your cmake project in Qt Creator you
> have
> >    this error :
> >
> > -- The C compiler identification is unknown
> >
> > -- The CXX compiler identification is unknown
> >
> > -- Check for working C compiler: C:/mingw/bin/gcc.exe
> >
> > -- Check for working C compiler: C:/mingw/bin/gcc.exe -- broken
> >
> > CMake Error at C:/Program Files/CMake
> > 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
> >
> > The C compiler "C:/mingw/bin/gcc.exe" is not able to compile a simple
> > testprogram.
> >
> > It fails with the following output: Change Dir:
> > D:/marbleSVN/marble-build/CMakeFiles/CMakeTmp
> >
> >
> >   Run Build Command:C:/mingw/bin/mingw32-make.exe "cmTryCompileExec/fast"
> >
> > C:/mingw/bin/mingw32-make.exe -f
> CMakeFiles\cmTryCompileExec.dir\build.make
> >
> > CMakeFiles/cmTryCompileExec.dir/build
> >
> > mingw32-make.exe[1]: Entering directory
> >
> > `D:/marbleSVN/marble-build/CMakeFiles/CMakeTmp'
> >
> > "C:\Program Files\CMake 2.8\bin\cmake.exe" -E cmake_progress_report
> >
> > D:\marbleSVN\marble-build\CMakeFiles\CMakeTmp\CMakeFiles 1
> >
> > Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj
> >
> > C:\mingw\bin\gcc.exe -o
> CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj
> >
> > -c D:\marbleSVN\marble-build\CMakeFiles\CMakeTmp\testCCompiler.c
> >
> > mingw32-make.exe[1]: ***
> >
> > [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 1
> >
> > mingw32-make.exe[1]: Leaving directory
> >
> > `D:/marbleSVN/marble-build/CMakeFiles/CMakeTmp'
> >
> > mingw32-make.exe: *** [cmTryCompileExec/fast] Error 2
> >
> >
> >    CMake will not be able to correctly generate this project.
> >
> > Call Stack (most recent call first):
> >
> > CMakeLists.txt:1 (project)
> >
> > -- Configuring incomplete, errors occurred!
> >
> >
> > So here where I am!
> >
> > If any one can help...
>
> I'll try to do so ...
>
> 1. check that cmake.exe and gcc.exe are in your %PATH%
> -   open a commandline-window (start->run programm->cmd)
> -   run "cmake" - it should give you a help message and show you what
> compilation options it found
> -   run "gcc -v" it should give you version info
> -   run "qmake" it should give you help output
>
> if any of those doesn't work you need to add the relevant path to the
> system
> variable:
> http://www.computerhope.com/issues/ch000549.htm
>
> (Hint: make sure not to add the directory %QT-installation-dir%/bin but
> rather
> %QT-installation-dir%/qt/bin, there are for some reason incompatible dll's
> that might lead to crashes)
>
> 2. now you can compile marble
> open the cmd-window
> cd to the marble dir
> create a build directory (mkdir build)
> cd build
> cmake -G "MinGW Makefiles" ..
> (I don't think you need to pass the -DQTONLY=on as it will build qtonly by
> default if no kde-libraries are found)
>
> 3. check that marble runs
>
> 4. find out what you need to do if you want to integrate it into Qt Creator
>
> however I would not try to load marble in qt-creator but rather only use
> marble as a static library (.a) that is linked into or as a dynamic library
> (.a +.dll) and use Qt Creator only for your custoum code, this might save
> you
> some troubles?
> >
> > I will continue to search a solution tomorrow
> >
> good luck
> > CU
> >
> > Sylvain (aka GarthPS)
> >
> cu
> Simon
> _______________________________________________
> Marble-devel mailing list
> Marble-devel at kde.org
> https://mail.kde.org/mailman/listinfo/marble-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/marble-devel/attachments/20100511/da1aa9e4/attachment-0001.htm 


More information about the Marble-devel mailing list