This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: =?UTF-8?B?562U5aSNOiBHU0wgYW5kIEJvcmxhbmQgQysrIEJ1aWxkZXI=?=


First I tried
implib libgsl.lib libgsl.dll
This complains about ~10 duplicate symbols and does not link with BCB -
the linker complains it cannot find the functions I use.

So I used these options
implib -a -c libgsl.lib libgsl.dll
-a means add underscore to the function names
-c means case sensitive symbols. Then everything links fine and implib produces no warnings. I think case sensitive link should be the default in BCB, however help for the case-insensitive link option is quite unclear. I send a question about to the Borland's newsgroups.

Also be sure to have both libgsl.dll and libgslcblas.dll somewhere on
your path (or in the same directory with your project .EXE file)
Otherwise you will experience general protection fault even before
entering the WinMain function.

zhuyan wrote:
> how do you use *.dll for MSVC?
> i use implib to get the *.lib and add it to the project BCB and i failed to use any function in my project.
> (i just use the demo code for MSVC in the BCB)
> can you tell me how to use GSL in BCB in detail?
>
>
>
> -----原始邮件-----
> 发件人: gsl-discuss-owner@sources.redhat.com [mailto:gsl-discuss-owner@sources.redhat.com]代表 Bolek Vrany
> 发送时间: 2002年12月11日 0:55
> 收件人: gsl-discuss@sources.redhat.com
> 主题: GSL and Borland C++ Builder
>
>
> I wanted to use the Gnu Scientific Library (GSL) with Borland C++
> Builder (BCB) version 6. Since I have not found any ports for this
> compiler, I tried the port for MSVC that can be found
> atwww.network-theory.co.uk, used the implib utility supplied with BCB to
> import the DLL libraries and added #include <gsl/interp.h> to my source
> to use the interpolation routines.
>
> There was a REALLY strange problem causing general protection fault in
> gsl_spline_alloc. After some time I found that it is caused by the
> GSL_VAR macro from gsl_types.h For use with BCB it must take this form
>
> #ifndef GSL_VAR
>
> #if defined(__BORLANDC__) || defined(__BCPLUSPLUS__)
> /* We have a Borland compiler
> It has __WIN32__ instead of WIN32 in MSVC,
> __DLL__ instead of _DLL in MSVC
> also add extern to the macro
> */
> # ifdef __WIN32__
> # ifdef __DLL__
> # define GSL_VAR extern __declspec(dllexport)
> # else
> # define GSL_VAR extern __declspec(dllimport)
> # endif
> # else
> # define GSL_VAR extern
> # endif
> #else
> # ifdef WIN32 /* Non-Borland compiler */
> # ifdef _DLL
> # ifdef DLL_EXPORT
> # define GSL_VAR __declspec(dllexport)
> # else
> # define GSL_VAR __declspec(dllimport)
> # endif
> # else
> # define GSL_VAR extern
> # endif
> # else
> # define GSL_VAR extern
> # endif
> #endif
>
> #endif /* GSL_VAR */
>
> The original version did not contain the lines between
> #if defined(__BORLANDC__) || defined(__BCPLUSPLUS__)
> and
> #else
>
> There might be some other problems in using BCB with GSL, but changing
> this avoided invalid pointers passed to gsl_spline_alloc.
>
> The same applies to the free Borland C++ Compiler, which is the core of BCB.
>
> --
> Bolek
>
>
>
> Checked by RAV antivirus for postfix on mail.ure.cas.cz
>
>
>
>





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]