delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/07/05/02:13:42

X-Recipient: archive-cygwin AT delorie DOT 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 AT ca" <heqing DOT gugle AT gmail DOT com>
To: cygwin AT cygwin DOT 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
References: <29068199 DOT post AT talk DOT nabble DOT com> <769164 DOT 44389 DOT qm AT web25502 DOT mail DOT ukl DOT yahoo DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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 AT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019