Cannot run cspice with g++

Jan 26, 2019 at 1:17pm
I wanted to run cspice via g++ on windows. It gives undefined reference errors for the functions defined through cspice. It runs properly in Linux. Can anyone suggest a method to make it work.
I run:
g++ -LK:\Data\cspice\lib -IF:\CPP\Libraries\Boost\boost_1_68_0 -o foo foo.cpp -l:cspice.a -lm
The errors I get are:
undefined reference to 'furnsh_c'
and other functions I use from 'SpiceUsr.h'.
Am I not linking the file properly or what is the error.
Jan 26, 2019 at 2:35pm
> -l:cspice.a
Try it with just -lcspice
Jan 26, 2019 at 2:40pm
Gives error cannot find -lcspice
Jan 26, 2019 at 2:48pm
So what's the actual name of the library file(s) in K:\Data\cspice\lib

Did you just download them, or did you build them yourself using your current compiler?
Jan 26, 2019 at 2:54pm
I downloaded them from naif website. (https://naif.jpl.nasa.gov/naif/toolkit_C.html). I downloaded the version for PC Linux gCC 64 bit.
The name of the library is cspice.a
Last edited on Jan 26, 2019 at 3:12pm
Jan 26, 2019 at 5:41pm
> I downloaded the version for PC Linux gCC 64 bit.
So what's with all the Windows paths on the command line?

Which version of g++ are you using? cygwin or mingw?
Jan 26, 2019 at 5:45pm
Mingw. I tried with MS Visual C 64 bit version but it did not work either

What version should I use.
Last edited on Jan 26, 2019 at 5:46pm
Jan 26, 2019 at 5:53pm
Probably start by downloading the tar file for "PC, CYGWIN, gCC, 64bit"
But you'll need to hack about the build and install scripts to use your actual compiler of choice.

Jan 26, 2019 at 5:59pm
Thanks for the help.

As for the last point can you elaborate further.
Topic archived. No new replies allowed.