Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: "alexeik AT nordlines DOT ru" Subject: Creating a shared library does not work for me. Date: Sat, 26 Feb 2005 19:07:55 +0300 Lines: 52 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: 62.117.127.37 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner-SpamScore: s X-MailScanner-From: goc-cygwin AT m DOT gmane DOT org X-MailScanner-To: cygwin AT cygwin DOT com X-IsSubscribed: yes Hello, Everybody. Maybe I am in wrong group, sorry for this - please point me to correct one. Anyway... I am trying to do an example from Osborne GCC, The Complete Refference about creating a shared library under cygwin. I have: #include void shellofirst(void) { printf("The first\n"); } #include void shellosecond(void) { printf("The second \n"); } //stwohellos.c void shellofirst(void); void shellosecond(void); int main() { shellofirst(); shellosecond(); return(0); } and the shell: gcc -c -fpic -shared shellofirst.c shellosecond.c gcc -shared shellofirst.o shellosecond.o -o hello.so gcc stwohellos.c hello.so -o hello.exe when I run that shell, I have: $ ./xxxx.sh cc1: warning: -fpic ignored for target (all code is position independent) cc1: warning: -fpic ignored for target (all code is position independent) hello.so(.text+0x0):crtstuff.c: multiple definition of `___do_sjlj_init' /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/crtbegin.o(.text+0x0):crtstuff.c: first de fined here collect2: ld returned 1 exit status Interestingly, that if I remove a 'shellosecond.c' -- I have success. What I am doing wrong? With best regards, Alexei Kozlov -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/