[macstl-dev] template with C linkage

David Chilton David-Chilton at utc.edu
Sat Feb 5 11:27:00 WST 2005

  • Previous message: [macstl-dev] Re: macstl 0.2 is finally here! whew...
  • Next message: [macstl-dev] template with C linkage
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]


Glen,

I successfully built and executed the benchmark target in the macstl 
xcode project, and it looks great.  Now I'm trying to test 
incorporating macstl into the code for my honors thesis, which relies 
heavily on valarray's read from FITS files, but I can't seem to get gcc 
to build it.  I continually get "template with C linkage" errors.  The 
same code compiles fine using the standard library valarray.  below is 
an example:

#include <macstl/valarray.h>
using stdext::valarray;

class TestClass
{
         public:
                 static size_t testStatic;
                 TestClass(size_t n):index(n) {}
                 TestClass():index(0){}
                 size_t getindex() { return index;}
                 valarray<size_t> testFunc(valarray<TestClass>& input){
                         valarray<size_t> d(input.size());
                         for(size_t i =0; i<input.size();i++)
                                 d[i]=input[i];
                         return d;
                 }
         private:
                 size_t index;
}
size_t TestClass testStatic = size_t(0);

compile with: gcc -c -o test.o test.cpp

and tons of errors are given

Any suggestions would be appreciated.

Thanks,
David





  • Previous message: [macstl-dev] Re: macstl 0.2 is finally here! whew...
  • Next message: [macstl-dev] template with C linkage
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

More information about the macstl-dev mailing list