Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Injected-Via-Gmane: http://gmane.org/ To: cygwin AT cygwin DOT com From: Christian Neise Subject: Create dll using gcc Date: Tue, 02 Sep 2003 12:14:00 +0200 Lines: 65 Message-ID: <1dq8lvg41amn969pckkf1gou2t4b3lh1l3@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Newsreader: Forte Free Agent 1.93/32.576 English (American) Hello, i am trying to build a dll using cygwin and gcc. The dll will be used by a delpi application. The dll works fine. But when allocating memory (e.g.: char *c = new char) the programm crashes. When compiling the dll with visual c++ 6.0 SP5 the dll works fine - even if allocating memory. Any hints? Best regards, Christian Neise P.S.: I createdthe dll the following way: gcc -c dll_test.cpp -o debug/dll_test.o gcc -shared -o debug/dll_test.dll \ -L/usr/lib \ -Wl,--export-all-symbols \ -Wl,--enable-auto-import \ -Wl,--whole-archive debug/dll_test.o \ -L/usr/lib \ -Wl,--no-whole-archive -lc -lstdc++ testdll.h: #include extern "C" { __declspec( dllexport ) BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ); } testdll.cpp: #include "dll_test.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/