[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] GSL for windows usage
From: |
perfectShaka |
Subject: |
[Bug-gsl] GSL for windows usage |
Date: |
Tue, 12 Apr 2005 11:23:59 +0200 (CEST) |
I tried it with VC7.0 and BC++ 6 but the dlls couldn't
fully work ...
VC7.0
------
it seems that the include file gsl_types.h don't
correctly redirect this two defines :
GSL_VAR and GSL_EXPORT
I came to conclusion that this lines are valids
# define GSL_VAR extern
# define GSL_EXPORT
but if you want to use globals variables from DLL, you
must have these
# define GSL_VAR extern __declspec(dllimport)
Did I miss an option ? Otherwise, variables are not
good linked and program crash with their use.
BC++ 6
-------
It's a bit more complicated here ...
First, we have to redefine GSL_VAR and GSL_EXPORT like
with VC7
- problems with functions :
The problem with exported functions is that BCC
imports dll functions with the default convention(
Cdecl by default )
so I had to switch to stdcall convention.
One other solution is too add __stdcall before each
functions but it as a special place so we have to
reformat the prototype
or else it won't work :
GSL_EXPORT gsl_rng *gsl_rng_alloc (const gsl_rng_type
* T);
=>
GSL_EXPORT gsl_rng *__stdcall gsl_rng_alloc (const
gsl_rng_type * T);
- problems with variables :
BC++ automaticly add underscores before each global
imported variable !
I had to modify it the exports.def and re-make the
libgsl-bcc.lib like this :
gsl_rng_default
=>
_gsl_rng_default=gsl_rng_default*
(see the joined exports.def)
with command line : implib libgsl-bcc libgsl.def
libgsl.dll
I believe this would help a bit other developpers ...
good luck !
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gsl] GSL for windows usage,
perfectShaka <=