Qt Celestia

Discussion forum for Celestia developers; topics may only be started by members of the developers group, but anyone can post replies.
cartrite
Posts: 1786
Joined: 15.09.2005
With us: 14 years 8 months
Location: Pocono Mountains, Pennsylvania, USA

Post #41by cartrite » 11.01.2008, 01:57

I guess I should have quit while I was ahead. I tried the MinGW compiler. I tried qt4.3.3 and the installer had an option to download MinGW and I chose that option. That downloaded vesion MinGW-3.4.2.exe. It looks like it wants to build but I get stuck building windirectory.cpp.

Code: Select all

celutil\windirectory.cpp: In member function `virtual bool WindowsDirectory::nex
tFile(std::string&)':
celutil\windirectory.cpp:65: error: invalid const_cast from type `const char*' t
o type `const TCHAR*'
celutil\windirectory.cpp:74: error: invalid conversion from `WCHAR*' to `char'
celutil\windirectory.cpp:74: error:   initializing argument 1 of `std::basic_str
ing<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operat
or=(_CharT) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std:
:allocator<char>]'
celutil\windirectory.cpp:82: error: invalid conversion from `WCHAR*' to `char'
celutil\windirectory.cpp:82: error:   initializing argument 1 of `std::basic_str
ing<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operat
or=(_CharT) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std:
:allocator<char>]'
celutil\windirectory.cpp: In function `bool IsDirectory(const std::string&)':
celutil\windirectory.cpp:102: error: invalid const_cast from type `const char*'
to type `const TCHAR*'
mingw32-make[1]: *** [release/windirectory.o] Error 1
mingw32-make[1]: Leaving directory `H:/celestia/01102008-qt4/celestia/src'


I tried a little something by removing the extra celutil win32 files from celestia.pro and the build stopped again at glext.cpp. So maybe I need a different MinGW compiler version?????????? 8O

Thank You Linux :wink: . Windows your days are numbered on my machine. :evil:
I'm Done for now.
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap 15.0

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 18 years 4 months
Location: Seattle, Washington, USA

Post #42by chris » 11.01.2008, 02:31

cartrite wrote:I guess I should have quit while I was ahead. I tried the MinGW compiler. I tried qt4.3.3 and the installer had an option to download MinGW and I chose that option. That downloaded vesion MinGW-3.4.2.exe. It looks like it wants to build but I get stuck building windirectory.cpp.

Code: Select all

celutil\windirectory.cpp: In member function `virtual bool WindowsDirectory::nex
tFile(std::string&)':
celutil\windirectory.cpp:65: error: invalid const_cast from type `const char*' t
o type `const TCHAR*'
celutil\windirectory.cpp:74: error: invalid conversion from `WCHAR*' to `char'
celutil\windirectory.cpp:74: error:   initializing argument 1 of `std::basic_str
ing<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operat
or=(_CharT) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std:
:allocator<char>]'
celutil\windirectory.cpp:82: error: invalid conversion from `WCHAR*' to `char'
celutil\windirectory.cpp:82: error:   initializing argument 1 of `std::basic_str
ing<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operat
or=(_CharT) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std:
:allocator<char>]'
celutil\windirectory.cpp: In function `bool IsDirectory(const std::string&)':
celutil\windirectory.cpp:102: error: invalid const_cast from type `const char*'
to type `const TCHAR*'
mingw32-make[1]: *** [release/windirectory.o] Error 1
mingw32-make[1]: Leaving directory `H:/celestia/01102008-qt4/celestia/src'


I tried a little something by removing the extra celutil win32 files from celestia.pro and the build stopped again at glext.cpp. So maybe I need a different MinGW compiler version?????????? 8O


It looks like I forgot to check in a modification to windirectory.cpp to make it compile with Qt4. I had to switch to using the ASCII versions of the FindFile functions because the Qt build system enables UNICODE. If you sync to CVS, everything should build fine.

--Chris

cartrite
Posts: 1786
Joined: 15.09.2005
With us: 14 years 8 months
Location: Pocono Mountains, Pennsylvania, USA

Post #43by cartrite » 11.01.2008, 05:13

Getting there. Still a problem with glext.cpp though.

Code: Select all

eg" -I"c:\Qt\4.3.3\include\ActiveQt" -I"release" -I"." -I"c:\Qt\4.3.3\mkspecs\wi
n32-g++" -o release\glext.o celengine\glext.cpp
celengine\glext.cpp: In function `void InitExt_ARB_multitexture()':
celengine\glext.cpp:369: error: `wglGetProcAddress' undeclared (first use this f
unction)
celengine\glext.cpp:369: error: (Each undeclared identifier is reported only onc
e for each function it appears in.)
celengine\glext.cpp: In function `void InitExt_ARB_texture_compression()':
.
.
.
.
InitExt_ARB_vertex_buffer_object()':
celengine\glext.cpp:757: error: `wglGetProcAddress' undeclared (first use this f
unction)
celengine\glext.cpp: In function `void InitExt_ARB_vertex_shader()':
celengine\glext.cpp:775: error: `wglGetProcAddress' undeclared (first use this f
unction)
celengine\glext.cpp: In function `void InitExt_ARB_shader_objects()':
celengine\glext.cpp:785: error: `wglGetProcAddress' undeclared (first use this f
unction)
mingw32-make[1]: *** [release/glext.o] Error 1
mingw32-make[1]: Leaving directory `H:/celestia/01102008-qt4/celestia/src'
mingw32-make: *** [release] Error 2

cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap 15.0

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 1 month
Location: Hamburg, Germany

Post #44by t00fri » 11.01.2008, 10:00

chris wrote:
...

It looks like I forgot to check in a modification to
windirectory.cpp to make it compile with Qt4. I had to switch
to using the ASCII versions of the FindFile functions because
the Qt build system enables UNICODE. If you sync to CVS,
everything should build fine.

--Chris


Chris,

++++++++++++++++++++++++++++++++++
after you fixed windirectory.cpp, I now can build celestia-qt4
without ANY problems under MSVC. (VS2003.Net).
++++++++++++++++++++++++++++++++++

There were a few changes required, but with some previous
experience in this game, this was almost straightforward.


Tonight I shall give a step-by-step instruction.
In short:

  • qtglwidget.cpp:
    #ifdef for #include <unistd.h> ->e.g. #include <ctime>
  • qtcelestialbrowser.cpp:
    #include <algorithm> missing
  • LFLAGS: add (obviously required!)
    /NODEFAULTLIB:libc
  • possibly adapt the names of libjpg and|or libpng in celestia.pro, depending on the versions used.
  • copy celestia-qt4.exe from release directory to the celestia root directory.


Thats all.

Here is the result ;-)

Image

Bye Fridger
Image

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 18 years 4 months
Location: Seattle, Washington, USA

Post #45by chris » 11.01.2008, 17:53

t00fri wrote:
chris wrote:
...

It looks like I forgot to check in a modification to
windirectory.cpp to make it compile with Qt4. I had to switch
to using the ASCII versions of the FindFile functions because
the Qt build system enables UNICODE. If you sync to CVS,
everything should build fine.

--Chris

Chris,

++++++++++++++++++++++++++++++++++
after you fixed windirectory.cpp, I now can build celestia-qt4
without ANY problems under MSVC. (VS2003.Net).
++++++++++++++++++++++++++++++++++

There were a few changes required, but with some previous
experience in this game, this was almost straightforward.


Tonight I shall give a step-by-step instruction.
In short:

  • qtglwidget.cpp:
    #ifdef for #include <unistd.h> ->e.g. #include <ctime>
  • qtcelestialbrowser.cpp:
    #include <algorithm> missing
  • LFLAGS: add (obviously required!)
    /NODEFAULTLIB:libc
  • possibly adapt the names of libjpg and|or libpng in celestia.pro, depending on the versions used.
  • copy celestia-qt4.exe from release directory to the celestia root directory.

Thats all.

Here is the result ;-)


Excellent! It's great to hear that this works. Compiler compatibility on Windows was the biggest unknown with Qt4, but it looks like it's not a problem at all. Supporting both free and commercial compilers on Windows is ideal.

--Chris

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 18 years 4 months
Location: Seattle, Washington, USA

Post #46by chris » 11.01.2008, 17:54

cartrite wrote:Getting there. Still a problem with glext.cpp


I checked in a fix to use Qt's wglGetProcAddress wrapper instead of calling wglGetProcAddress directly. It's not elegant, but it works.

--Chris

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 1 month
Location: Hamburg, Germany

Post #47by t00fri » 11.01.2008, 19:05

chris wrote:
Excellent! It's great to hear that this works. Compiler compatibility on Windows was the biggest unknown with Qt4, but it looks like it's not a problem at all. Supporting both free and commercial compilers on Windows is ideal.

--Chris


It's really nice, actually, since the Qt installation more or less automatically takes care of the proper qmake configuration, depending on the installed compiler.

The whole procedure boiled down to the following:
  • Download the .zipped OpenSource Qt distribution from here:
    http://trolltech.com/developer/downloads/qt/windows
  • Unzip the archive e.g. to C:\Qt\4.3.3
  • Add C:\Qt\4.3.3\bin to the PATH environment variable in the dialog
    Control Panel ->System->Advanced->Environment. Variables. Then 'qmake' may be executed by typing its name from any directory.
  • Follow the installation described in INSTALL:
    Type into the console
    >C:
    > cd \Qt\4.3.3
    > configure
    > nmake
    The compilation takes ~ 1 hour.
  • There are qmake.conf files for many compilers in the directory Qt\4.3.3\mkspecs.
    E.g.
    win32-msvc
    win32-msvc.net
    win32-msvc2005

    So I suppose things should also work for the free 2005 express version!
  • Take a fresh CVS copy and cd to celestia/src/qt
  • do the following modifications:
    qtglwidget.cpp:
    replace: #include <unistd.h> ==> #include <time.h>,
    since unistd.h does NOT port to Windows, and time.h compiles BOTH under Windows and Linux, this avoids an #ifdef.

    qtcelestialbrowser.cpp
    add #include <algorithm>
    otherwise sort and other std:: methods will not compile under Windows.
    May be done with an

    #ifdef _WIN32
    #include <algorithm>
    #endif

    But it also works without the #ifdef for both Linux and Windows.
  • cd to celestia/src and add to the project file celestia.pro

    DESTDIR = ..\
  • Next, you may add e.g. in qmake.conf that is used in for your compiler (cf. Makefile.Release, LFLAGS)

    QMAKE_LFLAGS = /NOLOGO =======>
    QMAKE_LFLAGS = /NODEFAULTLIB:libc /NOLOGO
  • Return to celestia/src, type
    > qmake celestia.pro
    which generates 'Makefile.Release' and 'Makefile.Debug'
  • > nmake -f Makefile.Release
    keep fingers crossed... If compilation successful, cd to the celestia root directory and start
    > celestia-qt4.exe

    Aaaaaaaaaaaaaaaaaaaah!
  • Next you can generate very easily the VC2003.Net project files by typing into the console in src

    +++++++++++++++++++++++++
    > qmake -t vcapp celestia.pro
    +++++++++++++++++++++++++

    This is great, Just start the VS2003.Net GUI and compile: ===> it just works, no fiddling whatsoever! I am sure the same procedure works for the 2005.Net compiler as well.
  • By typing
    > assistant
    into the console, you open an EXCELLENT help application with tutorials and most detailed and clear explanations!!!


GOOD Luck!

+++++++++++++++
Chris, let me know if you want me to commit some of this...
+++++++++++++++

Bye Fridger
Last edited by t00fri on 11.01.2008, 19:27, edited 3 times in total.
Image

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 18 years 4 months
Location: Seattle, Washington, USA

Post #48by chris » 11.01.2008, 19:21

t00fri wrote:
GOOD Luck!

+++++++++++++++
Chris, let me know if you want me to commit some of this...
+++++++++++++++

Bye Fridger


Yes, please do commit those changes to qtglwidget.cpp and qtcelestialbrowser.cpp. I will soon try building with VS2005. If you don't mind me copying this list of instructions, I can add it to the WikiBook.

--Chris

phoenix
Posts: 214
Joined: 18.06.2002
With us: 17 years 11 months
Location: Germany - Berlin

Post #49by phoenix » 11.01.2008, 19:30

nice to see that it's working with VS200X too.
it took me quite a while to finish the compilation and linking with mingw (damn libjpeg and libpng).

now I have to start it out of commandline so I can add the path of mingw and QTs external libs.
but it's running smoothly now ;-)

the first thing I noticed was the cursor blocking at my screen-boundaries when looking around holding the right mouse button.
that's not intentional right?
most recent celestia win32-SVN-build - use at your own risk (copy over existing 1.5.1 release)

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 1 month
Location: Hamburg, Germany

Post #50by t00fri » 11.01.2008, 19:31

chris wrote:
t00fri wrote:
GOOD Luck!

+++++++++++++++
Chris, let me know if you want me to commit some of this...
+++++++++++++++

Bye Fridger

Yes, please do commit those changes to qtglwidget.cpp and qtcelestialbrowser.cpp. I will soon try building with VS2005. If you don't mind me copying this list of instructions, I can add it to the WikiBook.

--Chris


Sure that's why I did it... I am quite enthusiastic about Qt at this stage. It's worth learning...

F.
Image

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 1 month
Location: Hamburg, Germany

Post #51by t00fri » 11.01.2008, 19:46

Chris wrote:Yes, please do commit those changes to qtglwidget.cpp and qtcelestialbrowser.cpp.


Done!

I also added DESTDIR = ..\

in celestia.pro such that the output celestia-qt4.exe appears in the celestia-root directory.

Bye Fridger
Image

cartrite
Posts: 1786
Joined: 15.09.2005
With us: 14 years 8 months
Location: Pocono Mountains, Pennsylvania, USA

Post #52by cartrite » 11.01.2008, 20:02

I'm not sure what version of VC2003.Net Fridger is using but I got nowhere with Microsoft Visual C++ Toolkit 2003 when I tried to build the source QT version. I tried to install the MinGW compiler and QT binaries version and I'm still not quite there either. Chris's last fix for glext.cpp worked only to get a link error. After I got past libpng1 and libjpeg2 but it failed for an undefined reference to 'libmsvcrt_a_iname' and '_nm__iob'

Anyhow, what I got done in 20 minutes on Linux has taken me 2 days and counting with windows. But no more. I give up.

Since other are getting this to work, something else must be stopping this from working on my system and i just lost my patience with windows.

Good Luck to the rest of ya
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap 15.0

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 1 month
Location: Hamburg, Germany

Post #53by t00fri » 11.01.2008, 20:43

Chris,

I think your last glext.cpp fix was no good ;-) . It generated a link error also in my environment and didn't help cartrite either ...

Can we return to the old setup?

F.
Image

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 1 month
Location: Hamburg, Germany

Post #54by t00fri » 11.01.2008, 20:46

cartrite,

I am sorry to read that things don't work well for you. Probably the best is to try to get celestia-qt compiled with the free VS2005 Express.

I have no idea why things don't work for you. I think it was very important that I compiled Qt on my machine, since then the resident default compiler will be automatically implemented.

Bye Fridger
Image

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 18 years 4 months
Location: Seattle, Washington, USA

Post #55by chris » 11.01.2008, 20:49

t00fri wrote:Chris,

I think your last glext.cpp fix was no good ;-) . It generated a link error also in my environment and didn't help cartrite either ...

Can we return to the old setup?

F.


Strange . . . I tested it with both MinGW / Qt4 and MSVC / Win32. I'll figure out what's going on. I can't build MinGW/Qt4 without the change.

--Chris

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 15 years 4 months
Location: Nancy, France

Post #56by Vincent » 11.01.2008, 20:55

cartrite wrote:I'm not sure what version of VC2003.Net Fridger is using but I got nowhere with Microsoft Visual C++ Toolkit 2003 when I tried to build the source QT version.

I also have problems when trying to compile Qt with Microsoft Visual C++ Toolkit 2003. My compiler stop responding when reading the qtdemo.pro file during the 'configure' phase...
Last edited by Vincent on 11.01.2008, 20:59, edited 1 time in total.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

cartrite
Posts: 1786
Joined: 15.09.2005
With us: 14 years 8 months
Location: Pocono Mountains, Pennsylvania, USA

Post #57by cartrite » 11.01.2008, 20:57

I'm not sure if the real cause was the 2003 toolkit or Microsoft SDK. All the former links to the SDK files are now redirected to http://www.microsoft.com/downloads/deta ... laylang=en
and I'm not sure if this is what I really need. So I think I'm going to sit back for a while and see if others have luck. Changing the build environment for Windows will probably be a nightmare. 8O I think I'll need to get good and drunk :?
before I start and the problem there is I quit drinking.
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap 15.0

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 1 month
Location: Hamburg, Germany

Post #58by t00fri » 11.01.2008, 20:57

I never encountered ANY problems with glext.cpp. Strange...

F.
Image

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 1 month
Location: Hamburg, Germany

Post #59by t00fri » 11.01.2008, 21:01

Vincent wrote:
cartrite wrote:I'm not sure what version of VC2003.Net Fridger is using but I got nowhere with Microsoft Visual C++ Toolkit 2003 when I tried to build the source QT version.
I also have problems when trying to compile Qt with Microsoft Visual C++ Toolkit 2003. My compiler stop responding when reading qtdemo.pro file during the "configure" phase...


What do you do with qtdemo.pro??

I think for compilation of Qt/4.3.3 you are ONLY supposed to hit

> configure
> nmake

Only at the END of all this you hit qtdemo to start the demos...It all worked fine for me, actually.

F.
Image

cartrite
Posts: 1786
Joined: 15.09.2005
With us: 14 years 8 months
Location: Pocono Mountains, Pennsylvania, USA

Post #60by cartrite » 11.01.2008, 21:02

t00fri wrote:I never encountered ANY problems with glext.cpp. Strange...

F.
That's probably because your not using the MinGW compiler. With the binary MinGW version of QT, you are stuck with g++win32. So maybe the config file needs to be set up correctly to compile Celestia instead of changing the Celestia source code. That's what I've been trying but have had no luck.
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap 15.0


Return to “Ideas & News”

Who is online