Cross platform coding



  • Hello,

    So I am confused, very confused and I should be for I do not speak programmer.

    I am just a guy who wanted to explore the possibility of creating a game for my 3 year old.

    Set out on the journey..
    Ask a couple of friends who are programers where to start...one says C++ the other Pascal. Simple enough spend a few days...a week actually... finding which language has the best support system. C++ wins.
    During the research notice a few articles on IDEs and cross platform coding. Contemplate that I myself use both Windows and Ubuntu and I have friends who use Apples. So research IDEs Narrow done to Code::Blocks and QT. I am enthralled with the interface for QT so spend some time understanding the IDE.
    In the game I desire to use an earth globe as the "game terrain" so look for a Google Earth type "script" which can be embedded into a C++ application. Low and behold KDE has such a thing. Cannot make it work in Windows QT Creator so go to the Marble IRC and chat with a fellow who suggested to start coding in Ubuntu. Reboot to Ubuntu and follow the KDE Marble Tutorials and get a working QT pro file and source file. Actually works Ya Hoo
    Reboot to Windows open QT open the project pro file read the warning(why is there a warning?) configure it and then run it.
    BAMM nothing but errors.

    Any ideas what I did wrong?
    Bill


  • Moderators

    We need to see those errors, I'm afraid. And the warning you mentioned, too (I suspect the warning was about the existence of .pro.user file - you should delete this file before using the code on another system/ machine. Better yet is to use some version control (git, mercurial)).

    Qt in general is cross-platform, but Marble might have some platform-specific code in it. Also, I think KDE uses cmake build system which is a bit different than Qt's qmake.

    On an other note - congratulations for your idea and persistence! I'm really impressed!



  • Sierdzio,

    Here is the path to my insanity...

    Compiling from a SUDO Terminal using Ubuntu....
    There are folders QT4 and marble located at /usr/include

    http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus... worked and I got a screen
    http://techbase.kde.org/Projects/Marble/MarbleMarbleWidget... worked this is also the first with instructions on how to build a project file
    http://techbase.kde.org/Projects/Marble/MarbleSignalsSlots....worked I altered the pro file from tutorial 2 and suceeded in creating a project with Creator
    http://techbase.kde.org/Projects/Marble/MarbleGeoPainter... same as above

    I have all the Header and Source files central located at C:\Programs\marble and this is in my path.

    I could not duplicate the warning I got when I opened the file for the first time.

    When running the marble_weather project file resulted in the following...

    Compile output...

    06:35:23: Running steps for project marble_weather...
    06:35:23: Configuration unchanged, skipping qmake step.
    06:35:23: Starting: "C:\Programs\MinGW\bin\mingw32-make.exe"
    C:/Programs/MinGW/bin/mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory G:/gameprojects/marble_weather-build-Desktop-Release' g++ -c -O2 -Wall -Wextra -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I"c:\Programs\Qt\include\QtCore" -I"c:\Programs\Qt\include\QtGui" -I"c:\Programs\Qt\include" -I"..\qt" -I"c:\Programs\Qt\include\ActiveQt" -I"release" -I"." -I"c:\Programs\Qt\mkspecs\win32-g++" -o release\marble_weather.o ..\qt\marble_weather.cpp ..\qt\marble_weather.cpp:3:33: marble/MarbleGlobal.h: No such file or directory ..\qt\marble_weather.cpp:4:33: marble/MarbleWidget.h: No such file or directory ..\qt\marble_weather.cpp:5:38: marble/AbstractFloatItem.h: No such file or directory ..\qt\marble_weather.cpp:7: error:Marble' is not a namespace-name
    ..\qt\marble_weather.cpp:7: error: expected namespace-name before ';' token
    ..\qt\marble_weather.cpp: In function int qMain(int, char**)': ..\qt\marble_weather.cpp:14: error:MarbleWidget' was not declared in this scope
    ..\qt\marble_weather.cpp:14: error: mapWidget' was not declared in this scope ..\qt\marble_weather.cpp:14: error:MarbleWidget' is not a type
    ..\qt\marble_weather.cpp:19: error: Mercator' was not declared in this scope ..\qt\marble_weather.cpp:29: error: template argument 1 is invalid ..\qt\marble_weather.cpp:29: error: invalid type in declaration before '(' token ..\qt\marble_weather.cpp:29: error: request for memberbrk' in _container_', which is of non-class typeint'
    ..\qt\marble_weather.cpp:29: error: request for member i' incontainer', which is of non-class type int' ..\qt\marble_weather.cpp:29: error: request for membere' in _container_', which is of non-class typeint'
    ..\qt\marble_weather.cpp:29: error: request for member brk' incontainer', which is of non-class type int' ..\qt\marble_weather.cpp:29: error: request for memberi' in _container_', which is of non-class typeint'
    ..\qt\marble_weather.cpp:29: error: AbstractFloatItem' was not declared in this scope ..\qt\marble_weather.cpp:29: error:floatItem' was not declared in this scope
    ..\qt\marble_weather.cpp:29: error: request for member i' incontainer', which is of non-class type int' ..\qt\marble_weather.cpp:29: error: request for memberbrk' in _container_', which is of non-class typeint'
    ..\qt\marble_weather.cpp:29: warning: unused variable 'AbstractFloatItem'
    ..\qt\marble_weather.cpp:14: warning: unused variable 'MarbleWidget'
    ..\qt\marble_weather.cpp:19: warning: unused variable 'Mercator'
    mingw32-make[1]: Leaving directory `G:/gameprojects/marble_weather-build-Desktop-Release'
    mingw32-make[1]: *** [release/marble_weather.o] Error 1
    mingw32-make: *** [release] Error 2
    06:35:24: The process "C:\Programs\MinGW\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project marble_weather (target: Desktop)
    When executing step 'Make'

    What I do not understand is why Creator does not seem to find the header files? And if it did would the other errors be resolved?

    If you know of a better way to get the globe into a Creator gui application I would love to hear it.

    Thanks,
    Bill


  • Moderators

    Yeah, it seems that those errors will go away once g++ finds the headers. There are several ways why it may fail. One, although unlikely, is shadow building. You can turn it off in "Projects" pane in QtCreator.

    Others will require you to post the .pro file of marble.

    BTW. the links you provided do not work.



  • Sierdizo,

    The links is just another attempt of the Universe to challenge my optimism.
    When I clicked the links I too went to a page other than I expected. But the page did have a link to Marble which did have some instruction on building a proper QT pro file so I am going to look at that information.
    Of course the instructions for compiling Marble do not work so I feel using Marble is a loss.

    But, thank you for your help and interest.
    Bill


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.