This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building DLLs on C++ version code failed, but okay on C version code.


On 2010-07-04 10:24Z, kenny@ca wrote:
> 
> $gcc -c hello.c
> $gcc -shared -o hello.dll hello.o
> 
> I successufully built it as DLL, hello.dll.

Here, the C runtime library is automatically linked.

> Then, I rewrote it in c++.
[...]
> Then, I used the commands above to built DLL, but it failed. Why did it
> fail?

Use 'g++' instead of 'gcc' for C++:

g++ -c hello.cpp
g++ -shared -o hello.dll hello.o

Then the C++ standard library is automatically linked.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]