A Primer for C++ Developers on Windows Vista and VS2005

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
DT
Posts: 49
Joined: 27.08.2007
With us: 17 years 2 months
Location: In Orbit...

A Primer for C++ Developers on Windows Vista and VS2005

Post #1by DT » 27.08.2007, 15:15

Check out the sticky for WinXP development and download all the necessary libs. Then download Windows Vista Platform SDK at the Microsoft website:

http://www.microsoft.com/downloads/details.aspx?familyid=c2b1e300-f358-4523-b479-f53d234cdccf&displaylang=en


Grab a copy of the source from CVS, open the VS project and the the following amendments to update the project:


1. Removed octree.cpp //This is an empty file
2. Excluded libc.lib from Project Celestia //Not used anymore
3. Delete the following line from celestia.rc: //VS2005 creates its own manifest - duplicate errors otherwise

1 RT_MANIFEST "celestia.exe.manifest"

4. Included intl.lib to Project Celestia //Resolves 37 linker errors
5. Added existing items starcolors.h & starcolors.cpp to Project celengine //Resolves 2 linker errors

6. Adding 3dsmesh.h & 3dsmesh.cpp to Project celengine but it gives a number of errors: //Files were excluded as a result

`Normals' undeclared
`Colors' undeclared
`Multipass' undeclared
`VertexProgParams' undeclared

7. Added existing item CGBuffer.h to Project celengine //Had no effect on number of linker errors
8. Added existing items dsodb.cpp, dsoname.cpp & dsooctree.cpp and their headers to Project celengine //Resolves 18 linker errors
9. Added existing item glshader.cpp and glshader.h to Project celengine //Resolves 1 linker error
10. Added existing item lightenv.h to celengine //Had no effect on number of linker errors
11. Added existing item staroctree.cpp and staroctree.h to Project celengine //Resolves 7 linker errors
12. Added existing item starbrowser.cpp and starbrowser.h to Project celengine //Had no effect on number of linker errors
13. Added existing item spiceorbit.cpp & spiceinterface.cpp and their headers to Project celengine (Note: Added spice libs as well) //Had no effect on number of linker errors
14. Added existing item solarsys.cpp and header to Project celengine. //Had no effect on number of linker errors
15. Added existing item solarsysxml.cpp and header to Project celengine //File was excluded - Generated 22 coding errors
16. Added cspice.lib to Project celestia //Had no effect on number of linker errors
17. Added the following existing files & associated headers where applicable to Project celengine: //Revolves 17 linker errors

shadermanager.cpp
scriptrotation.cpp
scriptorbit.cpp
scriptobject.cpp
samporient.cpp
rotationmanager.cpp
rotation.cpp
renderglsl.cpp

renderinfo.h

18. Added existing items name.h and parseobject.cpp/parseobject.h to celengine //Resolve 7 linker errors


At this stage you are left with errors within the Project Celestia Only. To correct these add all files, except the following:

celx.h & celx.cpp //Coding errors
glutmain.cpp //coding errors
oggtheoracapture.cpp & oggtheoracapture.h //Coding errors.


This will now build, just make sure you disable the usage of pre-compiled headers and that you use the multi-threaded runtime (/MT).


Additonal notes:

You can create a new Win32 project for celscript and add all the files. Just remember to add the lib to the Project celestia.



UPDATE: 28th Aug 2007

Add celx.h and celx.cpp to the Project celestia...

Obtain the latest libs:

http://www.shatters.net/~claurel/celestia/winbuild/

...add the following libs to the celestia Project:

lua5.1.lib, lualib.lib, lua.lib

Define CELX and increase the LUA_VER to 0x050100 (celx.h)

Now you can enjoy full script support and the Lau Edu Tools.


UPDATE: 29th Aug 2007

Do NOT add ijgjpeg.lib to the linker. This will result in all the planets, except Earth, having no textures.

Thanks to Cartrite on that one. 8)



UPDATE: 30th Aug 2007

For those looking to add sound support here are the instructions:

1. Download the following file:
http://vincent.gian.club.fr/celestia/ce ... patch3.zip

2. Copy alut.dll and OpenAL32.dll to the Celestia base folder.
3. Copy the folder 'Sounds' to the Celestia base folder.
4. Copy the Alut.lib and OpenAL32.lib to the libs folder you use for development.
5. Copy the headers from \inc\Al to the headers folder you use for development.
6. Three files need to be updated:

celx.cpp
celestiacore.h
celestiacore.cpp

Search for the term 'Victor' and copy the routines to your working copy.
7. Add the libs to the linker
8. Compile

Copy the file sound_test3.celx to your scripts folder.

Run Celestia and load the script. You should now have sound support.
Last edited by DT on 29.08.2007, 15:47, edited 6 times in total.
A whack in the face with a fish can solve a whole manner of problems.

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #2by Fightspit » 27.08.2007, 16:47

deleted
Last edited by Fightspit on 27.08.2007, 17:12, edited 1 time in total.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Topic author
DT
Posts: 49
Joined: 27.08.2007
With us: 17 years 2 months
Location: In Orbit...

Post #3by DT » 27.08.2007, 17:07

Hi DT,
Thanks for this tip and you can add this link to download Windows Vista Platform SDK in your first post (to avoid for user to search it ):
http://www.microsoft.com/downloads/deta ... laylang=en


No problem Fightspit, I saw that it was causing a lot of headaches.

Thanks for the link, I added it to the post.
A whack in the face with a fish can solve a whole manner of problems.

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #4by Fightspit » 28.08.2007, 12:47

Hi,

I dont understand this point:
6. Adding 3dsmesh.h & 3dsmesh.cpp to Project celengine but it gives a number of errors: //Files were excluded as a result

`Normals' undeclared
`Colors' undeclared
`Multipass' undeclared
`VertexProgParams' undeclared


Do you remove the two files from the project or do you define (declare) Normals, Colors and etc. and how ?

Thanks for the tip.
PS: You can clarify your tip if you say in the same line what files we should add in a Project folder (not several lines for Project celengine in your case :wink:).
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Topic author
DT
Posts: 49
Joined: 27.08.2007
With us: 17 years 2 months
Location: In Orbit...

Post #5by DT » 28.08.2007, 13:30

Do you remove the two files from the project or do you define (declare) Normals, Colors and etc. and how ?

I excluded them from the build.


PS: You can clarify your tip if you say in the same line what files we should add in a Project folder (not several lines for Project celengine in your case ).


It didn't start out as a set of tips. I was recording the changes I was making to the projects and I thought I would share the file.
A whack in the face with a fish can solve a whole manner of problems.

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #6by Fightspit » 28.08.2007, 13:43

Thx,

But I have got again only one error:

Code: Select all

.\res\celestia.rc(17) : fatal error RC1015: cannot open include file 'afxres.h'.


Have you got it, have you resolve it ?

And thx again for the help :wink:.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Topic author
DT
Posts: 49
Joined: 27.08.2007
With us: 17 years 2 months
Location: In Orbit...

Post #7by DT » 28.08.2007, 14:04

Have you got it, have you resolve it ?


The file is used for MFC applications. I checked my celestia.rc and it is there. It has not caused me any problems.

Here are a couple of solutions to try:

1. Check if the file exists on your system and that the folder is referenced properly.
2. Replace afxres.h with winres.h.
3. If all else fails, try to comment out the line in celestia.rc (#include "afxres.h")


Note: In the celestia.rc there are two instances of "afxres.h". Both must match, so whatever you do with one, do the same to the other. Also, use notepad to edit the file, the IDE will bring up the resource editor. Make sure you do a 'clean' and 'rebuild'.
A whack in the face with a fish can solve a whole manner of problems.

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #8by Fightspit » 28.08.2007, 14:57

Thx, I fix it but a new error occurs... :?

Code: Select all

Projet : error PRJ0002 : Result error -1073741819 returned from 'C:\Program Files\Microsoft Visual Studio 8\VC\bin\rc.exe'.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Topic author
DT
Posts: 49
Joined: 27.08.2007
With us: 17 years 2 months
Location: In Orbit...

Post #9by DT » 28.08.2007, 15:09

You didn't fix the error in the celestia.rc file. You just created a new one.

What did you do?

Try to replace it with an original copy and rebuild.
A whack in the face with a fish can solve a whole manner of problems.


Return to “Development”