From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 720 invoked by alias); 12 Apr 2012 08:44:57 -0000 Received: (qmail 524 invoked by uid 22791); 12 Apr 2012 08:44:50 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_FG,TW_NF X-Spam-Check-By: sourceware.org Received: from mail-bk0-f49.google.com (HELO mail-bk0-f49.google.com) (209.85.214.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Apr 2012 08:44:36 +0000 Received: by bkcjk13 with SMTP id jk13so1811838bkc.36 for ; Thu, 12 Apr 2012 01:44:35 -0700 (PDT) Received: by 10.204.151.217 with SMTP id d25mr463405bkw.89.1334220275166; Thu, 12 Apr 2012 01:44:35 -0700 (PDT) Received: from [192.168.1.5] ([41.225.140.85]) by mx.google.com with ESMTPS id f11sm9448611bkw.6.2012.04.12.01.44.33 (version=SSLv3 cipher=OTHER); Thu, 12 Apr 2012 01:44:34 -0700 (PDT) Message-ID: <4F8695E8.1050509@gmail.com> Date: Thu, 12 Apr 2012 08:44:00 -0000 From: medamine User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org References: <4F859142.9060303@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit 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/msg00011.txt.bz2 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 build 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 ha scritto: > >> Hi every one, >> >> I use >> Hardware: ST STM3210E EVAL board >> Packages: posix >> in the section:POSIX threads >> >> POSIX pthread implementation header Enabled=True Value=0 >> POSIX mutex/cond var implementation header Enabled=True Value=0 >> >> and I got the pthread.h : >> >> #ifndef CYGONCE_ISO_PTHREAD_H >> #define CYGONCE_ISO_PTHREAD_H >> /*=========================================== >> // >> // pthread.h >> // >> // POSIX pthread functions >> // >> //=========================================== >> >> /* CONFIGURATION */ >> >> #include /* 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 = (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=0; t> printf("In main: creating thread %ld\n", t); >> rc = 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=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-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++ but not for C >> hello.c: In function ‘PrintHello’: >> hello.c:10: warning: implicit declaration of function ‘pthread_exit’ >> hello.c: In function ‘main’: >> hello.c:15: error: ‘pthread_t’ undeclared (first use in this function) >> 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 ‘;’ before ‘threads’ >> hello.c:20: warning: implicit declaration of function ‘pthread_create’ >> hello.c:20: error: ‘threads’ undeclared (first use in this function) >> hello.c:23: warning: implicit declaration of function ‘exit’ >> hello.c:23: warning: incompatible implicit declaration of built-in function ‘exit’ >> 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