[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Hello All, didn't find any tips for BorlandC++ Builder v
From: |
Denis Glehen |
Subject: |
Re: [Help-gsl] Hello All, didn't find any tips for BorlandC++ Builder v6 and GSL lib |
Date: |
Tue, 8 Dec 2009 18:56:42 +0100 |
Hello Joseph and John and thanks for answering.
I tried to begin translating on CPPBuilder6 but i had several errors during
compiling. And as
i'm not aware with linux makefile system, i don't know how to rebuild .lib
files using builder.
I tried to use it on QT and it works very well. in fact static lib (.a)
formats are compatible so that it's very easy. The fact is that all my code
has been done on borland. i'm searching for solutions but i think that it
will be hard to find.
Visual Studio is not compatible with BCC, agree ? seem that lib formats are
not the same.
best
denis
2009/12/8 Earl, Joseph <address@hidden>
> I use the GSL libraries with Visual Studio 2008 Professional for physics
> simulations, so it is possible to get it working on other systems - try
> using the GSL for Windows version
> http://gnuwin32.sourceforge.net/packages/gsl.htm
> It also perfectly possible to use the raw package on Windows and just use
> an environment such as Cygwin to do Make and other operations.
>
> Regards,
> Joseph Earl
>
> -----Original Message-----
> From: address@hidden [mailto:
> help-gsl-bounces+joseph.earl06 <help-gsl-bounces%2Bjoseph.earl06>=
> address@hidden On Behalf Of Denis Glehen
> Sent: 07 December 2009 20:13
> To: address@hidden
> Subject: [Help-gsl] Hello All, didn't find any tips for BorlandC++ Builder
> v6 and GSL lib
>
> Hello,
>
> I hope I will not boring everyone with my question but I'm trying to use
> GSL
> with Borland C++ Builder v6.
> I saw on this mailing list some tips for this and I've done this :
>
> A) downloading the last GSL v1.13 source and windows binaries (
> http://ascendwiki.cheme.cmu.edu/Binary_installer_for_GSL-1.13_on_MinGW)
>
>
> B) change the include [gsl_types.h]
>
> #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
>
> /* normal procedure
> */
> etc...
>
>
> C) translate from the DLL to get a compatible C++Builder .LIB by
>
> implib -a -c libgsl-0.lib libgsl-0.dll
> implib -a -c libgslcblas-0.lib libgslcblas-0.dll
>
> (don't know why there is a -0.. but why not)
>
>
> D) create on the Builder IDE a small window with a TMemo // memoData //
> just to write a test result and use when opening the form the following
> code
> :
>
>
> #include <vcl.h>
> #pragma hdrstop
>
> #include "main.h"
>
> #define WIN32 __WIN32__
>
> #include <gsl/gsl_types.h>
> #include <gsl/gsl_blas.h>
>
>
> //---------------------------------------------------------------------------
> #pragma package(smart_init)
> #pragma resource "*.dfm"
> TForm1 *Form1;
>
> //---------------------------------------------------------------------------
> __fastcall TForm1::TForm1(TComponent* Owner)
> : TForm(Owner)
> {
> AnsiString string;
>
> double a[] = { 0.11, 0.12, 0.13,
> 0.21, 0.22, 0.23 };
>
> double b[] = { 1011, 1012,
> 1021, 1022,
> 1031, 1032 };
>
> double c[] = { 0.00, 0.00,
> 0.00, 0.00 };
>
> gsl_matrix_view A = gsl_matrix_view_array(a, 2, 3);
> gsl_matrix_view B = gsl_matrix_view_array(b, 3, 2);
> gsl_matrix_view C = gsl_matrix_view_array(c, 2, 2);
>
> /* Compute C = A B */
>
> gsl_blas_dgemm (CblasNoTrans, CblasNoTrans,
> 1.0, &A.matrix, &B.matrix,
> 0.0, &C.matrix);
>
> string.sprintf("[ %g, %g\n", c[0], c[1]);
> memoData->Lines->Add(string);
> string.sprintf(" %g, %g ]\n", c[2], c[3]);
> memoData->Lines->Add(string);
> }
>
>
> sorry for this, this is standard builder code :-s
>
> E) compile and link with
> libgsl-0.lib
> libgslcblas-0.lib
>
> all is ok for compiling and linking (no Error)
>
> D) execute and... surprise .. :-s it doesn't work !
>
> when executing, an error window appear with a
>
> RunTime Error !
> this application has requested the Runtime to terminate .. etc... etc...
>
>
>
>
>
> So, it seem that it's not so simple to use gsl on other system than gcc
> (maybe QT ? have to check)
> The case is that I use to develop my softs on C++Builder v6 so. If someone
> should have tips and tricks
> to get someting working (or place to find the good static lib (without
> using
> dll) I will thank him (or her) a lot.
>
> Do you have any ideas ?
>
> Best for all
>
> --
> Denis Glehen
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gsl
>
--
Denis Glehen
+33 6 72 96 35 44 - www.denisglehen.com