title: Compiling error (g++ and make)
body: <p>I have attempted to convert a working C++ library that was compiled in the Visual Studio 2010 IDE to a generic project compilable in any standard compiler. I have apparently been successful in that objective since I have been able to compile with an Eclipse C++ IDE under Ubuntu 12.10.</p>
  
  <p>I have since tried to compile the same using g++ and a Makefile in the terminal. Unfortunately I have not met with the same success. I seem to be rather close to good compilation though as I have only received these errors:</p>
  
  <pre><code>./liborbit.a(cOrbit.o): In function `Zeptomoby::OrbitTools::cEci::ScalePosVector(double)':
  /home/tufts/Programs/workspace/orbitTools/Demo/../core/cEci.h:35: undefined reference to `Zeptomoby::OrbitTools::cVector::Mul(double)'
  ./liborbit.a(cOrbit.o): In function `Zeptomoby::OrbitTools::cEci::ScaleVelVector(double)':
  /home/tufts/Programs/workspace/orbitTools/Demo/../core/cEci.h:36: undefined reference to `Zeptomoby::OrbitTools::cVector::Mul(double)'
  ./liborbit.a(cNoradBase.o): In function `Zeptomoby::OrbitTools::cNoradBase::FinalPosition(double, double, double, double, double, double, double, double)':
  /home/tufts/Programs/workspace/orbitTools/Demo/../orbit/cNoradBase.cpp:265: undefined reference to `Zeptomoby::OrbitTools::cVector::Magnitude() const'
  /home/tufts/Programs/workspace/orbitTools/Demo/../orbit/cNoradBase.cpp:285: undefined reference to `Zeptomoby::OrbitTools::cEciTime::cEciTime(Zeptomoby::OrbitTools::cVector const&amp;, Zeptomoby::OrbitTools::cVector const&amp;, Zeptomoby::OrbitTools::cJulian)'
  collect2: ld returned 1 exit status
  make: *** [compile] Error 1
  </code></pre>
  
  <p>It appears that the <code>orbit</code> library functions use the <code>core</code> library functions themselves.</p>
  
  <h1>File system organization:</h1>
  
  
  
  <pre><code>orbitTools/
  ├── core
  │   ├── cEci.cpp
  │   ├── cEci.h
  │   ├── cJulian.cpp
  │   ├── cJulian.h
  │   ├── coord.cpp
  │   ├── coord.h
  │   ├── coreLib.h
  │   ├── cSite.cpp
  │   ├── cSite.h
  │   ├── cTle.cpp
  │   ├── cTle.h
  │   ├── cVector.cpp
  │   ├── cVector.h
  │   ├── exceptions.h
  │   ├── globals.cpp
  │   ├── globals.h
  │   ├── stdafx.cpp
  │   └── stdafx.h
  ├── Demo
  │   ├── main.cpp
  │   └── Makefile
  └── orbit
      ├── cNoradBase.cpp
      ├── cNoradBase.h
      ├── cNoradSDP4.cpp
      ├── cNoradSDP4.h
      ├── cNoradSGP4.cpp
      ├── cNoradSGP4.h
      ├── cOrbit.cpp
      ├── cOrbit.h
      ├── stdafx.cpp
      └── stdafx.h
  </code></pre>
  
  <p>Note the localization of the <code>Makefile</code>.<br></p>
  
  <h1>The Makefile itself is:</h1>
  
  <pre>
  
      # COMPILER
      CC = g++
  
      # INCLUDE FILES DIRECTORY
      MAIND = $(PWD)/..
      COMPILE = $(MAIND)/compile
      CORE = $(MAIND)/core
      ORBIT = $(MAIND)/orbit
      INCLUDE = -I$(MAIND) -I$(CORE) -I$(ORBIT) -I.
  
      # OPTIONS FOR DEVELOPMENT
      CFLAGS = -g -ansi
  
      compile: main.o libs
          $(CC) $(INCLUDE) $(CFLAGS) main.o -L. -lcore -lorbit -lm -o demo
  
      main.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c main.cpp
  
      # CORE LIBRARY
      cEci.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(CORE)/cEci.cpp
  
      cJulian.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(CORE)/cJulian.cpp
  
      coord.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(CORE)/coord.cpp
  
      cSite.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(CORE)/cSite.cpp
  
      cTle.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(CORE)/cTle.cpp
  
      cVector.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(CORE)/cVector.cpp
  
      globals.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(CORE)/globals.cpp
  
      stdafx.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(CORE)/stdafx.cpp
  
      core: cEci.o cJulian.o coord.o cSite.o cTle.o cVector.o globals.o stdafx.o
          ar rcs libcore.a cEci.o cJulian.o coord.o cSite.o cTle.o cVector.o globals.o stdafx.o
  
      # ORBIT LIBRARY
      cNoradBase.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(ORBIT)/cNoradBase.cpp -lcore
  
      cNoradSDP4.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(ORBIT)/cNoradSDP4.cpp -lcore
  
      cNoradSGP4.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(ORBIT)/cNoradSGP4.cpp -lcore
  
      cOrbit.o:
          $(CC) $(INCLUDE) $(CFLAGS) -c $(ORBIT)/cOrbit.cpp -lcore
  
      orbit: cNoradBase.o cNoradSDP4.o cNoradSGP4.o cOrbit.o stdafx.o
          ar rcs liborbit.a cNoradBase.o cNoradSDP4.o cNoradSGP4.o cOrbit.o stdafx.o
  
      libs: core orbit
  
      clean:
          rm *.o
  
      purge:
          rm *.a
  </pre>