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

2010-07-06 Thread Larry Hall (Cygwin)
On 7/5/2010 2:13 AM, ke...@ca wrote: 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. It does this for the frontend, not the backen

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

2010-07-04 Thread ke...@ca
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, ke...@ca ha scritto: > >> >> Hi there

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

2010-07-04 Thread Marco Atzeri
--- Dom 4/7/10, ke...@ca ha scritto: > > Hi there, > > I wrote a file, hello.c. It has only one function: print a > message like > "hello!". > # hello.c # > #include > void hello() { printf( "Hello.\n" ) ; } > > $gcc -c hello.c > $gcc -shared -o hello.dll hello.o > > I successuf

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

2010-07-04 Thread Greg Chicares
On 2010-07-04 10:24Z, ke...@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. Wh

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

2010-07-04 Thread Bengt-Arne Fjellner
On 2010-07-04 12:27 PM, ke...@ca wrote: Forgot to attach error information. hello.o:hello.cpp:(.text+0xd): undefined reference to `std::basic_string, std::allocator ::size() const' hello.o:hello.cpp:(.text+0x60): undefined reference to `std::basic_string, std::allocator ::operat

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

2010-07-04 Thread ke...@ca
Forgot to attach error information. hello.o:hello.cpp:(.text+0xd): undefined reference to `std::basic_string, std::allocator >::size() const' hello.o:hello.cpp:(.text+0x60): undefined reference to `std::basic_string, std::allocator >::operator[](unsigned int) const' hello.o:hello.cpp:(.text+0x9f)

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

2010-07-04 Thread ke...@ca
Hi there, I wrote a file, hello.c. It has only one function: print a message like "hello!". # hello.c # #include 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++. #