![]() |
Blitz Support : |
From: Julian Cummings (cummings_at_[hidden])
Date: 2005-04-25 12:54:02
Hi Chris,
The problem here is actually the ordering of your command line. When you
compile and link in a single command line with g++, you must list the
libraries after the source code. Otherwise, the libraries do not get
properly linked in. Thus,
g++ blitztest.cpp -lblitz -lm
Also, you may need to add the appropriate -I and -L flags to indicate the
location of the blitz header files and library.
Regards, Julian C.
Dr. Julian C. Cummings
Staff Scientist, CACR/Caltech
(626) 395-2543
cummings_at_[hidden]
> Hi ,
>
> In fact you forgot to link with the library. The libblitz.a
> is not in your path. What you did in fact is :
> g++ -lm blitztest.cpp
>
> Xavier
>
>
> Chris Neff wrote:
> > Hi, I am new to Blitz++. I have gotten sick of programming
> in Fortran 77
> > after learning of the joy of OOP, but I still like the
> Fortran style of
> > array storage for alot of my code because its column
> ordering is how I
> > think. I try to compile this code:
> >
> >
> --------------------------------------------------------------
> ----------------
> > #include <blitz/array.h>
> >
> > using namespace blitz;
> >
> > Array<int,1> x; // A one-dimensional array of int
> > Array<int,2> A(3, 3, fortranArray);
> >
> > int main()
> > {
> >
> > }
> >
> >
> --------------------------------------------------------------
> ----------------
> >
> > using the following g++ command:
> >
> > g++ -lblitz -lm blitztest.cpp
> >
> >
> > And i get the error:
> >
> > /tmp/cccfRe8Y.o(.text+0xbf): In function
> > `__static_initialization_and_destruction_0(int, int)':
> > : undefined reference to `blitz::fortranArray'
> > collect2: ld returned 1 exit status
> >
> >
> > It is finding the library okay, but it can't find
> fortranArray. Suggestions?
> >
> > Thanks for the help,
> > -Chris Neff
> >
> >
> >
> --------------------------------------------------------------
> ----------
> >
> > _______________________________________________
> > Blitz-support mailing list
> > Blitz-support_at_[hidden]
> > http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>
> _______________________________________________
> Blitz-support mailing list
> Blitz-support_at_[hidden]
> http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>