Gcc is joh, g++ is no

Hi,
I'm trying to compile this:
#include<stdio.h>
#include<stdlib.h>
#include <ctype.h>
#include<string.h>
#include <sauv_oracle.h>
void err_report(Cda_Def *cursor) {
sword n;
text msg[512]; /* message buffer to hold error text */
if (cursor->fc > 0)
printf("\n-- ORACLE error when processing OCI function %s \n\n",
oci_func_tab[cursor->fc]);
else
printf("\n-- ORACLE error\n");
n = (sword)oerhms(&lda, cursor->rc, msg, (sword) sizeof msg);
fprintf(stderr, "%s\n", msg);
void logon( char username, char password, char *database)
if (olog(&lda, (ub1 *)hda, (text *)username, -1, (text *)password, -1,
(text *)database, -1, (ub4)OCI_LM_DEF))
err_report((Cda_Def *)&lda);
exit(OCI_EXIT_FAILURE);
int main() {
logon("ocitest", "ocitest", "sauv");
exit(0);
where sauv_oracle.h is:
#ifdef RCSID
static char *RCSid =
"$Header: oci02.c 14-jul-99.13:21:21 mjaeger Exp $ ";
#endif /* RCSID */
/* Copyright (c) 1995, 1999, Oracle Corporation. All rights reserved. */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <oratypes.h>
/* LDA and CDA struct declarations */
#include <ocidfn.h>
#ifdef __STDC__
#include <ociapr.h>
#else
#include <ocikpr.h>
#endif
/* demo constants and structs */
#include <ocidem.h>
/* oparse flags */
#define DEFER_PARSE 1
#define NATIVE 1
#define VERSION_7 2
/* exit flags */
#define OCI_EXIT_FAILURE 1
#define OCI_EXIT_SUCCESS 0
Lda_Def lda; /* login area */
ub4 hda[HDA_SIZE/(sizeof(ub4))]; /* host area */
Cda_Def cda; /* cursor area */
/* Function prototypes */
void logon ();
void logoff ();
void err_report();
void do_exit();
/* return values from query - kept as globals for simplicity */
uword colid;
uword collen;
Compiling it with gcc (and the appropriate -I flags and -L flags and a -lclntsh) works fine.
Even the resulting binary works (listener_.log lists a connection)
Doing the same thing with g++ results in:
/tmp/ccorVqVe.o(.text+0x5c): In function `err_report(cda_def*)':
: undefined reference to `oerhms(cda_def*, short, unsigned char*, int)'
/tmp/ccorVqVe.o(.text+0xab): In function `logon(char*, char*, char*)':
: undefined reference to `olog(cda_def*, unsigned char*, unsigned char*, int, unsigned char*, int, unsigned char*, int, unsigned)'
collect2: ld returned 1 exit status
What is it, that I'm not doing right?
Volker.

Can you include the OCI7 header file inside an extern "C" block and try?
Regards.

Similar Messages

  • Plans for gcc 4.0.0?

    Just wondering what Archlinux plans are for gcc 4.0.0, now that it's released.  It seems rather interesting the new features for optimizing, which seems to be right up arch's alley.  An i686-optimized linux distribution, after all, would benefit from better optimizations.
    I'm just hoping that not too much is broken with this new release (everyone remembers gcc 2.95 -> 3), but since this release came much faster and isn't an almost complete rewrite like egcs was, hopefully we can expect a smoother transition.
    I for one am excited about this new gcc release, much more than a new kde, gnome or x.org or whatever...  Maybe it's just me that likes compilers so much and hates bytecode.  But still, what is Arch's stance on this?  Any plans to move forward?  Maybe provide a gcc 4 package but keep compiling arch packages with 3.x until bugs get ironed out?  Or be truly bleeding edge (it is stable software afterall though) and take the plunge and compile arch packages with this new fancy gcc?
    Autovectorization seems rather interesting ( http://gcc.gnu.org/projects/tree-ssa/vectorization.html there's the link for anyone interested), yet needs -msse or -msse2 flags to be set.  Is this feasible?  Would this binary nicely optimized for processors with sse or sse2 run that much worse on hardware without such instructions?
    What is arch's stance on instructions like sse or 3dnow?  Are packages compiled with such optimizations?  If so why or if not why not?  I personally think that most arch users use relatively recent hardware and would benefit...  But then again, I'm just wondering aloud.
    Anyways, sorry for all the questions...

    Duke wrote:What is arch's stance on instructions like sse or 3dnow?  Are packages compiled with such optimizations?  If so why or if not why not?  I personally think that most arch users use relatively recent hardware and would benefit...  But then again, I'm just wondering aloud.
    This has been discussed alot - my stance (not Arch's) is that Arch is i686 based - that's the common factor... if you start creeping with that, when will it stop? first we require SSE, then MMX, then SSE2... we may end up switching from "an i686 optimized distro" to "a distro optimized to run on AMD processors produced after November 12th 2004".
    In addition, SSE instructions only make sense in advanced math applications, FFT programs, and multimedia stuff... it's a small subset of the applications... think about it: how could something like vim benefit from loop vectorization? it really can't... sure you may get some things improved... but it's vim, you don't need to do 50 calculations in the time it takes to do 1 - it's not processor intensive.
    And let's look at the apps that do make use of SSE: multimedia - improve the performance of mpegs and mp3s? who watches that much porn?
    :shock:  :shock:
    FFT programs - anyone seriously doing complex FFT/DSP calcs on Arch? I doubt it
    Advanced Math - sure might make sense, but it doesn't warrant a recompile and optimization of the entire set of packages.
    So, in my opinion, enabling SSE/SSE2/MMX/MMX2/whatever else you get:
    - loss of some processor support
    + improvement in MP3 playback
    + faster calculation of PI
    - a bunch of apps you had to redownload with negligable performance gain

  • Gcc not working with compiled glibc from PKGBUILD

    hello folks, please excuse my english
    i like to compile certain parts of my system, between them are the kernel, glibc , zsh, etc.
    i had noticed that using a compiled version of glibc from abs results in gcc not working at all ( C compiler cannot create executables logs says). this is weird especially because i hadn't had problems before, i have looked for the error mesagges on Google and a lot of people has had this problem but  nobody has a "generic" solution for this
    this is the config.log file from one failed compile of mpg123
    This file contains any messages produced by compilers while
    running configure, to aid debugging if configure makes a mistake.
    It was created by mpg123 configure 1.12.3, which was
    generated by GNU Autoconf 2.65. Invocation command line was
    $ ./configure --prefix=/usr --with-audio=alsa esd sdl
    ## Platform. ##
    hostname = Soul
    uname -m = x86_64
    uname -r = 2.6.34.1
    uname -s = Linux
    uname -v = #1 SMP PREEMPT Tue Jul 6 23:23:17 CLT 2010
    /usr/bin/uname -p = unknown
    /bin/uname -X = unknown
    /bin/arch = x86_64
    /usr/bin/arch -k = unknown
    /usr/convex/getsysinfo = unknown
    /usr/bin/hostinfo = unknown
    /bin/machine = unknown
    /usr/bin/oslevel = unknown
    /bin/universe = unknown
    PATH: /bin
    PATH: /usr/bin
    PATH: /usr/local/bin
    PATH: /sbin
    PATH: /usr/sbin
    PATH: /usr/local/sbin
    PATH: /usr/share/java/apache-ant/bin
    PATH: /usr/lib/perl5/core_perl/bin
    ## Core tests. ##
    configure:2849: checking build system type
    configure:2863: result: x86_64-unknown-linux-gnu
    configure:2883: checking host system type
    configure:2896: result: x86_64-unknown-linux-gnu
    configure:2933: checking for a BSD-compatible install
    configure:3001: result: /bin/install -c
    configure:3012: checking whether build environment is sane
    configure:3062: result: yes
    configure:3203: checking for a thread-safe mkdir -p
    configure:3242: result: /bin/mkdir -p
    configure:3255: checking for gawk
    configure:3271: found /bin/gawk
    configure:3282: result: gawk
    configure:3293: checking whether make sets $(MAKE)
    configure:3315: result: yes
    configure:3402: checking for -Werror in CFLAGS (It breaks tests)
    configure:3412: result: no
    configure:3423: checking if you are up to something totally static with LDFLAGS/CFLAGS
    configure:3443: result: no
    configure:3463: checking for style of include used by make
    configure:3491: result: GNU
    configure:3561: checking for gcc
    configure:3577: found /usr/bin/gcc
    configure:3588: result: gcc
    configure:3817: checking for C compiler version
    configure:3826: gcc --version >&5
    gcc (GCC) 4.5.1
    Copyright (C) 2010 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    configure:3837: $? = 0
    configure:3826: gcc -v >&5
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/lto-wrapper
    Target: x86_64-unknown-linux-gnu
    Configured with: ../configure --prefix=/usr --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-gnu-unique-object --enable-lto --enable-plugin --disable-multilib --disable-libstdcxx-pch --with-system-zlib --with-ppl --with-cloog --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
    Thread model: posix
    gcc version 4.5.1 (GCC)
    configure:3837: $? = 0
    configure:3826: gcc -V >&5
    gcc: '-V' option must have argument
    configure:3837: $? = 1
    configure:3826: gcc -qversion >&5
    gcc: unrecognized option '-qversion'
    gcc: no input files
    configure:3837: $? = 1
    configure:3857: checking whether the C compiler works
    configure:3879: gcc -march=amdfam10 -O2 -pipe -Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib/crt1.o: In function `_start':
    (.text+0x12): undefined reference to `__libc_csu_fini'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib/crt1.o: In function `_start':
    (.text+0x19): undefined reference to `__libc_csu_init'
    collect2: ld returned 1 exit status
    configure:3883: $? = 1
    configure:3921: result: no
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME "mpg123"
    | #define PACKAGE_TARNAME "mpg123"
    | #define PACKAGE_VERSION "1.12.3"
    | #define PACKAGE_STRING "mpg123 1.12.3"
    | #define PACKAGE_BUGREPORT "[email protected]"
    | #define PACKAGE_URL ""
    | #define PACKAGE "mpg123"
    | #define VERSION "1.12.3"
    | /* end confdefs.h. */
    |
    | int
    | main ()
    | {
    |
    | ;
    | return 0;
    | }
    configure:3926: error: in `/var/abs/local/mpg123/src/mpg123-1.12.3':
    configure:3930: error: C compiler cannot create executables
    See `config.log' for more details.
    ## Cache variables. ##
    ac_cv_build=x86_64-unknown-linux-gnu
    ac_cv_env_CCASFLAGS_set=
    ac_cv_env_CCASFLAGS_value=
    ac_cv_env_CCAS_set=
    ac_cv_env_CCAS_value=
    ac_cv_env_CC_set=
    ac_cv_env_CC_value=
    ac_cv_env_CFLAGS_set=set
    ac_cv_env_CFLAGS_value='-march=amdfam10 -O2 -pipe'
    ac_cv_env_CPPFLAGS_set=
    ac_cv_env_CPPFLAGS_value=
    ac_cv_env_CPP_set=
    ac_cv_env_CPP_value=
    ac_cv_env_ESD_CFLAGS_set=
    ac_cv_env_ESD_CFLAGS_value=
    ac_cv_env_ESD_LIBS_set=
    ac_cv_env_ESD_LIBS_value=
    ac_cv_env_JACK_CFLAGS_set=
    ac_cv_env_JACK_CFLAGS_value=
    ac_cv_env_JACK_LIBS_set=
    ac_cv_env_JACK_LIBS_value=
    ac_cv_env_LDFLAGS_set=set
    ac_cv_env_LDFLAGS_value='-Wl,--hash-style=gnu -Wl,--as-needed'
    ac_cv_env_LIBS_set=
    ac_cv_env_LIBS_value=
    ac_cv_env_PKG_CONFIG_set=
    ac_cv_env_PKG_CONFIG_value=
    ac_cv_env_PULSE_CFLAGS_set=
    ac_cv_env_PULSE_CFLAGS_value=
    ac_cv_env_PULSE_LIBS_set=
    ac_cv_env_PULSE_LIBS_value=
    ac_cv_env_SDL_CFLAGS_set=
    ac_cv_env_SDL_CFLAGS_value=
    ac_cv_env_SDL_LIBS_set=
    ac_cv_env_SDL_LIBS_value=
    ac_cv_env_build_alias_set=
    ac_cv_env_build_alias_value=
    ac_cv_env_host_alias_set=
    ac_cv_env_host_alias_value=
    ac_cv_env_target_alias_set=
    ac_cv_env_target_alias_value=
    ac_cv_host=x86_64-unknown-linux-gnu
    ac_cv_path_install='/bin/install -c'
    ac_cv_path_mkdir=/bin/mkdir
    ac_cv_prog_AWK=gawk
    ac_cv_prog_ac_ct_CC=gcc
    ac_cv_prog_make_make_set=yes
    ## Output variables. ##
    ACLOCAL='${SHELL} /var/abs/local/mpg123/src/mpg123-1.12.3/build/missing --run aclocal-1.11'
    AIX_CFLAGS=''
    AIX_LDFLAGS=''
    AIX_LIBS=''
    ALIB_CFLAGS=''
    ALIB_LDFLAGS=''
    ALIB_LIBS=''
    ALSA_CFLAGS=''
    ALSA_LDFLAGS=''
    ALSA_LIBS=''
    AMDEPBACKSLASH='\'
    AMDEP_FALSE='#'
    AMDEP_TRUE=''
    AMTAR='${SHELL} /var/abs/local/mpg123/src/mpg123-1.12.3/build/missing --run tar'
    API_VERSION='25'
    AR=''
    ARTS_CFLAGS=''
    ARTS_LDFLAGS=''
    ARTS_LIBS=''
    AS=''
    AUTOCONF='${SHELL} /var/abs/local/mpg123/src/mpg123-1.12.3/build/missing --run autoconf'
    AUTOHEADER='${SHELL} /var/abs/local/mpg123/src/mpg123-1.12.3/build/missing --run autoheader'
    AUTOMAKE='${SHELL} /var/abs/local/mpg123/src/mpg123-1.12.3/build/missing --run automake-1.11'
    AWK='gawk'
    CC='gcc'
    CCAS=''
    CCASDEPMODE=''
    CCASFLAGS=''
    CCDEPMODE=''
    CFLAGS='-march=amdfam10 -O2 -pipe'
    COREAUDIO_CFLAGS=''
    COREAUDIO_LDFLAGS=''
    COREAUDIO_LIBS=''
    CPP=''
    CPPFLAGS=''
    CYGPATH_W='echo'
    DECODER_LOBJ=''
    DECODER_OBJ=''
    DEFS=''
    DEPDIR='.deps'
    DLLTOOL=''
    DSYMUTIL=''
    DUMMY_CFLAGS=''
    DUMMY_LDFLAGS=''
    DUMMY_LIBS=''
    DUMPBIN=''
    ECHO_C=''
    ECHO_N='-n'
    ECHO_T=''
    EGREP=''
    ESD_CFLAGS=''
    ESD_LDFLAGS=''
    ESD_LIBS=''
    EXEC_LT_LDFLAGS=''
    EXEEXT=''
    FGREP=''
    GREP=''
    HAVE_AIX_FALSE=''
    HAVE_AIX_TRUE=''
    HAVE_ALIB_FALSE=''
    HAVE_ALIB_TRUE=''
    HAVE_ALSA_FALSE=''
    HAVE_ALSA_TRUE=''
    HAVE_ARTS_FALSE=''
    HAVE_ARTS_TRUE=''
    HAVE_COREAUDIO_FALSE=''
    HAVE_COREAUDIO_TRUE=''
    HAVE_DUMMY_FALSE=''
    HAVE_DUMMY_TRUE=''
    HAVE_ESD_FALSE=''
    HAVE_ESD_TRUE=''
    HAVE_HP_FALSE=''
    HAVE_HP_TRUE=''
    HAVE_JACK_FALSE=''
    HAVE_JACK_TRUE=''
    HAVE_MINT_FALSE=''
    HAVE_MINT_TRUE=''
    HAVE_MODULES_FALSE=''
    HAVE_MODULES_TRUE=''
    HAVE_NAS_FALSE=''
    HAVE_NAS_TRUE=''
    HAVE_OPENAL_FALSE=''
    HAVE_OPENAL_TRUE=''
    HAVE_OS2_FALSE=''
    HAVE_OS2_TRUE=''
    HAVE_OSS_FALSE=''
    HAVE_OSS_TRUE=''
    HAVE_PORTAUDIO_FALSE=''
    HAVE_PORTAUDIO_TRUE=''
    HAVE_PULSE_FALSE=''
    HAVE_PULSE_TRUE=''
    HAVE_SDL_FALSE=''
    HAVE_SDL_TRUE=''
    HAVE_SGI_FALSE=''
    HAVE_SGI_TRUE=''
    HAVE_SNDIO_FALSE=''
    HAVE_SNDIO_TRUE=''
    HAVE_SUN_FALSE=''
    HAVE_SUN_TRUE=''
    HAVE_WIN32_FALSE=''
    HAVE_WIN32_TRUE=''
    HP_CFLAGS=''
    HP_LDFLAGS=''
    HP_LIBS=''
    INCLUDE_STDIO_H=''
    INCLUDE_STDLIB_H=''
    INCLUDE_SYS_TYPE_H=''
    INSTALL_DATA='${INSTALL} -m 644'
    INSTALL_PROGRAM='${INSTALL}'
    INSTALL_SCRIPT='${INSTALL}'
    INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
    JACK_CFLAGS=''
    JACK_LDFLAGS=''
    JACK_LIBS=''
    LD=''
    LDFLAGS='-Wl,--hash-style=gnu -Wl,--as-needed'
    LFS_LOBJ=''
    LIBMPG123_VERSION='25:5:25'
    LIBOBJS=''
    LIBS=''
    LIBTOOL=''
    LIPO=''
    LN_S=''
    LTLIBOBJS=''
    LT_LDFLAGS='-export-dynamic'
    MAKEINFO='${SHELL} /var/abs/local/mpg123/src/mpg123-1.12.3/build/missing --run makeinfo'
    MINT_CFLAGS=''
    MINT_LDFLAGS=''
    MINT_LIBS=''
    MKDIR_P='/bin/mkdir -p'
    MODULE_OBJ=''
    NAS_CFLAGS=''
    NAS_LDFLAGS=''
    NAS_LIBS=''
    NM=''
    NMEDIT=''
    OBJDUMP=''
    OBJEXT=''
    OPENAL_CFLAGS=''
    OPENAL_LDFLAGS=''
    OPENAL_LIBS=''
    OS2_CFLAGS=''
    OS2_LDFLAGS=''
    OS2_LIBS=''
    OSS_CFLAGS=''
    OSS_LDFLAGS=''
    OSS_LIBS=''
    OTOOL64=''
    OTOOL=''
    OUTPUT_CFLAGS=''
    OUTPUT_LDFLAGS=''
    OUTPUT_LIBS=''
    OUTPUT_MOD=''
    OUTPUT_OBJ=''
    PACKAGE='mpg123'
    PACKAGE_BUGREPORT='[email protected]'
    PACKAGE_NAME='mpg123'
    PACKAGE_STRING='mpg123 1.12.3'
    PACKAGE_TARNAME='mpg123'
    PACKAGE_URL=''
    PACKAGE_VERSION='1.12.3'
    PATH_SEPARATOR=':'
    PKG_CONFIG=''
    PORTAUDIO_CFLAGS=''
    PORTAUDIO_LDFLAGS=''
    PORTAUDIO_LIBS=''
    PULSE_CFLAGS=''
    PULSE_LDFLAGS=''
    PULSE_LIBS=''
    RANLIB=''
    SDL_CFLAGS=''
    SDL_LDFLAGS=''
    SDL_LIBS=''
    SED=''
    SET_MAKE=''
    SGI_CFLAGS=''
    SGI_LDFLAGS=''
    SGI_LIBS=''
    SHELL='/bin/sh'
    SNDIO_CFLAGS=''
    SNDIO_LDFLAGS=''
    SNDIO_LIBS=''
    STRIP=''
    SUN_CFLAGS=''
    SUN_LDFLAGS=''
    SUN_LIBS=''
    VERSION='1.12.3'
    WIN32_CFLAGS=''
    WIN32_CODES_FALSE=''
    WIN32_CODES_TRUE=''
    WIN32_LDFLAGS=''
    WIN32_LIBS=''
    ac_ct_CC='gcc'
    ac_ct_DUMPBIN=''
    am__EXEEXT_FALSE=''
    am__EXEEXT_TRUE=''
    am__fastdepCCAS_FALSE=''
    am__fastdepCCAS_TRUE=''
    am__fastdepCC_FALSE=''
    am__fastdepCC_TRUE=''
    am__include='include'
    am__isrc=''
    am__leading_dot='.'
    am__quote=''
    am__tar='${AMTAR} chof - "$$tardir"'
    am__untar='${AMTAR} xf -'
    bindir='${exec_prefix}/bin'
    build='x86_64-unknown-linux-gnu'
    build_alias=''
    build_cpu='x86_64'
    build_os='linux-gnu'
    build_vendor='unknown'
    datadir='${datarootdir}'
    datarootdir='${prefix}/share'
    docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
    dvidir='${docdir}'
    exec_prefix='NONE'
    host='x86_64-unknown-linux-gnu'
    host_alias=''
    host_cpu='x86_64'
    host_os='linux-gnu'
    host_vendor='unknown'
    htmldir='${docdir}'
    includedir='${prefix}/include'
    infodir='${datarootdir}/info'
    install_sh='${SHELL} /var/abs/local/mpg123/src/mpg123-1.12.3/build/install-sh'
    libdir='${exec_prefix}/lib'
    libexecdir='${exec_prefix}/libexec'
    localedir='${datarootdir}/locale'
    localstatedir='${prefix}/var'
    lt_ECHO='echo'
    mandir='${datarootdir}/man'
    mkdir_p='/bin/mkdir -p'
    oldincludedir='/usr/include'
    pdfdir='${docdir}'
    prefix='/usr'
    program_transform_name='s,x,x,'
    psdir='${docdir}'
    sbindir='${exec_prefix}/sbin'
    sharedstatedir='${prefix}/com'
    sysconfdir='${prefix}/etc'
    target_alias=''
    ## confdefs.h. ##
    /* confdefs.h */
    #define PACKAGE_NAME "mpg123"
    #define PACKAGE_TARNAME "mpg123"
    #define PACKAGE_VERSION "1.12.3"
    #define PACKAGE_STRING "mpg123 1.12.3"
    #define PACKAGE_BUGREPORT "[email protected]"
    #define PACKAGE_URL ""
    #define PACKAGE "mpg123"
    #define VERSION "1.12.3"
    configure: exit 77
    the parts i had searched on google are specificaly the
    "/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib/crt1.o: In function `_start':
    (.text+0x12): undefined reference to `__libc_csu_fini'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib/crt1.o: In function `_start':
    (.text+0x19): undefined reference to `__libc_csu_init'"
    does anyone have an idea of what could it be?
    notice that this doesn't bother me because if i use the glibc from the repositories everything works fine, this is just for curiosity of why it doesn't work
    thanks in advance

    slacknatcher wrote:
    the parts i had searched on google are specificaly the
    "/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib/crt1.o: In function `_start':
    (.text+0x12): undefined reference to `__libc_csu_fini'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../lib/crt1.o: In function `_start':
    (.text+0x19): undefined reference to `__libc_csu_init'"
    does anyone have an idea of what could it be?
    notice that this doesn't bother me because if i use the glibc from the repositories everything works fine, this is just for curiosity of why it doesn't work
    thanks in advance
    You have stripped glibc too much.  See the Arch PKGBUILD and make sure your makepkg.conf has STRIP_BINARY etc defined.

  • Exception handling is not working in GCC compile shared object

    Hello,
    I am facing very strange issue on Solaris x86_64 platform with C++ code compiled usging gcc.3.4.3.
    I have compiled shared object that load into web server process space while initialization. Whenever any exception generate in code base, it is not being caught by exception handler. Even though exception handlers are there. Same code is working fine since long time but on Solaris x86, Sparc arch, Linux platform
    With Dbx, I am getting following stack trace.
    Stack trace is
    dbx: internal error: reference through NULL pointer at line 973 in file symbol.cc
    [1] 0x11335(0x1, 0x1, 0x474e5543432b2b00, 0x59cb60, 0xfffffd7fffdff2b0, 0x11335), at 0x11335
    ---- hidden frames, use 'where -h' to see them all ----
    =>[4] __cxa_throw(obj = (nil), tinfo = (nil), dest = (nil), , line 75 in "eh_throw.cc"
    [5] OBWebGate_Authent(r = 0xfffffd7fff3fb300), line 86 in "apache.cpp"
    [6] ap_run_post_config(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x444624
    [7] main(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x42c39a
    I am using following link options.
    Compile option is
    /usr/sfw/bin/g++ -c -I/scratch/ashishas/view_storage/build/coreid1014/palantir/apache22/solaris-x86_64/include -m64 -fPIC -D_REENTRANT -Wall -g -o apache.o apache.cpp
    Link option is
    /usr/sfw/bin/g++ -shared -m64 -o apache.so apache.o -lsocket -lnsl -ldl -lpthread -lthread
    At line 86, we are just throwing simple exception which have catch handlers in place. Also we do have catch(...) handler as well.
    Surpursing things are..same issue didn't observe if we make it as executable.
    Issue only comes if this is shared object loaded on webserver. If this is plain shared object, opened by anyother exe, it works fine.
    Can someone help me out. This is completly blocking issue for us. Using Solaris Sun Studio compiler is no option as of now.

    shared object that load into web server process space
    ... same issue didn't observe if we make it as executable.When you "inject" your shared object into some other process a well-being of your exception handling depends on that other process.
    Mechanics of x64 stack traversing (unwind) performed when you throw the exception is quite complicated,
    particularly involving a "nearly-standartized" Unwind interface (say, Unwind_RaiseException).
    When we are talking about g++ on Solaris there are two implementations of unwind interface, one in libc and one in libgcc_s.so.
    When you g++-compile the executable you get it directly linked with libgcc_s.so and Unwind stuff resolves into libgccs.
    When g++-compiled shared object is loaded into non-g++-compiled executable's process _Unwind calls are most likely already resolved into Solaris libc.
    Thats why you might see the difference.
    Now, what exactly causes this difference can vary, I can only speculate.
    All that would not be a problem if _Unwind interface was completely standartized and properly implemented.
    However there are two issues currently:
    * gcc (libstdc++ in particular) happens to use additional non-standard _Unwind calls which are not present in Solaris libc
    naturally, implementation details of Unwind implementation in libc differs to that of libgccs, so when all the standard _Unwind
    routines are resolved into Solaris version and one non-standard _Unwind routine is resolved into gcc version you get a problem
    (most likely that is what happens with you)
    * libc Unwind sometimes is unable to decipher the code generated by gcc.
    However that is likely to happen with modern gcc (say, 4.4+) and not that likely with 3.4.3
    Btw, you can check your call frame to see where _Unwind calls come from:
    where -h -lIf you indeed stomped on "mixed _Unwind" problem then the only chance for you is to play with linker
    so it binds Unwind stuff from your library directly into libgccs.
    Not tried it myself though.
    regards,
    __Fedor.

  • 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

  • Creating JNI DLL on WinXP using MinGW and GCC

    Ohh man, I spent entire day fighting with "UnsatisfiedLinkError "while trying to cal my native method. After reading all the posts with similar problems, and checking for every little thing that was suggested I figured it out. So I'm reposting the solution here since no one else had suggested this.
    The solution to my problem was that g++/gcc compiler needed an option "-Wl,--add-stdcall-alias". This was the killer. I had the "-shared", but it wouldn't link without the "-Wl,--add-stdcall-alias" option!!!
    As a summary, while its fresh in my mind, here are the trouble shooting steps I used:
    1) Check package names and the generated .h file using javah. I checked and rechecked the names, even created simpler static void method to try and get it to link.
    2) Make sure to use the "jobject" parameter for dynamic methods and "jclass" for static methods in the signature as second argument.
    3) That method name starts with "Java_" and I stress the CAPITAL "J", can not be lowercase. Although if you are using javah, that should not be the problem, since javah can not ommit this kind of detail. The only thing that you need to check for is that if you change method from dynamic to static, and don't rerun the javah, or javah doesn't replace the previous file. So make sure you restart clean and that javah regenerated the file with "jclass" or "jobject" whichever is the case.
    4) Used the "java -verbose:jni" debug flag to see my native method loaded. In my case when it wasn't working I couldn't see the method load, but there were no error messages from "System.loadLibrary" or from the verbose output. Only the UnsatisfiedLinkError. Frustrating. After the fix it loads perfectly:
    [Dynamic-linking native method org.jnetpcap.Pcap.openVoid ... JNI]5) I used "nm" found at "c:/MinGW/bin/nm.exe" to dump the symbol table, and I could see all my methods, with the appropriate named marked as text (T) flag. They were not being loaded when viewed using "java -verbose:jni" though.
    6) I put "extern "C" {}" around all my JNI C++ methods.
    7) Tried a gazilion other gcc options, posted in various messages, none worked.
    8) Finally came accross the "-Wl,--add-stdcall-alias" flag which fixed it.
    Here is a portion of my Makefile for reference:
    $(LINK_TARGET) : $(OBJS)
         g++ \
              -shared \
              -Wl,--add-stdcall-alias \
              -o $@ $^ \
              $(LIBDIRS) $(LIBS)LIBDIR and LIBS point to a single external library dependency.
    My IDE environment is Eclipse 3.2, but I run everything from Makefiles as external programs.
    I wish this was documented somewhere, would have saved me an entire day of troubleshooting.
    Cheers,
    mark...
    Message was edited by:
    voytechs - added CODE tags

    Glad my post helped out at least a few people.
    Believe it or not, I'm in the same boat now on Linux.
    Atleast I know its the name mangling problem again. I
    see a few symbols unmangled with nm, but most are,
    and those are then one's JNI is complaining about
    with UnsatisfiedLinkError.
    So now I'm going through various post related to
    linux and trying to find the same type of flag. The
    "alias" flag doesn't work with RH4 g++ version
    4.0.2.You should not need a flag on Linux. A typical compile for me on my Linux box is:
    gcc -shared -o libjnitest.so -I/usr/java/jdk1.6.0_01/include -I/usr/java/jdk1.6.0_01/include/linux jnitest.c>
    Window builds perfectly fine, but now I'm creating a
    new platform target. Everything compiles and creates
    the shared library, just can't get JNI to be happy.
    BTW, my project: http://jnetpcap.sf.net
    Ah. You have .cpp extensions on your filenames. Are you using gcc or g++ to compile? If you don't use g++, you can get errors such as:
    undefined symbol: __gxx_personality_v0
    Jim S.

  • Error while trying to install NI-VISA driver on SUSE LINUX 11.1(The version of gcc in the path does not match the version of gcc used to compile the currently running kernel.)

    hi i am trying to install NI-VISA driver on SUSE LINUX 11.1.
     the error message it shows is
              ******************************** ERROR ****************************************
    * The version of gcc in the path does not match the version of gcc used to    *
    * compile the currently running kernel.  This can cause unpredictable         *
    * behavior in kernel drivers and should be fixed.                             *
    * gcc version: Linux)                                                          *
    * kernel compiled with: 4.3.2                                                 *
    ******************************** ERROR ****************************************
    my kernel source version is 
       linux-8nes:/home/admin # rpm -qi kernel-source
    Name        : kernel-source                Relocations: /usr/src
    Version     : 2.6.27.29                         Vendor: openSUSE
    Release     : 0.1.1                         Build Date: Sun 16 Aug 2009 03:43:52 PM IST
    Install Date: Sat 24 Oct 2009 02:13:12 AM IST      Build Host: rinck
    Group       : Development/Sources           Source RPM: kernel-source-2.6.27.29-0.1.1.src.rpm
    Size        : 309251954                        License: GPL v2 only
    Signature   : RSA/8, Sun 16 Aug 2009 03:57:25 PM IST, Key ID b88b2fd43dbdc284
    Packager    : http://bugs.opensuse.org
    URL         : http://www.kernel.org/
    Summary     : The Linux Kernel Sources
    Description :
    Linux kernel sources with many fixes and improvements.
    Authors:
        Linus Torvalds <[email protected]>
        see /usr/src/linux/CREDITS for more details.
    Source Timestamp: 2009-08-15 17:53:59 +0200
    GIT Revision: 8a413546901c407e96f7fba18574cceeb40452af
    GIT Branch: SLE11_BRANCH
    Distribution: openSUSE 11.1 
    i had also installed GCC 4.3.2.
    it shows the error message as i had posted.
    please kindly help me on this.
    Thanks and regards,
    P.karthick

    Check this solution

  • Link error, gcc-4.2 failed with exit code 1

    Hi~everyone!
    I now have a question
     that when I want to put my program into iphone(not simulator) to debug, then comes the problem with the debug message below: 
    Ld build/Debug-iphoneos/TouchCells.app/TouchCells normal armv6
    cd "/Users/TouchCells 2"
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.2
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/u sr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk "-L/Users/TouchCells 2/build/Debug-iphoneos" "-F/Users/TouchCells 2/build/Debug-iphoneos" -filelist "/Users/TouchCells 2/build/TouchCells.build/Debug-iphoneos/TouchCells.build/Objects-normal/armv6/T ouchCells.LinkFileList" -dead_strip -miphoneos-version-min=4.2 -framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -lSystem -o "/Users/TouchCells 2/build/Debug-iphoneos/TouchCells.app/TouchCells"
    ld: warning: symbol dyld_stub_binder not found, normally in libSystem.dylib
    Assertion failed: (targetAtom != NULL), function Fixup, file /SourceCache/ld64/ld64-123.3/src/ld/ld.hpp, line 393.
    0  0x13886  __assert_rtn + 86
    1  0x11e67a  ld::passes::stubs::arm::StubHelperAtom::helperHelper(ld::passes::stubs::Pass&) + 874
    2  0x11e76d  ld::passes::stubs::arm::LazyPointerAtom::LazyPointerAtom(ld::passes::stubs::Pas s&, ld::Atom const&, bool, bool, bool, bool) + 189
    3  0x1198e2  ld::passes::stubs::Pass::makeStub(ld::Atom const&, bool) + 4146
    4  0x11a2a5  ld::passes::stubs::Pass::process(ld::Internal&) + 2005
    5  0x11a803  ld::passes::stubs::doPass(Options const&, ld::Internal&) + 131
    6  0x1504d  main + 957
    collect2: ld returned 1 exit status
    Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
    Everything works fine in simulator.
    Any suggestion is appreciated! Thanks a lot!

    I've found the problem that is my system have a incompatible file named libSystem.dylib, so I replace the file with a copy of the correct file from my colleague. That fix my problem.

  • Pacman screwed up my system (gcc related) [solved]

    After doing a system upgrade (pacman -Syu) I can't start most programs due to gcc errors.
    When upgrading was finished I rebooted and tried to start slim but I got the following error: "error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory"
    The same happens with lots of other programs (Firefox, Amarok etc.)
    Even urxvt won't start, it says: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory.
    I have gcc (version 4.2.1-5), lib32-gcc (version 4.2.1-5), gcc-libs (version 4.2.1-2), libstdc++5 (version 3.3.6-2)
    This is the result of: "locate libstdc++"
    /usr/lib/libstdc++.so.5
    /usr/lib/libstdc++.so.5.0.7
    /var/lib/pacman/community/lib32-libstdc++5-3.3.6-1
    /var/lib/pacman/community/lib32-libstdc++5-3.3.6-1/depends
    /var/lib/pacman/community/lib32-libstdc++5-3.3.6-1/desc
    /var/lib/pacman/local/lib32-libstdc++5-3.3.6-1
    /var/lib/pacman/local/lib32-libstdc++5-3.3.6-1/depends
    /var/lib/pacman/local/lib32-libstdc++5-3.3.6-1/desc
    /var/lib/pacman/local/lib32-libstdc++5-3.3.6-1/files
    /var/lib/pacman/extra/libstdc++5-3.3.6-2
    /var/lib/pacman/extra/libstdc++5-3.3.6-2/depends
    /var/lib/pacman/extra/libstdc++5-3.3.6-2/desc
    /opt/lib32/usr/lib/libstdc++.so.6.0.9
    /opt/lib32/usr/lib/libstdc++.so
    /opt/lib32/usr/lib/libstdc++.so.5
    /opt/lib32/usr/lib/libstdc++.so.5.0.7
    /opt/lib32/usr/lib/libstdc++.so.6
    I couldn't find an answer elsewhere (searching with elinks is difficult ).
    How do I solve this?
    Last edited by quarks (2007-10-05 15:32:29)

    lucke wrote:I'd run "pacman -Sf gcc gcc-libs binutils glibc lib32-gcc".
    Ok, now I just feel silly, that worked.
    I tried force upgrading the other packages but not glibc.

  • [solved]gcc broken after pacman update - libcloog-isl.2.so

    Hi,
    After a pacman update my gcc broke. When compiling it gives this error:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/cc1: error while loading shared libraries: libcloog-isl.so.2: cannot open shared object file: No such file or directory
    gcc -v output:
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/lto-wrapper
    Target: x86_64-unknown-linux-gnu
    Configured with: /build/src/gcc-4.6-20111223/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --enable-multilib --disable-libssp --disable-libstdcxx-pch --enable-checking=release --with-fpmath=sse
    Thread model: posix
    gcc version 4.6.2 20111223 (prerelease) (GCC)
    and ls /usr/lib/*cloog* output:
    /usr/lib/libcloog-isl.a  /usr/lib/libcloog-isl.so  /usr/lib/libcloog-isl.so.3  /usr/lib/libcloog-isl.so.3.0.0
    uname -a:
    Linux willem-arch 3.2.4-1-ARCH #1 SMP PREEMPT Sat Feb 4 10:53:01 CET 2012 x86_64 Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz GenuineIntel GNU/Linux
    How can I fix this? I already tried installen cloog with pacman but that doesn't help.
    edit:
    I solved the problem. There was an issue with my pacman.conf. Multilib wasn't properly enabled after the pacman4 transition.
    Last edited by pientertje (2012-02-08 09:47:25)

    I'm using multilib.
    @Allan
    more fully than pacman -Syu? Or is my mirror not up to date?
    edit:
    I solved the problem. There was an issue with my pacman.conf. Multilib wasn't properly enabled after the pacman4 transition.
    Last edited by pientertje (2012-02-08 09:46:40)

  • Opemoffice stops working after upgrade to gcc 3.3

    openoffice no longer starts, most likely because of gcc 3
    can someone rebuild it ?
    /opt/openoffice/program/javaldx: /opt/openoffice/program/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/lib/libstdc++.so.5)
    /opt/openoffice/program/soffice.bin: /opt/openoffice/program/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/lib/libstdc++.so.5)

    We've been trying to.. OpenOffice doesn't like gcc 3.3 in general... I might put some more time into it soon, otherwise we'll have to keep our ears open for fixes.

  • GCC Elite XL 40 - Will Not Print in Snow Leopard

    I am desperate I have wasted two days working with GCC tech support via phone and email and have followed their instructions for setting up my GCC Elite XL 40 as an IP printer for our MacPro running Mac OS 10.6.5. I have checked and double and triple checked the many settings on both the printer and my MacPro - ALL are correct (according to the instructions provided) but the printer will not Print. It is recognized by the computer — got a green light on my print queue — says its ready to print but nothing happens.
    I have redone this so many times I - added, deleted and re-added the printer several times - I am just on the verge of giving up but I need this large format laser printer to work with this computer — it's our workhorse for big projects.
    There was a Posting here from someone named Rocky dated a few months ago and that information conformed to what I have been instructed to do by GCC but it still does not work. All other Macs on our network are printing to the GCC Elite XL 40 just fine as usual. This is the only workstation we upgraded to Snow Leopard plus this computer is hard wired via Ethernet not Airport.
    If there is anyone out there that has made this work please send me some info or direct me to an expert. Thank you.

    Looking at the specifications for this printer it shows that the unit support Postscript Level 2, which indicates it's quite an old model. This could be causing problems with Snow Leopard.
    The specs also show the printer supports PCL5e and PCL6. So did the GCC techs get you to try creating a printer queue using the Generic PCL Laser Printer? If not it would be worth a try. Make a new print queue using IP > LPD for the protocol, not sure if you need a queue name so leave this blank, and select Generic PCL Laser in the Print Using menu. This Generic driver gives you no options and probably no support for the larger paper sizes but it will let you see if you can get a print job from your Mac to the printer.

  • Is this a GCC bug or what?

    Ok, i've written this simple program in C:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    int main(void)
    char *c,*str,C[8];
    unsigned short int D,y;
    time_t h;
    struct tm *t;
    h=time(NULL);
    t=gmtime(&h);
    str=asctime(t);
    sscanf(str,"%*s %*s %hu %s %hu",&D,C,&y);
    c=malloc(31*sizeof(char));
    snprintf(c,30,"%c%c%c, %hu-%c%c%c-%hu %s GMT",str[0],str[1],str[2],D,str[4],str[5],str[6],y,C);
    printf("%s\n%s\n",str,c);
    free(c);
    return 0;
    which uses only standard libc functions.
    I've got a x86_64 Ubuntu 9.10 machine which uses gcc 4.4.1.
    I compile that with -Wall -Wextra -pedantic -pedantic-errors.
    ubuntu-desktop ~ $ uname -a
    Linux ubuntu-desktop 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 x86_64 GNU/Linux
    ubuntu-desktop ~ $ gcc -o tm tm.c -Wall -Wextra -pedantic -pedantic-errors
    ubuntu-desktop ~ $ ./tm
    Sun Jan 3 23:26:13 2010
    Sun, 3-Jan-2010 23:26:13 GMT
    The output is ok.
    Now i compile it on an Archlinux x86 machine.
    server C $ uname -a
    Linux server 2.6.32-ARCH #1 SMP PREEMPT Sat Dec 26 08:26:17 UTC 2009 i686 Intel(R) Pentium(R) 4 CPU 1.60GHz GenuineIntel GNU/Linux
    server C $ gcc -o tm tm.c -Wall -Wextra -pedantic -pedantic-errors
    server C $ ./tm
    Sun Jan 3 23:28:32 2010
    Sun, 3-Jan-2010 23:28:32H
    I can't explain how this could happen except with a kind of mistake in compiling GCC or in a GCC 4.4.2 bug.
    After this, I've tried to compile the source with the Ubuntu GCC with -m32 and link it with the gcc of Archlinux.
    This is the result:
    server C $ ./tm
    Sun Jan 3 23:35:51 2010
    Sun, 3-Jan-2010 23:35:51 GMT
    *** stack smashing detected ***: ./tm terminated
    [bla,bla,bla...read this as the consequence of the different glibc version]
    It works so, there's something wrong with gcc, but my knowledges can't find what.
    Sorry for my English, but i'm Italian.
    Last edited by krnlpk (2010-01-03 23:40:10)

    No gcc bug; it's a bug in your program.  From what I can tell, the char array `C' is designed to hold a string like "01:15:48" which is 8 characters.  Hence, it needs to be declared as `char C[9]' to have room for the terminating \0.  `char C[8]' causes sscanf to smash your stack, as it writes the \0 byte somewhere else.  Making that change fixed the program on my computer.  Too bad valgrind can't detect that sort of error.

  • Workstation 11.1, Tools 9.9.2 build-2496486: Not compatible with GCC 5.1.0 on linux (Arch, Debian, Ubuntu, etc)

    First, there are some compilation problems with the latest linux kernel and Tools 9.9.2's source of vmhgfs: vmhgfs module not compilable for VMware Tools 9.9.0 (Fusion7.1) after Ubuntu Linux kernel update to 3.13.0-46-generic (Febr. 2015) (Shared Folder Feature not working in Ubuntu 14.04 LTS (Guest) on MacOSX Yosemite (Host))?
    In short, you have to patch the source to get it to compile: rasa/vmware-tools-patches · GitHub
    Arch linux is a "rolling" distro, meaning we always have latest - and are usually the first to find problems before it trickles down to Ubuntu, Mint, Debian and other Linux distros. Well, now there is a serious problem that is unresolvable.
    The vmhgfs source is not compatible with linux kernels built with gcc 5.1.0.  It hard locks the VM, requiring a hard reset when the kernel module loads.  It also hard locks during vmware-tools-install.pl torwards the very end when it says, "Guest filesystem driver" enabling.  And on boot, it is vmhgfs that is being loaded when the VM hard locks.
    I was able to get around this earlier when gcc 4.9.2 was in core - i just rebuilt the kernel under 4.9.2: https://bbs.archlinux.org/viewtopic.php?id=196915
    Obviously that isn't a long-term solution.  But now that gcc 5.1.0 has been pushed out to core, that means recompiling the kernel under 4.9.2 is no easy feat since dependencies now depend on gcc 5.1.0.
    @Developers: We have a big problem with VMware Tools vmhgfs and kernels compiled under gcc 5.1.0.  Given it make take years before the Debian distros get the latest and greatest, it's coming.
    Because of this, and the wasted time in me having to support this mess, I may recommend to my company we no longer continue with our Enterprise account of 100 licenses of Workstation and Fusion.  It is obvious in the previous thread vmhgfs module not compilable for VMware Tools 9.9.0 (Fusion7.1) after Ubuntu Linux kernel update to 3.13.0-46-generic (Febr. 2015) (Shared Folder Feature not working in Ubuntu 14.04 LTS (Guest) on MacOSX Yosemite (Host))? that VMware is no hurry to resolve even the simple build errors that the community has resolved last year with patches.  Good thing too, renewal comes up in two months.
    I shiver to think how long it will take VMware to release a fix for gcc 5.1.0.

    Additional info...
    The hard lock is a panic when mounting the /mnt/hgfs partition, which is what is configured in my fstab:
    .host:/
    /mnt/hgfs
    vmhgfs
    defaults
    0 0
    The reason the above is just "./host:/" is for the auto-mounting of shares on the fly, or all shares on boot.  Specifying a share doesn't change anything.
    Even mounting it manually panic's the kernel:
    mount -n -t vmhgfs .host:/<shared_folder> /home/user1/shares
    Again, this all worked fine with a kernel built on 4.9.2, but not 5.1.0.

  • Install gcc 3.2.3 on Solaris 9

    Have installed Sol 2.9 on a SparcStation 4, now trying to get GCC onto it. However, the "make bootstrap" command from the html documentation does not work. It asks for a valid copy of 'cc' which I do not have, which was the reason I am trying to install gcc - and is starting to become a circular argument.
    gcc was downloaded from sunfreeware.com. Their instructions for non-compilation installation of gcc are vague at best.
    Can anyone provide me with the info on whats required to instal this package?
    Thanks, Ian Dennison (HP-UX Certified SysAdmin)

    Set your environment variable CC=gcc or edit the Makefile or config file that would have the line
    for the compiler to use. either cc or gcc.

Maybe you are looking for

  • Re: Issue With Final step re-installing drivers

    I have a hp desk jet 2540 all in one trying to print with my HTC mobile android phone wireless. Set my phone up with wireless print capabilities but will not print. Had my daughter use her hp laptop to try and set it up without results.

  • How to create block in forms6i using database stored procedure

    can anyone tell me how can i can create a database block based on procedure rather table ?

  • Cannot open this file is not movie file

    Having a problem opening files in e mails. Get a response that says this movie cannot be opened this file is not a movie file they are whv files that i am having problems with don't know what a whv file is. THANKS FOR THE HELP <Post Relocated by Host

  • LR2 - Metadata problem and possible workaround

    Hi all, In case others have the same problem in LR2. When I use "Edit In Photoshop" special characters (æøå) in Metadata (both in keywords and in IPTC data) are translated to wrong characters. Similar export from LR1.4.1 works perfect. One possible w

  • How to check hierarchies,attribute ,text

    Bw 3.x system is there any way to check how many hierarchies,attribute,text available in the system in active stat Edited by: nam2000ind on Jun 11, 2008 2:42 PM