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++. #

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

2010-07-04 Thread ke...@ca
c_ostream >&)' hello.o:hello.cpp:(.text+0x126): undefined reference to `std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&))' hello.o:hello.cpp:(.text+0x149): undefined reference to `std::ios_base::Init::Init()' hello.o:hello

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

^M problem in porting unix programs to window

2010-07-08 Thread ke...@ca
Hi, there I am porting a unix project to windows via cygwin. make tool and perl script are used. The perl script file is called in a makefile to create some directories and move some files. All directory names written in the makefile are edited by emacs under linux, as well as the makefile. So I

Re: ^M problem in porting unix programs to window

2010-07-08 Thread ke...@ca
Please never mind. ctrl-M is caught. In fact, it lies in makefile. when the path is transferred to perl, ctrl-M is treated as a part of path name. ke...@ca wrote: > > Hi, there > > I am porting a unix project to windows via cygwin. make tool and perl > script are used. The p

missing pthread.h in building 64-bit aaplications

2010-09-20 Thread ke...@ca
Hello All, Goal: Building 64-bit application on Cygwin OS: 64-bit Windows 7 I used "x86_64-w64-mingw32-gcc " to build the application, but failed. The output tells missing pthread.h. pthread.h is included in one of my source files. I located the file, one in C:\cygwin\usr\include, the other

Re: missing pthread.h in building 64-bit aaplications

2010-09-21 Thread ke...@ca
the macro was commentted, and pthread.h was in. How is your thinking? Another, I added -v and dependency output showed usr\x86_64-w64-mingw32\sys-root\mingw\include was in. So the search path mechanism is not a problem. JonY-6 wrote: > > On 9/21/2010 08:01, ke...@ca wrote: >> &g

x86_64-w64-mingw32-g++ can't find -ldl

2010-10-11 Thread ke...@ca
I'm using x86_64-w64-mingw32 in cygwin as 64-bit compiler to build 64-bit applications. Functions like dlopen(), dlerror(), etc., are used in codes. I got errors when linking *.o to *.dll as follows. echo Linking shared library myxx.dll x86_64-w64-mingw32-g++ -D(omitted) -I(omitted) -minline-al