Compiler Errors on Celetsia 1.4pre-FT1.1

General discussion about Celestia that doesn't fit into other forums.
Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Compiler Errors on Celetsia 1.4pre-FT1.1

Post #1by BlindedByTheLight » 13.10.2005, 00:33

Per Fridger's suggestion:

Steven, John,

do you realize that you both get the same compiler errors (!?), while Hank (Mac) and Toti and I (LInux) are doing fine. So please let's compare the respective compiler versions involved...

I thought I'd start this thread since both John and I are having trouble compiling the new FT1.1 version and seem to be having the same problem DESPITE him being on Linux (?) and me being on a Mac.

To help clear things up, I am using Xcode 2.1 on the Mac (OS 10.4.2). I believe Xcode is using GCC 4.0 - but I can't verify that for sure b/c I don't really have any frickin' idea what any of that means.

However, John... perhaps you could weigh in with your stats? And perhaps some coders out there can weigh in on what we can do to tweak the code to enable compiling?

My error is reported here: http://celestiaproject.net/forum/viewtopic.php?p=60943#60943

John's error is thus:

john Van Vliet wrote:hi For fedora4 -Gnome config runs fine
./configure --with-gnome --with-lua=/usr --prefix=/usr/Celestia
BUT
make ( becides 100's of warning: ?€?????????€™ has virtual functions but non-virtual destructor ) i am getting an error in staroctree.cpp
........................
staroctree.cpp:67: error: too few template-parameter-lists
staroctree.cpp:69: error: too few template-parameter-lists
staroctree.cpp:71: error: too few template-parameter-lists
staroctree.cpp:73: error: too few template-parameter-lists

.....................
and after comenting this out and redoing make
i get the same error in dsooctree.cpp lines 61 to 63


We're both getting the "too-few-templates parameter" error. Thoughts anyone?
Last edited by BlindedByTheLight on 13.10.2005, 01:37, edited 1 time in total.
Steven Binder, Mac OS X 10.4.10

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #2by BlindedByTheLight » 13.10.2005, 01:35

john Van Vliet wrote:I have read in the forda fourms that gcc-4.0.1-4.fc4 is a bit to new and that there have been problems with it . Latter on tonight i will downgrade to 3.4 and remake , also i am wget-ing the windows exe and willsee how it works ,along with building the source ( on win xp -- vc++.net )


I would like to try to downgrade as well (unless some one weighs in with a GCC 4.0 fix...?). Anyone know how to get Xcode to "downgrade" to an earlier GCC? I tried noodling around and made things worse...
Steven Binder, Mac OS X 10.4.10

Toti
Developer
Posts: 338
Joined: 10.02.2004
With us: 20 years 9 months

Post #3by Toti » 13.10.2005, 02:17

Steve,

Just an idea:

in dsooctree.h put:

Code: Select all

template<>

just before:

Code: Select all

void DSOOctree::processVisibleObjects...

And do the same with:

Code: Select all

void DSOOctree::processCloseObjects...


Do the error messages change?

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #4by BlindedByTheLight » 13.10.2005, 02:28

Toti wrote:Steve,

Just an idea:

in dsooctree.h put:

Code: Select all

template<>

just before:

Code: Select all

void DSOOctree::processVisibleObjects...

And do the same with:

Code: Select all

void DSOOctree::processCloseObjects...


Do the error messages change?


I'll give it a try. But to clarify... "just before" so the new text is:

template<>void DSOOctree::processVisibleObjects...

Or did you mean on the line before?

Thanks...
Steven Binder, Mac OS X 10.4.10

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #5by BlindedByTheLight » 13.10.2005, 02:30

Actually, as I look at the code, it already has the template thing...


template<>
void DSOOctree::processVisibleObjects(DSOHandler& processor,
const Point3d& obsPosition,
const Planef* frustumPlanes,
const float limitingFactor,
const double scale) const;

template<>
void DSOOctree::processCloseObjects(DSOHandler& processor,
const Point3d& obsPosition,
const double boundingRadius,
const double scale) const;


So do I do another "template<>" on the same line as the "void"? ???
Steven Binder, Mac OS X 10.4.10

Toti
Developer
Posts: 338
Joined: 10.02.2004
With us: 20 years 9 months

Post #6by Toti » 13.10.2005, 02:30

Strange. I just patched my codebase with a diff Fridger sent me and they are not there...
Sorry for the confusion, there's no reason to make any change now.
Last edited by Toti on 13.10.2005, 02:33, edited 1 time in total.

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #7by BlindedByTheLight » 13.10.2005, 02:33

Looks like we crossed in the cyber-space... didja see my prior post?
Steven Binder, Mac OS X 10.4.10

Toti
Developer
Posts: 338
Joined: 10.02.2004
With us: 20 years 9 months

Post #8by Toti » 13.10.2005, 02:52

I stupidly patched the wrong directory...must clean up my folders ;).
Fridger's patch went fine now.

There's no need to make those changes I wrote in my previous post: they are already there and I see in your XCode screenshot that they made some difference. Let's try this:
In staroctree.cpp put

Code: Select all

template<>

before each of these lines:

Code: Select all

unsigned int                                     DynamicStarOctree::SPLIT_THRESHOLD     = 75;
DynamicStarOctree::LimitingFactorPredicate*      DynamicStarOctree::limitingFactorPredicate = starAbsoluteMagnitudePredicate;
DynamicStarOctree::StraddlingPredicate*          DynamicStarOctree::straddlingPredicate = starOrbitStraddlesNodesPredicate;
DynamicStarOctree::ExclusionFactorDecayFunction* DynamicStarOctree::decayFunction       = starAbsoluteMagnitudeDecayFunction;

ie:

Code: Select all

template<> unsigned int                                     DynamicStarOctree::SPLIT_THRESHOLD     = 75;
template<> DynamicStarOctree::LimitingFactorPredicate*      DynamicStarOctree::limitingFactorPredicate = starAbsoluteMagnitudePredicate;
template<> DynamicStarOctree::StraddlingPredicate*          DynamicStarOctree::straddlingPredicate = starOrbitStraddlesNodesPredicate;
template<> DynamicStarOctree::ExclusionFactorDecayFunction* DynamicStarOctree::decayFunction       = starAbsoluteMagnitudeDecayFunction;

And let me know which error messages appear:

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #9by BlindedByTheLight » 13.10.2005, 05:23

Thanks Toti...

I applied the patch to the staroctree.cpp file. And got half of the same error as before. In other words, before the patch... I got the "too few template parameter" error in both the:

1) staroctree.cpp file

AND

2) dsooctree.cpp file.

With your tweak, I only got the "too few template parameter" on the dsooctree.cpp file. I took a leap of faith, however, and thought maybe you had left out instructions to apply the tweak to BOTH files (especially since the problematic code seemed to be very similiar between the two) and applied the tweak to the dsooctree.cpp file as well.

Unbelievably, it worked! I shall post it shortly.

Thanks!
Steven Binder, Mac OS X 10.4.10

Toti
Developer
Posts: 338
Joined: 10.02.2004
With us: 20 years 9 months

Post #10by Toti » 13.10.2005, 05:45

I took a leap of faith, however, and thought maybe you had left out instructions to apply the tweak to BOTH files (especially since the problematic code seemed to be very similiar between the two) and applied the tweak to the dsooctree.cpp file as well.

Unbelievably, it worked! I shall post it shortly.

I preferred to save you work in case it failed ;)
Indeed this is very good news. There's a reported bug of GCC 4.0 supposedly requiring to instantiate all static members twice in order to fix it. This on the contrary looks like GCC is taking just another step towards the Standard.

abramson
Posts: 408
Joined: 22.07.2003
With us: 21 years 4 months
Location: Bariloche, Argentina

Compilation under Windows

Post #11by abramson » 14.10.2005, 12:31

Folks,

I have compiled version FT 1.1 under Windows XP SP2, using Microsoft free tools (Visual C++ and Platform SDK for Windows Server 2003) without errors and with success (running makerelease.bat).

For the benefit of someone who may experience the same, I add that I had to slightly modify celestia.rc (celestia-1.4.0pre-FT1.1\src\celestia\res\celestia.rc), adding the line

Code: Select all

#include "commctrl.h"
at the beginning of the file. Commctrl.h contains definitions for common keywords like DTS_RIGHTALIGN, and somewhow it wasn't included unless explicitely written in celestia.rc.

Other than this, I am slightly concerned by a great number of warnings about type conversions that I received during compilation. I ignore if they may affect the accuracy, or even be responsible for some serious error. If someone is interested, I may try to capture the output and post the warnings (at this moment, I don't know how to force the compilation a second time, since now celestia is "up to date"; should I just delete everything and start over? I can't believe that.).

Regards,

Guillermo

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 8 months
Location: Hamburg, Germany

Re: Compilation under Windows

Post #12by t00fri » 14.10.2005, 12:46

abramson wrote:Folks,

I have compiled version FT 1.1 under Windows XP SP2, using Microsoft free tools (Visual C++ and Platform SDK for Windows Server 2003) without errors and with success (running makerelease.bat).

For the benefit of someone who may experience the same, I add that I had to slightly modify celestia.rc (celestia-1.4.0pre-FT1.1\src\celestia\res\celestia.rc), adding the line

Code: Select all

#include "commctrl.h"
at the beginning of the file. Commctrl.h contains definitions for common keywords like DTS_RIGHTALIGN, and somewhow it wasn't included unless explicitely written in celestia.rc.

Other than this, I am slightly concerned by a great number of warnings about type conversions that I received during compilation. I ignore if they may affect the accuracy, or even be responsible for some serious error. If someone is interested, I may try to capture the output and post the warnings (at this moment, I don't know how to force the compilation a second time, since now celestia is "up to date"; should I just delete everything and start over? I can't believe that.).

Regards,

Guillermo


The type conversion warnings are with Celestia since years and most probably hamless. Toti and I did (essentially) not generate new ones as much as I remember. Among Celestia's developer team we had repeatedly planned to do some cleanup work, but never came around actually doing it.

Under batch compilation with the commercial MS compiler no changes were necessary in celestia.rc whatsoever.

Bye Fridger

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

re

Post #13by John Van Vliet » 15.10.2005, 07:21

all i have done is take a quick look at this thred but i have been thinking --- yes a bad thing
but in the gcc4 change log there is a mention fo neading to put the templets in the .h insted of the .cpp file
I havent tried this yet -- i have been on xp all night , so i dont know if it will work

also BlindedByTheLight would like me to post the output of make

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #14by BlindedByTheLight » 15.10.2005, 20:14

did I request the output of make? i don't even know what that is... :)
Steven Binder, Mac OS X 10.4.10

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

re

Post #15by John Van Vliet » 18.10.2005, 06:16

i guess i should have read this thred more closely, i found the same fix on my own .
Would have saved time :oops:


Return to “Celestia Users”