Nontyp template argument, char[] vs char*

Hi
I just tried to compile this example
#include <iostream>
using namespace std;
template <const char *str>
struct xyz
  const char *p;
  xyz() : p(str) { }
  void print() { cout << str << endl; }
char Comeau[] = "Comeau C++";
int main()
  xyz<Comeau> x; // Now ok
  x.print();
}(slightly modified to be standalone, from here:
http://www.comeaucomputing.com/techtalk/templates/)
It compiles and runs OK with GCC 4.0.2. With
CC: Sun Ceres C++ 5.10 SunOS_sparc 2009/03/06
I get
CC -library=stlport4 +w2 bad_template.cpp -o bad_template
"bad_template.cpp", line 17: Error: Template parameter str requires an expression of type const char*.
1 Error(s) detected.
Is there a workaround for this?
Paul

It's a compiler bug. Please file a bug report on the C++ compiler at [http://bugs.sun.com]
A possible workaround is to declare Comeau as extern const. (Plain const would make it static.):
extern const char Comeau[] = "Comeau C++"; You would not be able to modify the array, of course.

Similar Messages

  • SunStudio 12 Fails to compile template function with template argument

    Hi
    Look at the code below:
    #include <iostream>
    template<class InIt, class OutIt>
    InIt copy_n(InIt first,  typename  std::iterator_traits<InIt>::difference_type  length, OutIt dest)
       for (;length--; ++dest, ++first)
          *dest = *first;
       return first;
    int main()
            char str1[]="Sumit";
            char str2[20];
            copy_n(str1,6,str2);
            std::cout << str2;
            return 0;
    }I have simplified this to pin point the problem, This code dosent compile with SunStudio12 C++ Compiler, (however this works fine on g++ and vc++). The problem is with second parameter
    typename std::iterator_traits<InIt>::difference_type  lengthinstead if we specify any simple type as below, it works fine
    int lengthSuns "http://developers.sun.com/sunstudio/documentation/ss12/whatsnew.html" says :
    Support for the following open-source libraries:
    BOOST http://www.boost.org
    The above code snippet is picked from "boost/boost_1_35_0/boost/interprocess/detail/algorithms.hpp" line number 65.
    Any Suggestions or work arounds??+
    The above Suns link also says:
    Complex expressions in template parameters.
    The compiler was previously unable to handle expressions in non-type template arguments in certain cases.
    I did not use any compilation flag, am I missing something?
    Edited by: sumitkumar on May 20, 2008 12:20 PM
    Edited by: sumitkumar on May 20, 2008 12:25 PM
    Edited by: sumitkumar on May 20, 2008 12:25 PM

    >
    Suns "http://developers.sun.com/sunstudio/documentation/ss12/whatsnew.html" says :
    Support for the following open-source libraries:
    BOOST http://www.boost.org
    Boost 1.34.1 should work OK. I haven't tried Boost 1.35 yet.
    The above code snippet is picked from "boost/boost_1_35_0/boost/interprocess/detail/algorithms.hpp" line number 65.
    Any Suggestions or work arounds??+
    The above Suns link also says:
    Complex expressions in template parameters.
    The compiler was previously unable to handle expressions in non-type template arguments in certain cases.
    I did not use any compilation flag, am I missing something?
    Make sure that you compile and link with -library=stlport4, otherwise you will be limited in the Boost libraries that you will be able to use.
    Paul

  • Char int and println MeSS, help plz any1??

    Hello dear people.
    Well, homework assignment was to write a code which will output the alphabet parallel a-z , A-Z
    using a for-loop
    so.... her's what i wrote:
    public class buha {
         public static void main(String[] args) {
              for (int nm=65; nm==90; nm+=1){ //A=65, Z=90, this is a numerical
                                             //presentation of the alphabet
                   char g=(char)nm;           //g for the capital letters
                            char k=(char)(nm+32);     //k for the small letters, 32 is
                                            //the difference between small and capital
                             System.out.println(g, ' ', k); //this show output capital, few spaces
                                            //and small.
    }Why isn't it working?
    Compiler shows an error with the println
    thanks allot, Amit

    thank you for your posts.
    i fixed the code as Sabre offeres (is the second expression in a for loop functions as a while condition or as an end condition?)
    now it looks like that:
    public class buha {
         public static void main(String[] args) {
              for (int nm=65; nm<=90; nm+=1){ //A=65, Z=90, this is a numerical
                                             //presentation of the alphabet
                   char g=(char)nm;           //g for the capital letters
                            char k=(char)(nm+32);     //k for the small letters, 32 is
                                            //the difference between small and capital
                             System.out.println(g, "  " , k); //this show output capital, few spaces
                                            //and small.
    }and still showing the same problem about the println, namely:
    The method println(char) in the type PrintStream is not applicable for the arguments (char, String, char)
    ideas?

  • Compiler error with default arguments and static template function

    Hi 
    The following does not compile with visual studio 2010 sp1, and compiles with gcc.
    #include <string>
    class A
    public:
       template<class T>
       static T& Get(const std::wstring&);
    class B
     public:
      void f(
        double d,
        double c =A::Get<double>(L"test"));
    int main()
        B b;
        b.f(5);
    It gives me the following error 
    error C2783: 'T & A::Get(const wchar_t *)' : could not deduce template argument for 'T'
    If I change Get to be global function and not static function of A, it compiles.

    It seems to be a compiler bug.  It fails in VS2012, but compiles in VS2013.
    For completion sake, the problem exists if A is a namespace containing Get.  But not if Get is global.
    The only solutions I can see are try to workaround the problem (make Get global) or upgrade to a newer version of VS.

  • Template template parameters don't work

    Consider the following code:
    #include <iostream>
    #include <algorithm>
    template <template <typename T, int I> class Container, typename type, int size>
    struct ContainerTraits
         typedef typename Container<type, size>::type value_type;
    template <typename T, int N>
    class MyContainer
         public:
              typedef T type;
              static const int SIZE = N;
              T* begin() { return data; }
              T* end() { return data+N; }
              T &operator[](int index) { return data[index]; }
         private:
              T data[N];
    template <template <typename T, int I> class Container, typename type, int size>
    void fillZeroContainer(Container<type, size> c)
         typedef ContainerTraits<Container, type, size> CTraits;
         typedef typename CTraits::value_type value_type;
         std::fill(c.begin(), c.end(), value_type(0));
    int main()
         MyContainer<float, 4> c;
         fillZeroContainer(c);
         std::cout << c[0] << std::endl;
         // Once the rest of the code compiles, try to uncomment this.
    //      float array[int(c[0]) + 2];
    //      array[0] = 0;
         return 0;
    Compiling yields:
    $ g++ -Wall sunCCproblem.cc
    $ sunCC sunCCproblem.cc
    "sunCCproblem.cc", line 40: Warning: The variable c has not yet been assigned a value.
    "sunCCproblem.cc", line 30: Error: Template template-parameter Container<T, I> requires a class template argument.
    "sunCCproblem.cc", line 40: Where: While instantiating "fillZeroContainer<MyContainer<float, 4>, float, 4>(MyContainer<float, 4>)".
    "sunCCproblem.cc", line 40: Where: Instantiated from non-template code.
    "sunCCproblem.cc", line 7: Warning (Anachronism): Using Container as a template without a declaration.
    "sunCCproblem.cc", line 31: Where: While specializing "ContainerTraits<MyContainer<float, 4>, float, 4>".
    "sunCCproblem.cc", line 31: Where: Instantiated from fillZeroContainer<MyContainer<float, 4>, float, 4>(MyContainer<float, 4>).
    "sunCCproblem.cc", line 40: Where: Instantiated from non-template code.
    1 Error(s) and 2 Warning(s) detected.
    This is Sun Studio 12 (x86) on Linux AMD64 (ubuntu).
    I think it is a bug in the compiler. GCC and Intel have no problem compiling this code.
    If that is not correct, please let me know what shold be corrected to make the code compile.
    Thanks in advance,
    F. Beekhof

    This problem was filed as CR 6639155, which you can view at
    [http://bugs.sun.com]
    This bug appears not to have been fixed yet.
    If your problem appears to be the same, you can vote for the bug. If not, you can file a new bug report.
    If you have a support contract with Sun, you can escalate the bug to get a fix sooner. You could also get the fix before it is officially released in a patch. You can find out about support contracts here:
    [http://developers.sun.com/sunstudio/support/index.jsp]

  • Template

    Is there an App that allows me to Create -Edit -Save a Template type document directly on the iphone4
    I am currently copy and pasting the template details into a new "note"
    Thanks in advance.
    Clive

    On 2/6/2015 4:21 PM, "chong kyong kim" wrote:
    Hi Igor.
    I have modified to meet your advice and I get
    the following compiler error:
      error C2783: 'X total(X)' : could not deduce template argument for 'addition'
    template < typename T1, typename T2>
    T2 addition( T1 t1,T2 t2){return t1+t2;}
    template <typename X,template <typename,typename> class addition>
    X total(X x1){return x1+addition(x1+5,x1+7);}
    int main()
      cout<<total(12)<<"\n";
    Well, looking at the declaration of "total", and and the call "total(12)", how is the compiler supposed to guess what the second template parameter should be?
    Note also that "total" expects a class template as its second template argument. In your program, there are no class templates at all. There is a function template (also, confusingly, named "addition"), but it isn't suitable as an
    argument for "total".
    If the idea was for "total" to always call "addition" function, then make it
    template <typename X>
    X total(X x1) { return x1+addition(x1+5, x1+7); }
    If the idea is something else, then explain what you are trying to achieve. It's not at all clear from the code.
    Igor Tandetnik

  • Template declaration error when variable assigned is the same as variable declared

    Hi Fedor,
    In comm-central repository, when compiling mozilla/mfbt/Compression.cpp using -std=c++11, it results in an error as follows:
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: Unexpected type name "T" encountered.
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: value is not defined.
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: No direct declarator preceding ">".
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: A declaration does not specify a tag or an identifier.
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: Default template argument cannot be specified on the definition of a class template member that appears outside of its class.
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: Templates can only declare classes or functions.
    "../dist/include/mozilla/CheckedInt.h", line 413: Error: No primary specialization for partial specialization NegateImpl<T, 0>.
    "../dist/include/mozilla/CheckedInt.h", line 416: Error: Too many arguments for template mozilla::detail::NegateImpl<T>.
    8 Error(s) detected.
    After a check on the file CheckedInt.h, it was narrowed down to the following code that resulted in the failure (the variable assigned, isSigned is the same as variable being declared) :
    template<typename T, bool IsSigned = IsSigned<T>::value>
    struct NegateImpl;
    This code, however compiles without problems in gcc-4.8.
    A workaround was to use a different variable declared in the template (e.g. bool IsTSigned = IsSigned<T>). But I just wanted to be sure whether is this a bug in 12.4 Beta or whether coding rules in templates do allow this kind of declaration? Kindly advise. Thanks.
    Regards,
    Brian

    Hi Steve,
    The declaration made below is not valid when -std=c++11 is not used (it causes the same compile-time errors when using July Refresh):
    template<typename U> class IsSigned;
    template<typename T, bool IsSigned = IsSigned<T>::value>
    struct NegateImpl;
    So far, the workaround was to use a different variable declared in the template (e.g. bool IsTSigned = IsSigned<T>).
    Regards,
    Brian

  • Gcc 4.7.2 fails to find/(or something else with) default library

    Hi!
    I use the gcc compiler (version 4.7.2) but when I try to compile using the following:
    g++ test.cpp
    I have verified that the code itself is perfectly valid because the following error does not occur when compiling on another machine (with the same file)
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/c++config.h:414:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:39,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/os_defines.h:45:19: error: missing binary operator before token "("
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/postypes.h:42:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iosfwd:42,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:39,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:66:11: error: '::mbstate_t' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:141:11: error: '::wint_t' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:143:11: error: '::btowc' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:144:11: error: '::fgetwc' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:145:11: error: '::fgetws' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:146:11: error: '::fputwc' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:147:11: error: '::fputws' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:148:11: error: '::fwide' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:149:11: error: '::fwprintf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:150:11: error: '::fwscanf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:151:11: error: '::getwc' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:152:11: error: '::getwchar' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:153:11: error: '::mbrlen' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:154:11: error: '::mbrtowc' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:155:11: error: '::mbsinit' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:156:11: error: '::mbsrtowcs' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:157:11: error: '::putwc' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:158:11: error: '::putwchar' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:160:11: error: '::swprintf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:162:11: error: '::swscanf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:163:11: error: '::ungetwc' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:164:11: error: '::vfwprintf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:166:11: error: '::vfwscanf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:169:11: error: '::vswprintf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:172:11: error: '::vswscanf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:174:11: error: '::vwprintf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:176:11: error: '::vwscanf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:178:11: error: '::wcrtomb' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:179:11: error: '::wcscat' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:180:11: error: '::wcscmp' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:181:11: error: '::wcscoll' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:182:11: error: '::wcscpy' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:183:11: error: '::wcscspn' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:184:11: error: '::wcsftime' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:185:11: error: '::wcslen' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:186:11: error: '::wcsncat' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:187:11: error: '::wcsncmp' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:188:11: error: '::wcsncpy' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:189:11: error: '::wcsrtombs' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:190:11: error: '::wcsspn' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:191:11: error: '::wcstod' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:193:11: error: '::wcstof' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:195:11: error: '::wcstok' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:196:11: error: '::wcstol' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:197:11: error: '::wcstoul' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:198:11: error: '::wcsxfrm' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:199:11: error: '::wctob' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:200:11: error: '::wmemcmp' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:201:11: error: '::wmemcpy' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:202:11: error: '::wmemmove' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:203:11: error: '::wmemset' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:204:11: error: '::wprintf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:205:11: error: '::wscanf' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:206:11: error: '::wcschr' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:207:11: error: '::wcspbrk' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:208:11: error: '::wcsrchr' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:209:11: error: '::wcsstr' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:210:11: error: '::wmemchr' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar: In function 'wchar_t* std::wcschr(wchar_t*, wchar_t)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:215:55: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:214:3: error: initializing argument 1 of 'wchar_t* std::wcschr(wchar_t*, wchar_t)' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar: In function 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:219:58: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:218:3: error: initializing argument 1 of 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar: In function 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:223:56: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:222:3: error: initializing argument 1 of 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar: In function 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:227:57: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:226:3: error: initializing argument
    1 of 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar: In function 'wchar_t* std::wmemchr(wchar_t*, wchar_t, std::size_t)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:231:61: error: invalid conversion from 'const wchar_t*' to 'wchar_t*' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:230:3: error: initializing argument 1 of 'wchar_t* std::wmemchr(wchar_t*, wchar_t, std::size_t)' [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar: At global scope:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:250:11: error: '::wcstold' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:259:11: error: '::wcstoll' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:260:11: error: '::wcstoull' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:266:22: error: '__gnu_cxx::wcstold' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:267:22: error: '__gnu_cxx::wcstoll' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:268:22: error: '__gnu_cxx::wcstoull' has not been declared
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iosfwd:42:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:39,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/postypes.h:230:16: error: 'mbstate_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/postypes.h:230:25: error: template argument 1 is invalid
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/postypes.h:230:36: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/postypes.h:232:16: error: 'mbstate_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/postypes.h:232:25: error: template argument 1 is invalid
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/postypes.h:232:37: error: invalid type in declaration before ';' token
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:41:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:65:15: error: 'mbstate_t' in namespace 'std' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:241:15: error: 'mbstate_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:309:15: error: 'wint_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:312:15: error: 'mbstate_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:351:26: error: 'int_type' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:354:33: error: 'int_type' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:359:25: error: 'int_type' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:359:47: error: 'int_type' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:362:33: error: 'int_type' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:366:33: error: 'int_type' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h: In static member function 'static int std::char_traits<wchar_t>::compare(const char_type*, const char_type*, std::size_t)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:328:39: error: 'wmemcmp' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h: In static member function 'static std::size_t std::char_traits<wchar_t>::length(const char_type*)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:332:26: error: 'wcslen' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h: In static member function 'static const char_type* std::char_traits<wchar_t>::find(const char_type*, std::size_t, const char_type&)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:336:37: error: invalid conversion from 'const char_type* {aka const wchar_t*}' to 'wchar_t*' [-fpermissive]
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/postypes.h:42:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iosfwd:42,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:39,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cwchar:230:3: error: initializing argument 1 of 'wchar_t* std::wmemchr(wchar_t*, wchar_t, std::size_t)' [-fpermissive]
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:41:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h: In static member function 'static std::char_traits<wchar_t>::char_type* std::char_traits<wchar_t>::move(std::char_traits<wchar_t>::char_type*, const char_type*, std::size_t)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:340:40: error: 'wmemmove' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h: In static member function 'static std::char_traits<wchar_t>::char_type* std::char_traits<wchar_t>::copy(std::char_traits<wchar_t>::char_type*, const char_type*, std::size_t)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:344:39: error: 'wmemcpy' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h: In static member function 'static std::char_traits<wchar_t>::char_type* std::char_traits<wchar_t>::assign(std::char_traits<wchar_t>::char_type*, std::size_t, std::char_traits<wchar_t>::char_type)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:348:37: error: 'wmemset' was not declared in this scope
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/c++locale.h:42:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/localefwd.h:42,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:42,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/clocale: At global scope:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/clocale:55:11: error: '::lconv' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/clocale:56:11: error: '::setlocale' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/clocale:57:11: error: '::localeconv' has not been declared
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/localefwd.h:42:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:42,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/c++locale.h:63:11: error: '__locale_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/c++locale.h:70:26: error: '__c_locale' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/c++locale.h: In function 'int std::__convert_from_v(const int&, char*, int, const char*, ...)':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/c++locale.h:78:19: error: 'setlocale' is not a member of 'std'
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/c++locale.h:78:
    34: error: 'LC_NUMERIC' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/c++locale.h:85:2: error: 'setlocale' is not a member of 'std'
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/c++locale.h:105:2: error: 'setlocale' is not a member of 'std'
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/localefwd.h:44:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:42,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype: At global scope:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:66:11: error: '::isalnum' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:67:11: error: '::isalpha' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:68:11: error: '::iscntrl' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:69:11: error: '::isdigit' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:70:11: error: '::isgraph' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:71:11: error: '::islower' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:72:11: error: '::isprint' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:73:11: error: '::ispunct' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:74:11: error: '::isspace' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:75:11: error: '::isupper' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:76:11: error: '::isxdigit' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:77:11: error: '::tolower' has not been declared
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cctype:78:11: error: '::toupper' has not been declared
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:42:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/localefwd.h:135:40: error: 'mbstate_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/localefwd.h:135:49: error: template argument 3 is invalid
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/localefwd.h:137:43: error: 'mbstate_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/localefwd.h:137:52: error: template argument 3 is invalid
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr.h:150:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:34,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:41,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:53:9: error: 'pthread_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:54:9: error: 'pthread_key_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:55:9: error: 'pthread_once_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:56:9: error: 'pthread_mutex_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:57:9: error: 'pthread_mutex_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:58:9: error: 'pthread_cond_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:140:1: error: 'pthread_once' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:140:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:141:1: error: 'pthread_getspecific' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:141:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:142:1: error: 'pthread_setspecific' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:142:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:144:1: error: 'pthread_create' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:144:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:145:1: error: 'pthread_join' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:145:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:146:1: error: 'pthread_equal' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:146:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:147:1: error: 'pthread_self' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:147:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:148:1: error: 'pthread_detach' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:148:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:150:1: error: 'pthread_cancel' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:150:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:152:1: error: 'sched_yield' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:152:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:154:1: error: 'pthread_mutex_lock' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:154:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:155:1: error: 'pthread_mutex_trylock' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:155:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:157:1: error: 'pthread_mutex_timedlock' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:157:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:159:1: error: 'pthread_mutex_unlock' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:159:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:160:1: error: 'pthread_mutex_init' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:160:1:
    error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:161:1: error: 'pthread_mutex_destroy' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:161:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:163:1: error: 'pthread_cond_init' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:163:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:164:1: error: 'pthread_cond_broadcast' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:164:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:165:1: error: 'pthread_cond_signal' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:165:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:166:1: error: 'pthread_cond_wait' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:166:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:167:1: error: 'pthread_cond_timedwait' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:167:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:168:1: error: 'pthread_cond_destroy' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:168:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:171:1: error: 'pthread_key_create' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:171:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:172:1: error: 'pthread_key_delete' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:172:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:173:1: error: 'pthread_mutexattr_init' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:173:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:174:1: error: 'pthread_mutexattr_settype' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:174:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:175:1: error: 'pthread_mutexattr_destroy' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:175:1: error: invalid type in declaration before ';' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:678:19: error: '__gthread_create' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:678:19: error: '__gthread_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:678:32: error: '__threadid' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:678:44: error: expected primary-expression before 'void'
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:679:5: error: expected primary-expression before 'void'
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:679:17: error: expression list treated as compound expression in initializer [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:680:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:685:17: error: '__gthread_join' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:685:17: error: '__gthread_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:685:41: error: expected primary-expression before 'void'
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:685:59: error: expression list treated as compound expression in initializer [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:686:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:691:19: error: '__gthread_detach' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:691:19: error: '__gthread_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:692:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:697:18: error: '__gthread_equal' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:697:18: error: '__gthread_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:697:36: error: '__gthread_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:697:52: error: expression list treated as compound expression in initializer [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:698:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:702:15: error: '__gthread_t' does not name a type
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h: In function 'int __gthread_yield()':
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:711:33: error: '__gthrw_sched_yield' cannot be used as a function
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h: At global scope:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:715:17: error: '__gthread_once' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:715:17: error: '__gthread_once_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:715:35: error: '__once' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:715:50: error: '__func' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:715:59: error: expected primary-expression before 'void'
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:715:64: error: expression list treated as compound expression in initializer [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:716:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:724:23: error: '__gthread_key_create' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:724:23: error: '__gthread_key_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:724:40: error: '__key' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:724:54: error: '__dtor' was not declared in this
    scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:724:63: error: expected primary-expression before 'void'
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:724:70: error: expression list treated as compound expression in initializer [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:725:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:730:23: error: '__gthread_key_delete' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:730:23: error: '__gthread_key_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:731:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:736:24: error: '__gthread_getspecific' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:736:24: error: '__gthread_key_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:737:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:742:24: error: '__gthread_setspecific' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:742:24: error: '__gthread_key_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:742:47: error: expected primary-expression before 'const'
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:742:64: error: expression list treated as compound expression in initializer [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:743:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:757:26: error: '__gthread_mutex_destroy' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:757:26: error: '__gthread_mutex_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:757:45: error: '__mutex' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:758:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:766:23: error: '__gthread_mutex_lock' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:766:23: error: '__gthread_mutex_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:766:42: error: '__mutex' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:767:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:775:26: error: '__gthread_mutex_trylock' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:775:26: error: '__gthread_mutex_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:775:45: error: '__mutex' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:776:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:785:28: error: '__gthread_mutex_timedlock' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:785:28: error: '__gthread_mutex_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:785:47: error: '__mutex' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:786:7: error: expected primary-expression before 'const'
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:786:44: error: expression list treated as compound expression in initializer [-fpermissive]
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:787:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:796:25: error: '__gthread_mutex_unlock' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:796:25: error: '__gthread_mutex_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:796:44: error: '__mutex' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:797:1: error: expected ',' or ';' before '{' token
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:807:42: error: '__gthread_recursive_mutex_init_function' declared as an 'inline' variable
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:807:42: error: '__gthread_recursive_mutex_t' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:807:71: error: '__mutex' was not declared in this scope
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr-default.h:808:1: error: expected ',' or ';' before '{' token
    In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:34:0,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:41,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40,
    from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40,
    from test.cpp:1:
    /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/gthr.h:153:27: error: expected declaration before end of line
    This is an example from a test file that basicly includes the <iostream>
    I have been looking around a bit but I'm not entirely sure of what I'm looking for except I suspect gcc can't find a file or something related to that.
    Also I was quite unsure however this is a newbie post or programming post...so I made a guess.
    Thanks on forehand
    //anden.d

    warning: database file for 'multilib' does not exist
    :: Synchronizing package databases...
    error: failed retrieving file 'multilib.db' from ftp.ds.hj.se : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from mirror.us.leaseweb.net : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from mirror.de.leaseweb.net : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from mirror.nl.leaseweb.net : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from archlinux.polymorf.fr : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from archlinux.limun.org : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from hive.ist.unomaha.edu : Failed to connect to 2620:d5:0:22bb::dead:beef: Network is unreachable
    error: failed retrieving file 'multilib.db' from mirrors.cicku.me : Could not resolve host: (nil); Name or service not known
    error: failed retrieving file 'multilib.db' from mirror.rit.edu : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from mirror.chmuri.net : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from mirrors.kernel.org : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from cake.lib.fit.edu : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from ftp.tuxdroid.org : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from mirror.bytemark.co.uk : The requested URL returned error: 404 Not Found
    error: failed retrieving file 'multilib.db' from miroir.ezvan.fr : The requested URL returned error: 404 Not Found
    And so on....
    also decided to add /etc/pacman.conf
    # /etc/pacman.conf
    # See the pacman.conf(5) manpage for option and repository directives
    # GENERAL OPTIONS
    [options]
    # The following paths are commented out with their default values listed.
    # If you wish to use different paths, uncomment and update the paths.
    #RootDir = /
    #DBPath = /var/lib/pacman/
    #CacheDir = /var/cache/pacman/pkg/
    #LogFile = /var/log/pacman.log
    #GPGDir = /etc/pacman.d/gnupg/
    HoldPkg = pacman glibc
    # If upgrades are available for these packages they will be asked for first
    SyncFirst = pacman
    #XferCommand = /usr/bin/curl -C - -f %u > %o
    #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
    #CleanMethod = KeepInstalled
    Architecture = auto
    # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
    #IgnorePkg =
    #IgnoreGroup =
    #NoUpgrade =
    #NoExtract =
    # Misc options
    #UseSyslog
    #UseDelta
    #TotalDownload
    CheckSpace
    #VerbosePkgLists
    # By default, pacman accepts packages signed by keys that its local keyring
    # trusts (see pacman-key and its man page), as well as unsigned packages.
    #SigLevel = Optional TrustedOnly
    # NOTE: You must run `pacman-key --init` before first using pacman; the local
    # keyring can then be populated with the keys of all official Arch Linux
    # packagers with `pacman-key --populate archlinux`.
    # REPOSITORIES
    # - can be defined here or included from another file
    # - pacman will search repositories in the order defined here
    # - local/custom mirrors can be added here or in separate files
    # - repositories listed first will take precedence when packages
    # have identical names, regardless of version number
    # - URLs will have $repo replaced by the name of the current repo
    # - URLs will have $arch replaced by the name of the architecture
    # Repository entries are of the format:
    # [repo-name]
    # Server = ServerName
    # Include = IncludePath
    # The header [repo-name] is crucial - it must be present and
    # uncommented to enable the repo.
    # The testing repositories are disabled by default. To enable, uncomment the
    # repo name header and Include lines. You can add preferred servers immediately
    # after the header, and they will be used before the default mirrors.
    #[testing]
    #SigLevel = PackageRequired
    #Include = /etc/pacman.d/mirrorlist
    [multilib]
    SigLevel = PackageRequired
    Include = /etc/pacman.d/mirrorlist
    [core]
    SigLevel = PackageRequired
    Include = /etc/pacman.d/mirrorlist
    [extra]
    SigLevel = PackageRequired
    Include = /etc/pacman.d/mirrorlist
    #[community-testing]
    #SigLevel = PackageRequired
    #Include = /etc/pacman.d/mirrorlist
    [community]
    SigLevel = PackageRequired
    Include = /etc/pacman.d/mirrorlist
    # An example of a custom package repository. See the pacman manpage for
    # tips on creating your own repositories.
    #[custom]
    #SigLevel = Optional TrustAll
    #Server = file:///home/custompkgs
    So multilib is there and I tried pacman -Syy

  • Compile errors with Solaris 5.8 and Studio 11 with latest patches

    I asked sa to patch my studio 11, and they applied patches 121023-04, 121015-04, 121017-08, 122142-03, 120761-03, 120760-11 and 122135-02. Then, I compiled my boost_1_33_1 again. It built some, but not all libraries. It stil spit out the following errors. Is this expected?
    "/home/vcheng/boost_1_33_1/libs/filesystem/build/../src/operations_posix_windows.cpp", line 126: Error: readdir_r is not a member of file level.
    ...failed sunpro-C++-action build_sunos/bin/boost/libs/filesystem/build/libboost_filesystem.a/sunpro/debug/operations_posix_windows.o...
    sunpro-C++-action build_sunos/bin/boost/libs/wave/build/libboost_wave.a/sunpro/debug/instantiate_cpp_exprgrammar.o
    "/home/vcheng/boost_1_33_1/boost/spirit/core/composite/epsilon.hpp", line 76: Error: complex expression not allowed in dependent template argument expression.
    "/home/vcheng/boost_1_33_1/boost/iostreams/device/file_descriptor.hpp", line 79: Warning: close_on_exit hides boost::iostreams::file_descriptor::impl::close_on_exit.
    1 Warning(s) detected.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 42: Error: BZ_CONFIG_ERROR is not defined.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 106: Error: The function "BZ2_bzCompressEnd" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 107: Error: The function "BZ2_bzDecompressEnd" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 113: Error: The function "BZ2_bzCompress" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 118: Error: The function "BZ2_bzDecompress" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 143: Error: The function "BZ2_bzCompressInit" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 147: Error: The function "BZ2_bzDecompressInit" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 97: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 100: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 110: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 349: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 383: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 437: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 458: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 477: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 495: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/config_file.cpp", line 35: Warning: allowed_options hides boost::program_options::detail::common_config_file_iterator::allowed_options.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 311: Error: Could not find a match for std::count<std::InputIterator, std::T, std::Size>(char*, char*, char) needed in::format_paragraph(std::ostream &, std::string, unsigned, unsigned).
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 378: Error: Too few arguments for template std::reverse_iterator.
    "/.automount/opt/Forte/sunstudio11_patch1/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 432: Error: "friend" declaration is incompatible with function template.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 378: Where: While specializing "std::reverse_iterator<const char*>".
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 378: Where: Specialized in non-template code.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 379: Error: Too few arguments for template std::reverse_iterator.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 387: Error: Could not find a match for std::distance<std::ForwardIterator, std::Distance>(const char*, const char*) needed in::format_paragraph(std::ostream &, std::string, unsigned, unsigned).

    You can take Boost 1.34 but you have to use CVS and you have to modify Boost configuration files to use -library=stlport4 option.
    Or you can take Boost 1.32, read this article http://blogs.sun.com/roller/page/sga?entry=boost_mini_howto and apply this patch http://blogs.sun.com/roller/resources/sga/boost_1_32_0.patch.
    As you can see here http://engineering.meta-comm.com/boost-regression/CVS-RC_1_34_0/developer/summary.html Sun C++ is in a good shape.

  • GGobi fails to compile, wrong function calls in graphviz.c

    Hi there,
    I'm having troubles to makepkg ggobi, where make fails due to the below pasted errors.
    I am on a 64-bit system (a MacBook I put Arch on), not sure if that is relevant.
    Does anyone have an idea what is wrong here?
    Thanks,
    Alex
    graphviz.c: In function 'dot_neato_layout_cb':
    graphviz.c:215:3: error: too few arguments to function 'aginit'
    aginit();
    ^
    In file included from /usr/include/graphviz/types.h:49:0,
    from /usr/include/graphviz/gvc.h:17,
    from graphviz.c:16:
    /usr/include/graphviz/cgraph.h:359:13: note: declared here
    extern void aginit(Agraph_t * g, int kind, char *rec_name, int rec_size,
    ^
    graphviz.c:220:3: error: incompatible type for argument 2 of 'agopen'
    graph = agopen("graph", kind);
    ^
    In file included from /usr/include/graphviz/types.h:49:0,
    from /usr/include/graphviz/gvc.h:17,
    from graphviz.c:16:
    /usr/include/graphviz/cgraph.h:266:18: note: expected 'Agdesc_t' but argument is of type 'gint'
    extern Agraph_t *agopen(char *name, Agdesc_t desc, Agdisc_t * disc);
    ^
    graphviz.c:220:3: error: too few arguments to function 'agopen'
    graph = agopen("graph", kind);
    ^
    In file included from /usr/include/graphviz/types.h:49:0,
    from /usr/include/graphviz/gvc.h:17,
    from graphviz.c:16:
    /usr/include/graphviz/cgraph.h:266:18: note: declared here
    extern Agraph_t *agopen(char *name, Agdesc_t desc, Agdisc_t * disc);
    ^
    graphviz.c:226:5: error: too few arguments to function 'agnode'
    agnode(graph, name);
    ^
    In file included from /usr/include/graphviz/types.h:49:0,
    from /usr/include/graphviz/gvc.h:17,
    from graphviz.c:16:
    /usr/include/graphviz/cgraph.h:280:18: note: declared here
    extern Agnode_t *agnode(Agraph_t * g, char *name, int createflag);
    ^
    graphviz.c:248:7: error: too few arguments to function 'agedge'
    edge = agedge(graph, tail, head);
    ^
    In file included from /usr/include/graphviz/types.h:49:0,
    from /usr/include/graphviz/gvc.h:17,
    from graphviz.c:16:
    /usr/include/graphviz/cgraph.h:291:18: note: declared here
    extern Agedge_t *agedge(Agraph_t * g, Agnode_t * t, Agnode_t * h,
    ^
    graphviz.c:285:36: error: 'Agnode_t' has no member named 'name'
    agsafeset (graph, "root", ctr->name, NULL);
    ^
    graphviz.c:315:13: warning: assignment makes pointer from integer without a cast [enabled by default]
    sym = agfindattr(graph,"dim");
    ^
    graphviz.c:317:15: warning: assignment makes pointer from integer without a cast [enabled by default]
    sym = agraphattr(graph,"dim","");
    ^
    graphviz.c:319:26: error: 'attrsym_t' has no member named 'index'
    agxset(graph, sym->index, buf);
    ^
    graphviz.c:354:11: error: 'Agnode_t' has no member named 'u'
    node->u.width = node->u.height = .001;
    ^
    graphviz.c:354:27: error: 'Agnode_t' has no member named 'u'
    node->u.width = node->u.height = .001;
    ^
    Makefile:393: recipe for target 'plugin_la-graphviz.lo' failed
    make[3]: *** [plugin_la-graphviz.lo] Error 1

    >
    Suns "http://developers.sun.com/sunstudio/documentation/ss12/whatsnew.html" says :
    Support for the following open-source libraries:
    BOOST http://www.boost.org
    Boost 1.34.1 should work OK. I haven't tried Boost 1.35 yet.
    The above code snippet is picked from "boost/boost_1_35_0/boost/interprocess/detail/algorithms.hpp" line number 65.
    Any Suggestions or work arounds??+
    The above Suns link also says:
    Complex expressions in template parameters.
    The compiler was previously unable to handle expressions in non-type template arguments in certain cases.
    I did not use any compilation flag, am I missing something?
    Make sure that you compile and link with -library=stlport4, otherwise you will be limited in the Boost libraries that you will be able to use.
    Paul

  • Error when try to build listener project

    I am trying to build the listener project using VC++6. But I get such errors:<br />//==============================================================/<br />--------------------Configuration: Listener - Win32 Debug--------------------<br />Compiling resources...<br />E:\FYP\test\Listener\Listener.rc(152) : fatal error RC1015: cannot open include file 'Listener.pipl'.<br />Error executing rc.exe.<br />E:\FYP\test\Listener\Listener.rc(152): Could not find the file Listener.pipl.<br />E:\FYP\test\Listener\Listener.rc(153): Could not find the file About.rc.<br /><br />Auto.8li - 1 error(s), 0 warning(s)<br />//==============================================================/<br /><br />if I comment the two lines that cause error, many errors come out as following:<br /><br />//==============================================================/<br />--------------------Configuration: Listener - Win32 Debug--------------------<br />Compiling resources...<br />Compiling...<br />Listener.cpp<br />e:\fyp\code\samplecode\common\includes\piusuites.h(46) : error C2065: 'PSAliasSuite' : undeclared identifier<br />e:\fyp\code\samplecode\common\includes\piusuites.h(46) : error C2955: 'AutoSuite' : use of class template requires template argument list<br />        e:\fyp\code\samplecode\common\includes\piusuites.h(28) : see declaration of 'AutoSuite'<br />e:\fyp\test\listener\common\listener.cpp(301) : error C2660: 'GetFullPathToDesktop' : function does not take 2 parameters<br />ListenerScripting.cpp<br />e:\fyp\code\samplecode\common\includes\piusuites.h(46) : error C2065: 'PSAliasSuite' : undeclared identifier<br />e:\fyp\code\samplecode\common\includes\piusuites.h(46) : error C2955: 'AutoSuite' : use of class template requires template argument list<br />        e:\fyp\code\samplecode\common\includes\piusuites.h(28) : see declaration of 'AutoSuite'<br />ListenerUI.cpp<br />e:\fyp\code\samplecode\common\includes\piusuites.h(46) : error C2065: 'PSAliasSuite' : undeclared identifier<br />e:\fyp\code\samplecode\common\includes\piusuites.h(46) : error C2955: 'AutoSuite' : use of class template requires template argument list<br />        e:\fyp\code\samplecode\common\includes\piusuites.h(28) : see declaration of 'AutoSuite'<br />e:\fyp\test\listener\common\listenerui.cpp(115) : error C2660: 'GetCurrentSelection' : function does not take 1 parameters<br />e:\fyp\test\listener\common\listenerui.cpp(184) : error C2660: 'GetCurrentSelection' : function does not take 1 parameters<br />e:\fyp\test\listener\common\listenerui.cpp(259) : error C2660: 'GetCurrentSelection' : function does not take 1 parameters<br />e:\fyp\test\listener\common\listenerui.cpp(330) : error C2664: 'SetText' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *'<br />        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called<br />ListenerUIWin.cpp<br />e:\fyp\test\listener\listeneruiwin.cpp(28) : fatal error C1083: Cannot open include file: 'Listener.h': No such file or directory<br />Error executing cl.exe.<br /><br />Auto.8li - 12 error(s), 0 warning(s)<br /><br />//==============================================================/<br /><br />Anybody could help me with this? Thanks.

    Seems like visual studio does not know where the listener.pipl and the about.rc files are located. The listener.pipl is created/builded by a custom build step, by default this custom build step puts the created listner.pipl into the objects folder, you don't want it there though:
    Either:
    - copy the listener.pipl file next to your listener.r file
    - change the custum build step (=> Project settings => custom build step), there you will find the output-dir parameter, which should look something like:
    "$(IntDir)\$(InputName).pipl"
    Now, either change the IntDir macro (which originaly points to the obj folder), or simply change this to
    "..\win\$(InputName).pipl"
    About the about.rc : either copy this next to your implementation files or make sure that in you project settings under:
    "configuration properties->c/c++->additional include directories"
    you have added the path to the "Adobe Photoshop CS3 SDK\samplecode\common\resources" folder of the sdk.
    If that doesn't work remove all references to the about-dialog-box from listener (i.e. don't display an about box anymore); about.rc is just the ressource definition for the default about-box of plugins.

  • Calling SQL function in SQL query fails

    Hi There,
    I am trying to execute INSERT INTO XML_DATA (NAME, DATASIZE, DATA) VALUES (?,?,XMLType('?')) using ODBC C
    SQLBindParameter APIs.
    If I execute the INSERT INTO XML_DATA (NAME, DATASIZE, DATA) VALUES (?,?,XMLType('<name>milind</name>')) works fine.
    Can anybody please help me out here?
    Thanks,
    Milind
    /* blob.c
    * The following C code demonstrates how to read an input file, piecewise
    * (in chunks), and write it into a BLOB or LONG RAW column in the database.
    * It then reads that BLOB or LONG RAW data, piecewise, from the database
    * and writes it back to the OS as an output file that you specify.
    * Enter the following SQL statement via SQL*Plus to create the table
    * 'images_data' for use with this sample. Make sure you log into
    * Oracle as a user appropriate for running this example.
    * For BLOB, use the following table:
    * CREATE TABLE images_data (
    * name VARCHAR2(100),
    * imagesize NUMBER,
    * image BLOB);
    * For LONG RAW, use the following table:
    * CREATE TABLE images_data (
    * name VARCHAR2(100),
    * imagesize NUMBER,
    * image LONG RAW);
    * Change the connection information at the beginning of the procedure OpenOra
    * to your DSN, username and password.
    * To run this program, open a Command Prompt and use the following syntax:
    * Syntax: <program_name> <infile_name> <outfile_name>
    * Example call: C:\> blob my_photo.jpg copy_of_my_photo.jpg
    #include "stdafx.h"
    #include <stdio.h>
    #include <io.h>
    #ifndef NUTC
    #include <windows.h>
    #endif
    #include <sql.h>
    #include <sqlext.h>
    #ifdef NUTC
    #include <sys/types.h>
    #include <sys/stat.h>
    #endif
    * Global variables
    HENV hOdbcEnv = NULL; /* Environment handle */
    HDBC hDbConn = NULL; /* Connection handle */
    int sr; /* Return value */
    #define BUFSIZE 32020 /* Chunksize */
    * Connect routine
    void OpenOra()
    char szDSN[] = "XY10g2"; /* Data Source Name (DSN) */
    char szUID[] = "odbc1"; /* Username */
    char szAUTH[] = "pdmuser"; /* Password */
    * Allocate environment handle
    sr = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hOdbcEnv);
    if (sr != SQL_SUCCESS)
    printf ("Error allocating environment handle\n");
    * Set the ODBC Version
    sr = SQLSetEnvAttr(hOdbcEnv, SQL_ATTR_ODBC_VERSION,(SQLPOINTER)SQL_OV_ODBC3, SQL_IS_INTEGER);
    if (sr != SQL_SUCCESS)
    printf ("Error setting ODBC version\n");
    * Allocate connection handle
    sr = SQLAllocHandle (SQL_HANDLE_DBC, hOdbcEnv, &hDbConn);
    if (sr != SQL_SUCCESS)
    printf ("Error allocating connection handle\n");
    * Connect
    sr = SQLConnect(hDbConn, (UCHAR *)szDSN, SQL_NTS,(UCHAR *)szUID, SQL_NTS, (UCHAR *)szAUTH, SQL_NTS);
    if (sr != SQL_SUCCESS)
    printf("Connection failed\n");
    * Disconnect routine
    void CloseOra()
    * Disconnect and free connection and environment handles
    sr = SQLDisconnect(hDbConn);
    if (hDbConn != SQL_NULL_HANDLE)
    SQLFreeHandle(SQL_HANDLE_DBC, hDbConn);
    if (hOdbcEnv != SQL_NULL_HANDLE)
    SQLFreeHandle(SQL_HANDLE_ENV, hOdbcEnv);
    * Read INFILE into the database and read data back out and save as OUTFILE.
    void readCertImage(char read_name, long filesize, char write_name)
    SQLCHAR iSqlCmd[300] = "INSERT INTO XML_DATA (NAME, DATASIZE, DATA) VALUES (?,?,XMLType('?'))";
    SQLCHAR iSqlCmd1[300] = "SELECT DATA FROM XML_DATA WHERE NAME = ?";
    FILE ifile, ofile; /* File pointers */
    time_t startTime, endTime;
    time_t startTimeIO, endTimeIO;
    int IOtime = 0;
    unsigned char buf[BUFSIZE]; /* Buffer to hold chunk */
    unsigned char buf1[BUFSIZE]; /* Buffer to hold chunk */
    SQLINTEGER type[3]; /* Type of data */
    SQLPOINTER pToken; /* Which column is piecewise */
    HSTMT hstmt = NULL; /* Statement handle */
    long i; /* Byte Counter */
    long count; /* Piecewise Counter */
    long rd; /* Amount to read */
    * Log on
    OpenOra();
    ifile = fopen(read_name, "r"); /* Open the file for reading in ASCII mode */
    * Allocate statement handle
    sr = SQLAllocHandle(SQL_HANDLE_STMT, hDbConn, &hstmt);
    if (sr != SQL_SUCCESS)
    printf("Error allocating statement handle\n");
    * Prepare insert statement
    sr = SQLPrepare(hstmt, iSqlCmd, SQL_NTS);
    if (sr != SQL_SUCCESS)
    printf("Error preparing insert statement\n");
    * Bind Parameters
    /* Name of BLOB */
    sr = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 0, 0,read_name, strlen(read_name), &type[0]);
    if (sr != SQL_SUCCESS)
    printf("Error binding name variable\n");
    /* Size of BLOB */
    sr = SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_NUMERIC, 0, 0,&filesize, 0, &type[1]);
    if (sr != SQL_SUCCESS)
    printf("Error binding length variable\n");
    * As this will be a piecewise insert do not need to pass a buffer here.
    * Instead pass the parameter number for identification purposes.
    /* BLOB data */
    sr = SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, 0, 0,(SQLPOINTER)3, 0, &type[2]);
    if (sr != SQL_SUCCESS)
    printf("Error binding data variable\n");
    type[0] = SQL_NTS; /* Null terminated string */
    type[1] = 0; /* Ignored for numbers */
    type[2] = SQL_LEN_DATA_AT_EXEC(filesize); /* Data at execution time */
    time( &startTime );
    * Execute the insert
    sr = SQLExecute(hstmt);
    if (sr == SQL_NEED_DATA)
    printf("\nAbout to perform piecewise insert of data\n\n");
    else if (sr != SQL_SUCCESS)
    printf("Error executing insert statement\n");
    * Retrieve the pointer to the buffer containing the address
    * of the location where the source BLOB will be sent
    sr = SQLParamData(hstmt, &pToken);
    if (sr != SQL_NEED_DATA)
    printf("Error - no piecewise operations required\n");
    * Write the data in BUFSIZE chunks
    i = 0; /* Initialize bytes inserted
    count = 0; /* Initialize pieces/chunks inserted */
    do
    count++; /* Increment chunk number */
    * If remaining bytes to read is greater than BUFSIZE,
    * read another BUFSIZE chunk. Otherwise, read remaining
    * chunk of bytes (which will be less than BUFSIZE)
    if (filesize - i >= BUFSIZE)
    rd = BUFSIZE;
    else
    rd = (filesize - i);
    printf("%5ld:%10ld - About to write %ld bytes to the database\n",count,i,rd);
    * Reads one rd sized chunk of data into buffer from source file (BLOB)
    time( &startTimeIO );
    fread(buf, rd, 1, ifile);
    time( &endTimeIO );
    IOtime = IOtime + (endTimeIO - startTimeIO);
    * Sends the contents of the buffer to the ODBC driver
    SQLPutData(hstmt, buf, rd);
    /* Recalculate total bytes sent */
    if (filesize - i >= BUFSIZE)
    i+= BUFSIZE;
    else
    i+= (filesize - i);
    } while (i < filesize);
    /* Check to see if all data has been sent */
    sr = SQLParamData(hstmt, &pToken);
    if (sr == SQL_NEED_DATA)
    printf("Error - still need data\n");
    printf("%5ld:%10ld - Done writing data\n",++count,i);
    time( &endTime );
    printf("BLOB Write completed StartTime: %d, EndTime: %d, IOTime: %d in seconds.\n", endTime, startTime, IOtime);
    printf("BLOB Write completed in %d seconds.\n", (endTime - startTime) - IOtime);
    fclose(ifile); /* Close the INFILE */
    printf("\nData inserted into database\n\n");
    * Now read the data back. Reuse the previous statement handle.
    SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    sr = SQLAllocHandle(SQL_HANDLE_STMT, hDbConn, &hstmt);
    if (sr != SQL_SUCCESS)
    printf("Error allocating statement handle\n");
    * Prepare select statement, bind variable and execute
    sr = SQLPrepare(hstmt, iSqlCmd1, SQL_NTS);
    if (sr != SQL_SUCCESS)
    printf("Error preparing select statement\n");
    sr = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 0, 0, read_name, strlen(read_name), &type[0]);
    if (sr != SQL_SUCCESS)
    printf("Error binding name variable\n");
    time( &startTime );
    sr = SQLExecute(hstmt);
    if (sr != SQL_SUCCESS)
    printf ("Error executing insert statement\n");
    ofile = fopen(write_name, "w"); /* Open the file for writing in ASCII mode */
    sr = SQLFetch(hstmt);
    if (sr != SQL_SUCCESS)
    printf ("Error fetching data\n");
    * Read the data in BUFSIZE chunks.
    i = 0; /* Initialize bytes inserted */
    count = 0; /* Initialize pieces/chunks inserted */
    memset(buf, NULL, BUFSIZE);
    do
    * Retrieve a BUFSIZE chunk of data into the buffer
    sr = SQLGetData(hstmt, 1, SQL_C_CHAR, buf, BUFSIZE, &type[2]);
    if (sr == SQL_ERROR)
    printf("Error fetching data\n");
    break;
    time( &startTimeIO );
    count++; /* Increment chunk number */
    /* Determine if this is a full chunk or the last chunk */
    if (filesize - i >= BUFSIZE)
    printf("%5ld:%10ld - About to write %ld bytes to file\n",count,i,BUFSIZE);
    fwrite(buf, BUFSIZE, 1, ofile); /* Write BUFSIZE chunk to file */
    else
    printf("%5ld:%10ld - About to write %ld bytes to file\n",count,i,filesize-i);
    fwrite(buf, filesize-i, 1, ofile); /* Write remaining chunk to file */
    time( &endTimeIO );
    IOtime = IOtime + (endTimeIO - startTimeIO);
    /* Recalculate total bytes retrieved */
    if (filesize - i >= BUFSIZE)
    i+= BUFSIZE;
    else
    i+= (filesize - i);
    } while (sr == SQL_SUCCESS_WITH_INFO);
    printf("%5ld:%10ld - Done writing file\n",++count,i);
    time( &endTime );
    printf("BLOB Read completed StartTime: %d, EndTime: %d, IOTime: %d in seconds.\n", endTime, startTime, IOtime);
    printf("BLOB Read completed in %d seconds.\n", (endTime - startTime) - IOtime);
    fclose(ofile); /* Close the OUTFILE */
    printf("\nData written to file\n");
    * Log off
    SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    CloseOra();
    * Main routine
    void main(argc, argv)
    int argc; /* Number of command line arguments */
    char argv[]; / Array of command line arguments */
    long filesize = 0; /* Size of INFILE */
    FILE ifile; / Pointer to INFILE */
    #ifdef NUTC
    struct stat statbuf; /* Information on a file. */
    #endif
    /* Check for the proper number of command line arguments entered by user */
    if (argc != 3)
    printf("\nCommand line syntax: <program_name> <infile_name> <outfile_name>");
    printf("\n Example call: blob input.exe output.exe\n");
    exit(1);
    /* Open INFILE */
    if( (ifile = fopen(argv[1], "rb" )) == NULL )
    printf( "\nThe file '%s' could not be opened\n",argv[1]);
    exit(1);
    else
    printf( "\nThe file '%s' was opened successfully\n",argv[1]);
    #ifdef NUTC
    /* Determine length of the INFILE */
    if (fstat(fileno(ifile), &statbuf) == 0)
    filesize = statbuf.st_size;
    else
    filesize = 0;
    #else
    filesize = filelength(fileno(ifile));
    #endif
    printf( "The file is %d bytes long\n",filesize);
    /* Close INFILE */
    fclose(ifile);
    /* Insert and retrieve BLOB */
    readCertImage(argv[1], filesize, argv[2]);
    }

    During binding, strings are generally skipped. As such, you should first try replacing XMLType('?') with XMLType(?). You don't need to specify '?' because the system knows the proper type from your SQLBindParameter call.
    Also, you should try replacing:
    sr = SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, 0, 0,(SQLPOINTER)3, 0, &type[2]);
    with
    sr = SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, 0, 0,(SQLPOINTER)buf, BUFSIZE, &type[2]);

  • Retrieve file name from full file path

    I am trying to retrieve a file name from a path (ex. c:\temp\tes.txt) using the following code, but it is given me an error of "The method split(String) in the type String is not applicable for the arguments (char).
    {code}
    String filepath = item.getName();
    String[] buf = filepath.split('/');
    String filename = buf[buf.length-1];
    {code}
    I tried to use double quote instead of single quote, but it is not returning anything.
    {code}
    String[] buf = filepath.split("/");
    {code}
    Anyone knows why? Thanks.

    How is this related to JDBC?
    Anyway, is the path separator actually a forward slash? Isn't it a backward slash?
    If you're using Apache Commons FileUpload (which I guess, the 'item.getName()' is recognizeable), then just read their FAQ: [http://commons.apache.org/fileupload/faq.html#whole-path-from-IE].

  • Class field in equipment as mandatory

    Hi Expert,
    Is there any possibility to set class field in equipment master data as mandatory field?
    I cannot found the setting, currently we are using ECC6
    Pls help,Thanks
    Rgds,

    Hi Leni,
    Through configuration its not possible.
    Check with your abap team for applying below mentioned user exit while create and change of equipment.
    User Exit - IHCL0001 - Create equipment using material template: Classes/chars
    or
    User Exit - IEQM0003 - Additional checks before equipment update
    This will meet your requirement.

  • GUI crashes when calling native code..

    Hi,
    I have interfaced to an existing C program using the Java Native Interface and I am controlling the C program using a GUI. The problem is that everytime I click on the button to call the native method, the GUI crashes... The bizarre thing is that the C code seems to actually execute properly and no exceptions are thrown..
    Anyone come across this problem?
    /john

    Hi,
    Thanks for the replies...
    The GUI completely disappears. No error file is generated. No exceptions are thrown. Here it is in more detail..
    The C code is invoked using the java native interface. The C code converts a MIDI file to a text file. It is normally run in DOS and accepts two parameters. You would run it in DOS normally as follows:
    mf2t Example1.mid Example1.txt.
    In the GUI I select the MIDI file and specify the output file (Example1.txt). I then pass these two parameters to the C code. The C code originally used argc and argv to accept the parameters. I replaced these with "fileArray" and "parameter"... "mf2t" replaces "main" in the native code...
    On the java side the code looks like this:
    static public native boolean mf2t(String s6, String s7);
    public String infile; // Input MIDI file
    public String textOut; // Output text file
    private void MIDIButtonActionPerformed(java.awt.event.ActionEvent evt) {
    Object target=evt.getSource();
    if(target == MIDIButton) {
    if(mf2t(infile,textOut)){
    InfoLabel.setText("MIDI to text conversion complete");
    The code is built on the C side into a DLL using MS Visual Studio.
    On the C side the code looks something like this:
    static char *fileArray[5];
    static int argument=3;
    static char midiArray[25];
    static char txtArray[25];
    void mf2t(int argument,char * fileArray[]);
    // Entry point to native C code is here
    JNIEXPORT jboolean JNICALL
    Java_MainWindow_mf2t (JNIEnv *env, jobject j1, jstring midi, jstring txt)
    const jbyte *midiFile;
    const jbyte *txtFile;
    midiFile=(*env)->GetStringUTFChars(env,midi, NULL);
    txtFile=(*env)->GetStringUTFChars(env,txt, NULL);
    // The lines above just convert the java string into a C equivalent..
    strcpy(midiArray,midiFile);
    strcpy(txtArray,txtFile);
    fileArray[0]="mf2t.exe"; // Here I get fileArray to point to the converted strings
    fileArray[1]=midiArray;
    fileArray[2]=txtArray;
    mf2t(argument,fileArray); // Then I pass this to a native method
    (*env)->ReleaseStringUTFChars(env,midi, midiFile);
    (*env)->ReleaseStringUTFChars(env,txt, txtFile);
    return 1;
    void mf2t(int argument,char * fileArray[]){
    // native code in here
    I think it may have something to do with threads.. I'm not sure though.. It's impossible to know whats going on in the C code when the GUI crashes. If anything looks strange it's because I left out some code here for the sake of brevity... Still if you see anything that stands out let me know..
    Thanks,
    John

Maybe you are looking for

  • I can no longer use 3D commands in Photoshop CS6 Extended

    I have Photoshop CS6 Extended (Ver 13.0.1x64). My desktop is Windows 7 64 Home premium; and Video card is: AMD Radeon HD 5570. The drivers and operating system is updated. I have been using simple 3D functions like "New 3D extrusion from..." from tim

  • Java.lang.NullPointerException in MSS iviews

    Hi, Can any one tell me the reasons for getting the below error? Only one user is getting this error while viewing all MSS Iviews. <b>Error:</b> java.lang.NullPointerException <b>Log Overview:</b> PortalComponentSession.putValue() failed [EXCEPTION]

  • [AS] How can I find files created in CS2?

    My company has 2000+ documents in a sytem that have been created using both InDn CS2 and CS3. I need to be able to list all of the files that have not been updated to CS3. I've tried querying a known CS2 file using applescript and the FInder but the

  • Live cueing of accompanying audio tracks?

    Hi, I need to cue the orchestral audio tracks which will accompany live performances (from the piano) of my piano concerto. I want to use a footswitch to 'bring the orchestra in' and then have Logic stop automatically at the end of each passage & awa

  • How to read a file ?

    Hi, Thank every one for your good suggestions! I solve my questions with your help. I hava other question: you know that I run my applet program online, but I want to read a file (.txt) which is saved on web servier side. the path name of the file is