delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/07/04/07:15:54

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <769164.44389.qm@web25502.mail.ukl.yahoo.com>
Date: Sun, 4 Jul 2010 11:15:43 +0000 (GMT)
From: Marco Atzeri <marco_atzeri AT yahoo DOT it>
Subject: R: Building DLLs on C++ version code failed, but okay on C version code.
To: cygwin AT cygwin DOT com
In-Reply-To: <29068199.post@talk.nabble.com>
MIME-Version: 1.0
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

--- Dom 4/7/10, kenny AT ca  ha scritto:

>=20
> Hi there,
>=20
> I wrote a file, hello.c. It has only one function: print a
> message like
> "hello!".=20
> ##### hello.c #########
> #include <stdio.h>
> void hello() { printf( "Hello.\n" ) ; }
>=20
> $gcc -c hello.c
> $gcc -shared -o hello.dll hello.o
>=20
> I successufully built it as DLL, hello.dll.
>=20
> Then, I rewrote it in c++.
> ##### hello.cpp #######
> #include <iostream>
> using namespace std ;
> void hello() {cout << "Hello." << endl ;}
>=20
> Then, I used the commands above to built DLL, but it
> failed. Why did it
> fail?

wrong compiler ?=20
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.


=20


--
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