X-Recipient: archive-cygwin@delorie.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@yahoo.it>
Subject: R: Building DLLs on C++ version code failed, but okay on C version code.
To: cygwin@cygwin.com
In-Reply-To: <29068199.post@talk.nabble.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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

--- Dom 4/7/10, kenny@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

