X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-0.5 required=5.0	tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_PASS,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <29073093.post@talk.nabble.com>
Date: Sun, 4 Jul 2010 23:13:30 -0700 (PDT)
From: "kenny@ca" <heqing.gugle@gmail.com>
To: cygwin@cygwin.com
Subject: Re: R: Building DLLs on C++ version code failed, but okay on C version code.
In-Reply-To: <769164.44389.qm@web25502.mail.ukl.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
References: <29068199.post@talk.nabble.com> <769164.44389.qm@web25502.mail.ukl.yahoo.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com


thank you all. You all are right. I got the desired dlls. Now I know I was
misleaded by the statement that GCC is a collection of compilers and it
automatically use a compiler according to a programming language.


Marco atzeri-3 wrote:
> 
> --- Dom 4/7/10, kenny@ca  ha scritto:
> 
>> 
>> Hi there,
>> 
>> I wrote a file, hello.c. It has only one function: print a
>> message like
>> "hello!". 
>> ##### hello.c #########
>> #include <stdio.h>
>> void hello() { printf( "Hello.\n" ) ; }
>> 
>> $gcc -c hello.c
>> $gcc -shared -o hello.dll hello.o
>> 
>> I successufully built it as DLL, hello.dll.
>> 
>> Then, I rewrote it in c++.
>> ##### hello.cpp #######
>> #include <iostream>
>> using namespace std ;
>> void hello() {cout << "Hello." << endl ;}
>> 
>> Then, I used the commands above to built DLL, but it
>> failed. Why did it
>> fail?
> 
> wrong compiler ? 
> For C++ you need a C++ compiler
> 
> $g++ -c hello.cpp
> $g++ -shared -o hello.dll hello.o
> 
> Marco
> 
> PS: this is not a cygwin issue, it is a "very" basic one.
> 
> 
>  
> 
> 
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Building-DLLs-on-C%2B%2B-version-code-failed%2C-but-okay-on-C-version-code.-tp29068199p29073093.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

