Trouble with first compile

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Epimetheus
Posts: 42
Joined: 30.03.2008
With us: 16 years 10 months

Trouble with first compile

Post #1by Epimetheus » 01.04.2008, 20:22

I'm having trouble getting Celestia to compile in my environment. I've been following the instructions in this forum but noticed some of the posts are several years old and I'm stuck.

I'm using VS 2005 w/ .Net Framework 2.0 SP1 for development. I just installed the latest MS Platform SDK, but noticed that the directory structure is different from the environment var path examples I've seen here in this forum. I believe I've set all the INCLUDE, PATH and LIB vars. Do I need to install earlier versions of the Platform SDK and the 2003 Visual C++ Toolkit?!? I was getting a cannot find "LIBC.lib" file which doesn't even need to be linked to the app, but I added /NODEFAULTLIB compiler option to celestia.mak. Now, the compiler seems to be whining about some unresolved symbols regarding Lua. I included the error output from NMAKE.

Appreciate any help! :?

Code: Select all

   cd celutil
   nmake /NOLOGO util.mak MFLAGS=-MD CFG=Release
'.\Release\cel_utils.lib' is up-to-date
   cd ..
   cd celmath
   nmake /NOLOGO math.mak MFLAGS=-MD CFG=Release
'.\Release\cel_math.lib' is up-to-date
   cd ..
   cd cel3ds
   nmake /NOLOGO 3ds.mak MFLAGS=-MD CFG=Release
'.\Release\cel_3ds.lib' is up-to-date
   cd ..
   cd celtxf
   nmake /NOLOGO txf.mak MFLAGS=-MD CFG=Release
'.\Release\cel_txf.lib' is up-to-date
   cd ..
   cd celengine
   nmake /NOLOGO engine.mak MFLAGS=-MD CFG=Release SPICE= CELX=enable LUA_VER=0x050100
'.\Release\cel_engine.lib' is up-to-date
   cd ..
   cd celestia
   nmake /NOLOGO celestia.mak MFLAGS=-MD CFG=Release SPICE= CELX=enable LUA_VER=0x050100
   link.exe @C:\DOCUME~1\THOR~1\LOCALS~1\Temp\nmD9.tmp
celx.obj : error LNK2019: unresolved external symbol _lua_newtable referenced in function "void __cdecl CreateClassMetatable(struct lua_State *,int)" (?CreateClassMetatable@@YAXPAUlua_State@@H@Z)
cel_engine.lib(scriptorbit.obj) : error LNK2001: unresolved external symbol _lua_newtable
cel_engine.lib(scriptrotation.obj) : error LNK2001: unresolved external symbol _lua_newtable
celx.obj : error LNK2019: unresolved external symbol _lua_open referenced in function "public: __thiscall LuaState::LuaState(void)" (??0LuaState@@QAE@XZ)
celx.obj : error LNK2019: unresolved external symbol _lua_tostring referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall LuaState::getErrorMessage(void)" (?getErrorMessage@LuaState@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
cel_engine.lib(scriptorbit.obj) : error LNK2001: unresolved external symbol _lua_tostring
cel_engine.lib(scriptrotation.obj) : error LNK2001: unresolved external symbol _lua_tostring
.\Release\celestia.exe : fatal error LNK1120: 3 unresolved externals

Computer Info:

MoBo: GigaByte 6-Quad GA-965P DQ6
CPU: Intel Core 2 6700 @ 2.66GHz
RAM: Ocz 2GB DDR2 800MHz
HDD: Seagate 400GB SATA
VD: Nvidia GeForce 7950 GT OC 512MB
OS: MS XP Pro SP2
Celestia 1.5.1.4342 Qt4 Experimental

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 4 months
Location: NY, USA

Re: Trouble with first compile

Post #2by selden » 01.04.2008, 21:45

Please take a look at the Celestia WikiBook at http://en.wikibooks.org/wiki/Celestia/D ... 2_platform

Does that help?
Selden

Topic author
Epimetheus
Posts: 42
Joined: 30.03.2008
With us: 16 years 10 months

Re: Trouble with first compile

Post #3by Epimetheus » 02.04.2008, 01:29

selden wrote:Please take a look at the Celestia WikiBook at http://en.wikibooks.org/wiki/Celestia/D ... 2_platform
Does that help?

Thanks for the reply. That page has been a big help. Unfortunately, I've got some kind of unresolved link issue with Lua objects. I'm stumped right now. Run makerelease and once it hits celestia.mak, things break down. I just downloaded this stuff a couple nights ago, so I'm sure I'm missing something. :?
Computer Info:

MoBo: GigaByte 6-Quad GA-965P DQ6
CPU: Intel Core 2 6700 @ 2.66GHz
RAM: Ocz 2GB DDR2 800MHz
HDD: Seagate 400GB SATA
VD: Nvidia GeForce 7950 GT OC 512MB
OS: MS XP Pro SP2
Celestia 1.5.1.4342 Qt4 Experimental

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

Re: Trouble with first compile

Post #4by chris » 02.04.2008, 02:28

Have you tried using the Visual Studio project file to build Celestia?

--Chris

Topic author
Epimetheus
Posts: 42
Joined: 30.03.2008
With us: 16 years 10 months

Re: Trouble with first compile

Post #5by Epimetheus » 02.04.2008, 07:13

chris wrote:Have you tried using the Visual Studio project file to build Celestia?

--Chris

Hey Chris,
Yes I have, and I had similar problems. I know I'm not including some lib or dll because I keep getting unresolved external link errors. I'm farther than I was. BTW, what is the proper location for Dlls? I've seen a few floating around in the distribution. Is the extern keyword being used a lot in this app?

Latest BrainFreeze :twisted:

Code: Select all

Compiling...
winstarbrowser.cpp
wintime.cpp
wintourguide.cpp
winviewoptsdlg.cpp
celx.cpp
Generating Code...
   link.exe @C:\DOCUME~1\THOR~1\LOCALS~1\Temp\nm362.tmp
celestiacore.obj : error LNK2019: unresolved external symbol "public: __thiscall PlanetographicGrid::PlanetographicGrid(class Body const &)" (??0PlanetographicGrid@@QAE@ABVBody@@@Z) referenced in function "public: void __thiscall CelestiaCore::toggleReferenceMark(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class Selection)" (?toggleReferenceMark@CelestiaCore@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VSelection@@@Z)
cspice.lib(lread.obj) : error LNK2001: unresolved external symbol _errno
...
Computer Info:

MoBo: GigaByte 6-Quad GA-965P DQ6
CPU: Intel Core 2 6700 @ 2.66GHz
RAM: Ocz 2GB DDR2 800MHz
HDD: Seagate 400GB SATA
VD: Nvidia GeForce 7950 GT OC 512MB
OS: MS XP Pro SP2
Celestia 1.5.1.4342 Qt4 Experimental

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

Re: Trouble with first compile

Post #6by cartrite » 02.04.2008, 08:46

Did you do a svn update? It is now at r4234. It looks like you are using an older vcproj file that needs 3 new planetgrid files.
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

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

Re: Trouble with first compile

Post #7by t00fri » 02.04.2008, 09:22

Epimetheus wrote:
chris wrote:Have you tried using the Visual Studio project file to build Celestia?

--Chris

Hey Chris,
Yes I have, and I had similar problems. I know I'm not including some lib or dll because I keep getting unresolved external link errors. I'm farther than I was. BTW, what is the proper location for Dlls? I've seen a few floating around in the distribution. Is the extern keyword being used a lot in this app?

Latest BrainFreeze :twisted:

Code: Select all

Compiling...
winstarbrowser.cpp
wintime.cpp
wintourguide.cpp
winviewoptsdlg.cpp
celx.cpp
Generating Code...
   link.exe @C:\DOCUME~1\THOR~1\LOCALS~1\Temp\nm362.tmp
celestiacore.obj : error LNK2019: unresolved external symbol "public: __thiscall PlanetographicGrid::PlanetographicGrid(class Body const &)" (??0PlanetographicGrid@@QAE@ABVBody@@@Z) referenced in function "public: void __thiscall CelestiaCore::toggleReferenceMark(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class Selection)" (?toggleReferenceMark@CelestiaCore@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VSelection@@@Z)
cspice.lib(lread.obj) : error LNK2001: unresolved external symbol _errno
...

It seems you are trying to win by means of a "random" strategy, which
does not look very promising ;-)

Your findings of unresolved external references is a perfectly usual
signature for cases, where some code that defines those external
references, is lacking to the Linker. Although that code may well be in
your collection of source files and headers, the compiler does NOT see
it, if you have not added these files to your workfiles/project files.

Anyone with a little experience in compilation matters will apply a
SYSTEMATIC procedure, to get rid of these unsatisfied externals.

Assuming that you have made all external libraries known to the
compiler already, the task is to look at your errors ONE-BY-ONE and
locate these files, where the unsatisfied references are defined, in your SOURCES.

For that purpose I use a powerful UNIX tool, called 'grep' (both in Linux
and Windows) that can search your code very quickly. Take as an
example your error, referring to 'PlanetographicGrid'. Go to your top
source directory and do

grep -r PlanetographicGrid *

This prints out right away what you (and your compiler!) are looking for,
the files where this object appears and notably where it is DEFINED:

celengine/planetgrid.h
celengine/planetgrid.cpp

You now add these two files to your project. I hope you know how to do
this! If not, READ the compiler docs...

Then you turn to the next error due to an unsatisfied external:

'toggleReferenceMark',

again do a 'grep' as above and you will find

celestia/celestiacore.h
celestia/celestiacore.cpp

...and so on...

within a few minutes this is all done and you can spend your time for
more sensible things... ;-)

If a library appears also in the context of an unsatisfied external error
(cspice.lib,...), you must of course make sure that the PATH to that
library and the corresponding include files is known to your
compiler/linker as well. Again such things are NOT related to Celestia,
but general know-how associated with using your compiler. So get
yourself a drink and look up your compiler manual in leisure. ;-)

Good luck,
F.
Last edited by t00fri on 02.04.2008, 13:37, edited 2 times in total.
Image

Topic author
Epimetheus
Posts: 42
Joined: 30.03.2008
With us: 16 years 10 months

Re: Trouble with first compile

Post #8by Epimetheus » 02.04.2008, 10:10

Your points are all well-taken. I just started programming with C++ and Qt about a year ago. I haven't even touched any of the codebase yet. I'm just trying to get a successful build! Celestia is an awesome program and my hat is off to all the contributors and developers.

Good point on grep for windows, I just downloaded a utility.

Tschuss!
Computer Info:

MoBo: GigaByte 6-Quad GA-965P DQ6
CPU: Intel Core 2 6700 @ 2.66GHz
RAM: Ocz 2GB DDR2 800MHz
HDD: Seagate 400GB SATA
VD: Nvidia GeForce 7950 GT OC 512MB
OS: MS XP Pro SP2
Celestia 1.5.1.4342 Qt4 Experimental

Topic author
Epimetheus
Posts: 42
Joined: 30.03.2008
With us: 16 years 10 months

Re: Trouble with first compile

Post #9by Epimetheus » 02.04.2008, 10:12

cartrite wrote:Did you do a svn update? It is now at r4234. It looks like you are using an older vcproj file that needs 3 new planetgrid files.
cartrite

Thanks cartrite, I'll check into that!
Computer Info:

MoBo: GigaByte 6-Quad GA-965P DQ6
CPU: Intel Core 2 6700 @ 2.66GHz
RAM: Ocz 2GB DDR2 800MHz
HDD: Seagate 400GB SATA
VD: Nvidia GeForce 7950 GT OC 512MB
OS: MS XP Pro SP2
Celestia 1.5.1.4342 Qt4 Experimental


Return to “Development”