A primer for new C++ developer volunteers on Win XP

The place to discuss creating, porting and modifying Celestia's source code.
Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: A primer for new C++ developer volunteers on Win XP

Post #101by t00fri » 05.04.2008, 12:10

cartrite wrote:
I did have to /NODEFAULTLIB:libc. That would mean there's a deprecated dependency on libc.lib within the app at this point. The thread-safe libcmt.lib has replaced libc.lib C library in current MS IDEs and DEV environs.
I found that this was only needed when compiling from the command line with makerelease.bat and when compiling QT4 with Windows. I don't need to change anything if I compile with celestia.vcproj using the MS2005/2008 C++Express GUI without QT4 code.
cartrite

Well in vcproj files the respective entry is different:

IgnoreDefaultLibraryNames="libc"

Do you have in your .vcproj file

IgnoreDefaultLibraryNames=

F.
Image

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: A primer for new C++ developer volunteers on Win XP

Post #102by cartrite » 05.04.2008, 12:44

I use the original svn version of celestia.vcproj. I don't change that file at all. Unless I need to add some missing files or "turn on" HDR . I did a search with "find" for the string "IgnoreDefaultLibraryNames=" and it was not in the file. typo?
I think there are #IF statements in the code that looks for the version of compiler used that gets around using libc for newer versions of the compiler. Could be wrong though.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Re: A primer for new C++ developer volunteers on Win XP

Post #103by ajtribick » 11.08.2008, 15:45

How I got Celestia to compile under Microsoft Visual C++.Net 2008 Express Edition...

  1. Install the Microsoft Platform SDK from here - don't bother installing the documentation or the samples since the downloads are massive...
  2. Install MS VC++.Net 2008 Express Edition from here.
  3. Install TortoiseSVN from here and downloaded a fresh SVN copy.
  4. Download winlibs-2.zip and winlibs-3.zip from here. Extracted winlibs-2.zip then winlibs-3.zip into the celestia directory.
  5. Download cspice.lib from here and put it in celestia\libs.
  6. Copy iconv.dll, intl.dll and lua5.1.dll from the installation of Celestia 1.5.1 into the celestia directory.
  7. Open celestia.sln in Microsoft Visual C++.Net 2008 and allow the updater to work.
  8. Set the build type to Release
  9. Open the celestia.rc file (Resource files>celestia.rc) using the text editor and replace the occurrences of "afxres.h" (there should be 2) with "windows.h". Also add the line "#define IDC_STATIC -1" (without quotes, put this near the top of the file)
  10. In the Project menu, select the item Properties, and add "/NODEFAULTLIB:LIBCMT" (without quotes) to the Configuration Properties>Linker>Command Line options.
  11. In the same dialogue box, change Configuration Properties>General>Output Directory to "$(SolutionDir)" (without quotes).
  12. Build!

Still haven't got the Qt version to work yet though.
Last edited by ajtribick on 27.08.2008, 19:56, edited 2 times in total.

extremecrew
Posts: 7
Joined: 24.03.2008
With us: 16 years 7 months

Re: A primer for new C++ developer volunteers on Win XP

Post #104by extremecrew » 27.08.2008, 18:43

Thank you ajtribick! I've been messing with VStudio 2008 all morning, trying to get the darn build to work. I just wish I had found your post first before trying all of the other development posts and celestia wikis.

ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Re: A primer for new C++ developer volunteers on Win XP

Post #105by ajtribick » 27.08.2008, 19:11

Ok, thanks for the confirmation that it works... since it is useful I'll put it in the Wikibook.

extremecrew
Posts: 7
Joined: 24.03.2008
With us: 16 years 7 months

Re: A primer for new C++ developer volunteers on Win XP

Post #106by extremecrew » 27.08.2008, 19:26

EDIT: This problem was solved (a very dumb thing on my part) by changing \NODEFAULTLIB:LIBCMT to /NODEFAULTLIB:LIBCMT. The warning messages, though, still persist.

With the \NODEFAULTLIB:LIBCMT option, I get

Code: Select all

Linking...
LINK : fatal error LNK1181: cannot open input file '\NODEFAULTLIB:LIBCMT.obj'

Changing it to LIBC gives the following error:

Code: Select all

Linking...
LINK : fatal error LNK1181: cannot open input file '\NODEFAULTLIB:LIBC.obj'

In addition, I'm getting the following warnings regardless if I add the option or not:

Code: Select all

imagecapture.cpp
...\celestia development\celestia-4413\inc\libjpeg\jmorecfg.h(215) : warning C4005: 'FAR' : macro redefinition
C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\windef.h(146) : see previous definition of 'FAR'
and

Code: Select all

texture.cpp
...\celestia development\celestia-4413\inc\libjpeg\jmorecfg.h(215) : warning C4005: 'FAR' : macro redefinition
C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\windef.h(146) : see previous definition of 'FAR'

When I clean and build without the option, the following errors occur:

Code: Select all

Linking...
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _strncpy already defined in LIBCMT.lib(strncpy.obj)
...etc etc...
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
...\Celestia Development\celestia-4413\\celestia.exe : fatal error LNK1169: one or more multiply defined symbols found

ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Re: A primer for new C++ developer volunteers on Win XP

Post #107by ajtribick » 27.08.2008, 19:57

Yes, should be forward slash not backslash, thanks for pointing that out. I've updated the original post.


Return to “Development”