Compiler question...

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
SiriusCG
Posts: 33
Joined: 10.03.2008
Age: 63
With us: 12 years 6 months
Location: The Smoke Ring

Compiler question...

Post #1by SiriusCG » 11.03.2008, 01:21

Greets to all, first post and all that...

Would it be prudent to just start out with VC++ 2008 Express at this point? I've been developing C/C++ applications for non-Windows platforms for about 20 years using Intel and gcc-based tools among others. I'm semi-retired and I enjoy both Stellarium and Celestia at home so I was hoping to contribute something back to the community. I've done a fair bit of OpenGL programming, mostly as a hobbist as well.

Practically all my work has been on UN*X or LINUX type systems so this would be my first MS-based efforts. I understand the MS compiler product has a bit of a learning curve so I'd like to get off on the right foot.

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

Post #2by chris » 11.03.2008, 01:44

Yes, I would very much recommend using VC++ 2008 Express. After making a couple minor changes to the source code about a month ago, Celestia builds fine with this compiler, and it's what I've been using exclusively on Windows.

Help with Celestia development would be most welcome. Post here if you need some suggestions, or general help finding your way around the code.

--Chris

Topic author
SiriusCG
Posts: 33
Joined: 10.03.2008
Age: 63
With us: 12 years 6 months
Location: The Smoke Ring

Post #3by SiriusCG » 11.03.2008, 01:55

Thanks for your reply Chris. I'm currently downloading the 895Meg ISO of VS2008E and I've also downloaded the latest Celestia trunk via SVN so I should be good to "poke around a bit". :wink:

I'm looking forward to contributing to the Celestia Community!

Topic author
SiriusCG
Posts: 33
Joined: 10.03.2008
Age: 63
With us: 12 years 6 months
Location: The Smoke Ring

Post #4by SiriusCG » 11.03.2008, 15:38

Another question please. I have the following installed:

Visual Studio 2008 Express
Microsoft SDK 2008
MS XP 32bit Debugging tools
MS XP 32bit Symbols

(The debugging tools and symbols may be overkill but it gives me the opportunity to become familiar with them.)

The SVN truck of Celestia (1.5.?) and the last gzipped Celestia version (1.5.0)

So my question then is: according to the Celestia wiki I also need the following?

* cspice.lib
* winbuild-2.zip
* winlibs-2.zip

Is this correct? Thanks!

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

Post #5by chris » 11.03.2008, 19:44

SiriusCG wrote:Another question please. I have the following installed:

Visual Studio 2008 Express
Microsoft SDK 2008
MS XP 32bit Debugging tools
MS XP 32bit Symbols

(The debugging tools and symbols may be overkill but it gives me the opportunity to become familiar with them.)

The SVN truck of Celestia (1.5.?) and the last gzipped Celestia version (1.5.0)

So my question then is: according to the Celestia wiki I also need the following?

* cspice.lib
* winbuild-2.zip
* winlibs-2.zip

Is this correct? Thanks!


Yes, that's what you need, though cspice.lib isn't strictly necessary. You can get them all from http://www.celestiaproject.net/~claurel/celestia/winbuild/

--Chris

Brendan
Posts: 296
Joined: 15.07.2003
With us: 17 years 2 months
Location: Bellows Falls, VT
Contact:

Post #6by Brendan » 12.03.2008, 03:00

How do I get the Microsoft SDK 2008 installed if the download page for that says it doesn't support VC++ 2008 Express?

I tried building the SVN code and it failed due to no afxres.h, a MFC header, being found. I tried various suggestions I found in Google, like changing the two includes of that in the resource file to winresrc.h or windows.h, and cleaning/building again, but I got an error about IDC_STATIC not being defined. I also tried adding the include and library paths for the SDK that came with VC++ 2008 Express, which apparently doesn't include MFC.

How to remove the dependency on MFC?

I have installed the Windows libraries, headers from Chris' site and copied the DLLs for those libraries from the precompiled install.

:?:
Specs: 3500 AMD 64, 1GB RAM, PCI Express GeForce 7600 GS with 256MB, Debian Lenny on 250 GB drive, Windows XP Media Center on 250 GB drive

Topic author
SiriusCG
Posts: 33
Joined: 10.03.2008
Age: 63
With us: 12 years 6 months
Location: The Smoke Ring

Post #7by SiriusCG » 12.03.2008, 05:49

For the time being, I got around the afxres.h issue by installing the last PSDK and adding J:\PSDK\Include\mfc to Configuration Properties -> Resources -> General -> Additional Include Directories in the celestic.rc file.

I know it's probably not a longterm fix but I'm learning my way around the MS way of doing things and it worked...

Now I have 29 unresolved external symbol errors so I'm missing a lib or a linker reference. See what I can figure out...

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

Post #8by chris » 12.03.2008, 05:54

SiriusCG wrote:For the time being, I got around the afxres.h issue by installing the last PSDK and adding J:\PSDK\Include\mfc to Configuration Properties -> Resources -> General -> Additional Include Directories in the celestic.rc file.

I know it's probably not a longterm fix but I'm learning my way around the MS way of doing things and it worked...

Now I have 29 unresolved external symbol errors so I'm missing a lib or a linker reference. See what I can figure out...


I think the build file needs to be updated with the source files axisarrow.cpp and precession.cpp. The version that's actually checked in only works with VS2003. I need to figure out a makefile that works with both, but I no longer have VS2003 for testing.

--Chris

Topic author
SiriusCG
Posts: 33
Joined: 10.03.2008
Age: 63
With us: 12 years 6 months
Location: The Smoke Ring

Post #9by SiriusCG » 12.03.2008, 06:11

Chris, my 29 linker errors all point to either Timeline, FrameTree or TimelinePhase errors. Can you point me in a general direction? I've got all the appropriate linker dirs configured as far as I know... thx.

I need to figure out a makefile that works with both, but I no longer have VS2003 for testing.

:lol: yeah, been there and done that a couple times over the years...

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

Post #10by chris » 12.03.2008, 06:18

SiriusCG wrote:Chris, my 29 linker errors all point to either Timeline, FrameTree or TimelinePhase errors. Can you point me in a general direction? I've got all the appropriate linker dirs configured as far as I know... thx.

I need to figure out a makefile that works with both, but I no longer have VS2003 for testing.
:lol: yeah, been there and done that a couple times over the years...


You also need:

frametree.cpp
timeline.cpp
timelinephase.cpp

--Chris

Topic author
SiriusCG
Posts: 33
Joined: 10.03.2008
Age: 63
With us: 12 years 6 months
Location: The Smoke Ring

Post #11by SiriusCG » 12.03.2008, 06:52

chris wrote:
SiriusCG wrote:Chris, my 29 linker errors all point to either Timeline, FrameTree or TimelinePhase errors. Can you point me in a general direction? I've got all the appropriate linker dirs configured as far as I know... thx.

I need to figure out a makefile that works with both, but I no longer have VS2003 for testing.
:lol: yeah, been there and done that a couple times over the years...

You also need:

frametree.cpp
timeline.cpp
timelinephase.cpp

--Chris


Ok, it looks like those three files, which are present in the SVN, are not in the config (vcproj?) file. Adding the missing .h and .cpp files manually brought the number of errors to 1:

Code: Select all

parseobject.obj : error LNK2019: unresolved external symbol "class RotationModel * __cdecl GetCustomRotationModel(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?GetCustomRotationModel@@YAPAVRotationModel@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "class RotationModel * __cdecl CreateRotationModel(class AssociativeArray *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,double)" (?CreateRotationModel@@YAPAVRotationModel@@PAVAssociativeArray@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@N@Z)


Thx Chris for your help and patience.

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

Post #12by chris » 12.03.2008, 07:27

The last file is customrotation.cpp . . . Sorry about this :oops:

--Chris

Topic author
SiriusCG
Posts: 33
Joined: 10.03.2008
Age: 63
With us: 12 years 6 months
Location: The Smoke Ring

Post #13by SiriusCG » 12.03.2008, 07:32

No worries Chris. I'm sorry to bug you as I'm sure you've got other stuff going on... My unfamiliarity with the VS interface and the source is slowing me down a bit... <standard programmer excuse>

I had just found the last missing file but you beat me to the post. :wink:

cartrite
Posts: 1791
Joined: 15.09.2005
With us: 15 years
Location: Pocono Mountains, Pennsylvania, USA

Post #14by cartrite » 12.03.2008, 11:04

Brendan wrote:How do I get the Microsoft SDK 2008 installed if the download page for that says it doesn't support VC++ 2008 Express?

I tried building the SVN code and it failed due to no afxres.h, a MFC header, being found. I tried various suggestions I found in Google, like changing the two includes of that in the resource file to winresrc.h or windows.h, and cleaning/building again, but I got an error about IDC_STATIC not being defined. I also tried adding the include and library paths for the SDK that came with VC++ 2008 Express, which apparently doesn't include MFC.

I used the Windows?® Server 2003 SP1 Platform SDK Web Install. It was found here. There is a newer version on the Wiki page and that may also work. When you open vs2008 and set the environment variables, you need to point to the sdk folder that you installed in addition to VC++2008Express. For VC++2005 Express there was some instructions I found that said you must alter the environment settings to list the SDK folders first. Also by default they point to the sdk that comes with VC++2008 EXpress. See here. http://www.celestiaproject.net/forum/viewtopic ... 8552#98552
This also works for setting up VC++2008 Express.
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap 15.1 and soon to be 15.2

Topic author
SiriusCG
Posts: 33
Joined: 10.03.2008
Age: 63
With us: 12 years 6 months
Location: The Smoke Ring

Success!

Post #15by SiriusCG » 12.03.2008, 15:32

Well, at least with the 1.5.0 source tree...

I'm still seeing 2 linker errors in customrotation.obj related to astro::EclipticPole and astro::PrecessionAngles. Working on it.

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

Re: Success!

Post #16by chris » 12.03.2008, 15:41

SiriusCG wrote:Well, at least with the 1.5.0 source tree...

I'm still seeing 2 linker errors in customrotation.obj related to astro::EclipticPole and astro::PrecessionAngles. Working on it.


Sounds like precession.cpp is still missing . . .

--Chris

Topic author
SiriusCG
Posts: 33
Joined: 10.03.2008
Age: 63
With us: 12 years 6 months
Location: The Smoke Ring

Post #17by SiriusCG » 12.03.2008, 15:46

:lol: Do you sleep Chris?

And you beat me to the post again... just found the missing file. Thx!

[EDIT] And, SVN compiled successfully with 0 errors and 0 warnings! Cool. Now I'll get down to some serious "poking about"... :wink:

Brendan
Posts: 296
Joined: 15.07.2003
With us: 17 years 2 months
Location: Bellows Falls, VT
Contact:

Post #18by Brendan » 13.03.2008, 00:51

cartrite wrote:
Brendan wrote:How do I get the Microsoft SDK 2008 installed if the download page for that says it doesn't support VC++ 2008 Express?

I tried building the SVN code and it failed due to no afxres.h, a MFC header, being found. I tried various suggestions I found in Google, like changing the two includes of that in the resource file to winresrc.h or windows.h, and cleaning/building again, but I got an error about IDC_STATIC not being defined. I also tried adding the include and library paths for the SDK that came with VC++ 2008 Express, which apparently doesn't include MFC.
I used the Windows?® Server 2003 SP1 Platform SDK Web Install. It was found here. There is a newer version on the Wiki page and that may also work. When you open vs2008 and set the environment variables, you need to point to the sdk folder that you installed in addition to VC++2008Express. For VC++2005 Express there was some instructions I found that said you must alter the environment settings to list the SDK folders first. Also by default they point to the sdk that comes with VC++2008 EXpress. See here. http://www.celestiaproject.net/forum/viewtopic ... 8552#98552
This also works for setting up VC++2008 Express.
cartrite


Thanks! I installed the 2005 SDK and followed your instructions in the other post plus changed adxres.h to Windows.h because I didn't find the first one. There wasn't a mfc subdirectory. When I tried building, I got a few nonfatal warnings that mentioned the 2005 SDK, so that should be installed properly, but it still failed on IDC_STATIC.
Specs: 3500 AMD 64, 1GB RAM, PCI Express GeForce 7600 GS with 256MB, Debian Lenny on 250 GB drive, Windows XP Media Center on 250 GB drive

cartrite
Posts: 1791
Joined: 15.09.2005
With us: 15 years
Location: Pocono Mountains, Pennsylvania, USA

Post #19by cartrite » 13.03.2008, 12:23

Brendan wrote:Thanks! I installed the 2005 SDK and followed your instructions in the other post plus changed adxres.h to Windows.h because I didn't find the first one. There wasn't a mfc subdirectory.

I'm not sure which SDK you installed but I have the one found here and it works fine. The file AFXRES.h is found in C:\Program Files\Microsoft SDK\Include\mfc. I had to add the path to this directory in my environment variables. I didn't rename any file to windows.h. The windows.h file is in the folder C:\Program Files\Microsoft SDK\Include. This folder was also added to my "include" path environment variable.
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap 15.1 and soon to be 15.2

Brendan
Posts: 296
Joined: 15.07.2003
With us: 17 years 2 months
Location: Bellows Falls, VT
Contact:

Post #20by Brendan » 13.03.2008, 23:26

cartrite wrote:
Brendan wrote:Thanks! I installed the 2005 SDK and followed your instructions in the other post plus changed adxres.h to Windows.h because I didn't find the first one. There wasn't a mfc subdirectory.
I'm not sure which SDK you installed but I have the one found here and it works fine. The file AFXRES.h is found in C:\Program Files\Microsoft SDK\Include\mfc. I had to add the path to this directory in my environment variables. I didn't rename any file to windows.h. The windows.h file is in the folder C:\Program Files\Microsoft SDK\Include. This folder was also added to my "include" path environment variable.
cartrite


I removed the SDK and tried the link you gave. Downloading it redirects me to the 2008 one, which installs version 6.1 of the SDK, which was the same one I installed before so I guess I didn't notice being redirected the first time. There is no MFC subdirectory. 8O
Specs: 3500 AMD 64, 1GB RAM, PCI Express GeForce 7600 GS with 256MB, Debian Lenny on 250 GB drive, Windows XP Media Center on 250 GB drive


Return to “Development”

Who is online