darkfiredragon - 2014-02-11

I'm trying to use ngspice as a static library for an iOS application. I cannot use a .dylib because of certain Apple restrictions (I actually had limited success creating an arm64 .dylib for ngspice for use on iPhone 5S, but Apple won't let you run .dylib on the actual device I believe). I have been configuring and making for arm64 architecture, assuming an iPhone 5S.

I essentially need the functionality of ngSpice_Command() that one would normally achieve via a .dylib in the process outlined in the User's Manual, but through a static library.

I'm aware that this might not be difficult, but I am only an intermediate compilers person and cross-compiling is new to me.

Jailbreaking the iPhone 5S is not an option.

At this point:
1. I have a libngspice.a that I am linking with -lngspice. I believe this static library is cross-compiled for arm64 correctly.
2. In my xCode project I added libngspice_la-sharedspice.o in hopes of achieving some of the functionality of sharedspice.h At this point, I'd just like to #include "sharedspice.h" and then test with ngSpice_Init(). I have implemented the ng_exit function with is mandatory for nSpice_Init(). Eventually, I'd like to get the test benches outlined in ngspice_cb 100% working.

When I go to build the xCode project I get some undefined symbols errors:

Undefined symbols for architecture arm64:
"_errMsg", referenced from:
_INPerror in libinp.a(inperror.o)
"_errRtn", referenced from:
_INPerror in libinp.a(inperror.o)
"_ft_rawfile", referenced from:
_ngSpice_Init in libngspice_la-sharedspice.o
_cp_usrset in libfte.a(options.o)
"_DEVmaxnum", referenced from:
_CKTtemp in libckt.a(ckttemp.o)
"_nutmeginfo", referenced from:
_ngSpice_Init in libngspice_la-sharedspice.o
"_Bug_Addr", referenced from:
_ivars in libmisc.a(ivars.o)
"_Spice_Host", referenced from:
_ivars in libmisc.a(ivars.o)
"_AsciiRawFile", referenced from:
_ivars in libmisc.a(ivars.o)
"_ft_setflag", referenced from:
_cp_periodic in libfte.a(cpitf.o)
_ft_sigintr in libfte.a(signal_handler.o)
"_ngspice_compat_mode", referenced from:
_inp_readall in libfte.a(inpcom.o)

I was wondering if anyone here might be able to shed some light on this? The project is purely for academic purposes. I could go into more detail, once I can get in touch with somebody might be knowledgable about this.