From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23745 invoked by alias); 13 Apr 2012 16:45:41 -0000 Received: (qmail 23667 invoked by uid 22791); 13 Apr 2012 16:45:38 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,LIBERO,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_FG,TW_NF X-Spam-Check-By: sourceware.org Received: from mail-we0-f177.google.com (HELO mail-we0-f177.google.com) (74.125.82.177) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Apr 2012 16:45:21 +0000 Received: by werp11 with SMTP id p11so2500392wer.36 for ; Fri, 13 Apr 2012 09:45:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.104.230 with SMTP id gh6mr5426719wib.22.1334335519142; Fri, 13 Apr 2012 09:45:19 -0700 (PDT) Received: by 10.223.71.1 with HTTP; Fri, 13 Apr 2012 09:45:19 -0700 (PDT) In-Reply-To: <4F8695E8.1050509@gmail.com> References: <4F859142.9060303@gmail.com> <4F8695E8.1050509@gmail.com> Date: Fri, 13 Apr 2012 16:45:00 -0000 Message-ID: From: Fabrizio Carrai To: medamine Cc: ecos-discuss@ecos.sourceware.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] POSIX layer and pthread:Unable to make the application X-SW-Source: 2012-04/txt/msg00013.txt.bz2 Please check the value of the "POSIX pthread implementation header" (Macro name is CYGBLD_ISO_PTHREAD_IMPL_HEADER). The value should be If so, something went bad in the building: **delete** the target _install and _build directory and start a build from scratch. Ciao Fabrizio Il 12 aprile 2012 10:44, medamine ha scritto: > On 04/11/2012 07:38 PM, Fabrizio Carrai wrote: > > Hi, > > The problem is that I dont have the header in my > install tree also the header > and I don't know why the confgtool did not generate these file when I bui= ld > the library, Is it a problem of version of the configtool or what?? > >> Hi, >> also this seems a problem on the eCos library configuration generated >> with the configtool. >> I used the configuration I suggested in a previous post (and that you >> adopted!) and I'm able to compile your example. Some warnings, but no >> errors. >> >> The inclusion tree is the following: >> "pthread.h" >> "pkgconf/isoinfra.h" >> "cyg/posix/pthread.h" >> >> The latter include the declarations that you miss. Please, check it. >> Your "standard_Posix" configuration should be good. >> >> Fabrizio >> >> Il giorno 11 aprile 2012 16:12, medamine =A0ha >> scritto: >> >>> Hi every one, >>> >>> I use >>> Hardware: ST STM3210E EVAL board >>> Packages: posix >>> in the section:POSIX threads >>> >>> POSIX pthread implementation header Enabled=3DTrue Value=3D0 >>> POSIX mutex/cond var implementation header Enabled=3DTrue Value=3D0 >>> >>> and I got the pthread.h : >>> >>> #ifndef CYGONCE_ISO_PTHREAD_H >>> #define CYGONCE_ISO_PTHREAD_H >>> /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> // >>> // pthread.h >>> // >>> // POSIX pthread functions >>> // >>> //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> >>> /* CONFIGURATION */ >>> >>> #include =A0/* Configuration header */ >>> >>> /* INCLUDES */ >>> >>> #ifdef CYGINT_ISO_PTHREAD_IMPL >>> # ifdef CYGBLD_ISO_PTHREAD_IMPL_HEADER >>> # include CYGBLD_ISO_PTHREAD_IMPL_HEADER >>> # endif >>> #endif >>> >>> #ifdef CYGINT_ISO_PTHREAD_MUTEX >>> # ifdef CYGBLD_ISO_PTHREAD_MUTEX_HEADER >>> # include CYGBLD_ISO_PTHREAD_MUTEX_HEADER >>> # endif >>> #endif >>> >>> #endif /* CYGONCE_ISO_PTHREAD_H multiple inclusion protection */ >>> >>> /* EOF pthread.h */ >>> >>> After that, i wrote this application using thread >>> >>> #include >>> #include >>> #define NUM_THREADS 5 >>> >>> void *PrintHello(void *threadid) >>> { >>> long tid; >>> tid =3D (long)threadid; >>> printf("Hello World! It's me, thread #%ld!\n", tid); >>> pthread_exit(NULL); >>> } >>> >>> int main (int argc, char *argv[]) >>> { >>> pthread_t threads[NUM_THREADS]; >>> int rc; >>> long t; >>> for(t=3D0; t>> printf("In main: creating thread %ld\n", t); >>> rc =3D pthread_create(&threads[t], NULL, PrintHello, (void *)t); >>> if (rc){ >>> printf("ERROR; return code from pthread_create() is %d\n", rc); >>> exit(-1); >>> } >>> } >>> >>> /* Last thing that main() should do */ >>> pthread_exit(NULL); >>> } >>> >>> but when i build the application withe eCos library, i got these errors >>> >>> /STM3240G/fork$ make hello >>> arm-eabi-gcc -c -o hello.o >>> -I/home/st/config/standard_Posix_install/include -Wall -Wpointer-arith >>> -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings >>> -mcpu=3Dcortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -f= no-rtti >>> -fno-exceptions hello.c >>> cc1: warning: command line option "-Woverloaded-virtual" is valid for >>> C++/ObjC++ but not for C >>> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ b= ut >>> not for C >>> hello.c: In function =91PrintHello=92: >>> hello.c:10: warning: implicit declaration of function =91pthread_exit=92 >>> hello.c: In function =91main=92: >>> hello.c:15: error: =91pthread_t=92 undeclared (first use in this functi= on) >>> hello.c:15: error: (Each undeclared identifier is reported only once >>> hello.c:15: error: for each function it appears in.) >>> hello.c:15: error: expected =91;=92 before =91threads=92 >>> hello.c:20: warning: implicit declaration of function =91pthread_create= =92 >>> hello.c:20: error: =91threads=92 undeclared (first use in this function) >>> hello.c:23: warning: implicit declaration of function =91exit=92 >>> hello.c:23: warning: incompatible implicit declaration of built-in >>> function =91exit=92 >>> make: *** [hello.o] Error 1 >>> >>> First view is that the thread functions doesn't exist in the header >>> thread.h, the configtool generate uncompleted headers, >>> >>> Please i need your help. >>> >>> Thanks a lot. >>> >>> >>> >>> -- >>> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos >>> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss >>> > > > -- > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss