Post by Paul-Henri on Dec 18, 2014 11:15:04 GMT
Hello,
For navigation computation, I'd like to use the adacalc library in a C program environment (Visual C++ 2003, standard C, console application). For that I have included the adacalc.lib file:
#pragma comment(lib, "Adacalc.lib")
and added définitions:
extern double _stdcall MagVar (double lat, double lon, double alt, int day, int month, int year, int model);
And then made a call to this functions. This works perfectly.
When I try to use functions which return values (passed as reference variables with pointers), I expect some troubles:
The documentation refer those "output" arguments as "double &latd" for example in the following function:
extern void _stdcall Radial_Intersection (double lat1, double lon1, double trk1, double lat2, double lon2, double trk2, double &latd, double &lond)
This does not work for me and I have replaced the "&" with a "*" as for all C définitions of functions.
However, introducing a call to this function as follow:
double latd, lond;
Radial_Intersection (50.0, 25.0, 230.0, 10.0, 20.0, 100.0, &latd, &lond);
returns with a link error:
------ Début de la génération : Projet : decode_ssa, Configuration : Debug Win32 ------
Compilation...
decode_ssa.cpp
Édition des liens en cours...
decode_ssa.obj : error LNK2019: symbole externe non résolu "void __stdcall Radial_Intersection(double,double,double,double,double,double,double *,double *)" (?Radial_Intersection@@ygxnnnnnnpan0@Z) référencé dans la fonction _main
Debug/decode_ssa.exe : fatal error LNK1120: 1 externes non résolus
Le journal de génération a été enregistré à l'emplacement "file://c:\Personnel\Avion\simulateur\Pc\decode_ssa\Debug\BuildLog.htm"
decode_ssa - 2 erreur(s), 0 avertissement(s)
---------------------- Terminé ----------------------
Génération : 0 a réussi, 1 a échoué, 0 a été ignoré
Does somebody have an idea of the mistake I could have done ?
Best regards.
Paul-Henri