Page 1 of 1
Compiler Errors on Celetsia 1.4pre-FT1.1
Posted: 13.10.2005, 00:33
by BlindedByTheLight
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#60943John'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?
Posted: 13.10.2005, 01:35
by BlindedByTheLight
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...
Posted: 13.10.2005, 02:17
by Toti
Steve,
Just an idea:
in dsooctree.h put:
just before:
Code: Select all
void DSOOctree::processVisibleObjects...
And do the same with:
Code: Select all
void DSOOctree::processCloseObjects...
Do the error messages change?
Posted: 13.10.2005, 02:28
by BlindedByTheLight
Toti wrote:Steve,
Just an idea:
in dsooctree.h put:
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...
Posted: 13.10.2005, 02:30
by BlindedByTheLight
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"? ???
Posted: 13.10.2005, 02:30
by Toti
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.
Posted: 13.10.2005, 02:33
by BlindedByTheLight
Looks like we crossed in the cyber-space... didja see my prior post?
Posted: 13.10.2005, 02:52
by Toti
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
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:
Posted: 13.10.2005, 05:23
by BlindedByTheLight
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!
Posted: 13.10.2005, 05:45
by Toti
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.
Compilation under Windows
Posted: 14.10.2005, 12:31
by abramson
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
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
Re: Compilation under Windows
Posted: 14.10.2005, 12:46
by t00fri
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
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
re
Posted: 15.10.2005, 07:21
by John Van Vliet
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
Posted: 15.10.2005, 20:14
by BlindedByTheLight
did I request the output of make? i don't even know what that is...
re
Posted: 18.10.2005, 06:16
by John Van Vliet
i guess i should have read this thred more closely, i found the same fix on my own .
Would have saved time