delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/22/11:08:00

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Patrick Rotsaert <patrick DOT rotsaert AT tts-online DOT be>
Subject: How to make DLLs in cygwin for MSVC and BCB
Date: Wed, 22 Jun 2005 17:00:08 +0200
Lines: 40
Message-ID: <d9bu24$aa1$1@sea.gmane.org>
Mime-Version: 1.0
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-IsSubscribed: yes

Hi all,

I need to build a DLL in cygwin (I use a lot of POSIX functions), that I 
can use in MSVC and Borland CBuilder apps.

There are a lot of docs on the web, but most of them seem to be 
outdated. Anyway, none of the methods I found seam to work.

The DLL will have to be loaded dynamically, i.e. using the win api func. 
LoadLibrary, so I do not need an import library.

What commands do I need to issue to build the dll correctly?

Here's some test code I use:

/* test.c */
#include <windows.h>
__declspec(dllexport) int __stdcall testfunc(char *a, char *b);

BOOL APIENTRY DllMain(HANDLE hModule, DWORD reason, LPVOID lpReserved)
{
	switch (reason) {
	case DLL_PROCESS_ATTACH:
		break;
	case DLL_THREAD_ATTACH:
		break;
	case DLL_THREAD_DETACH:
		break;
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}

int __stdcall testfunc(char *a, char *b)
{
	strcpy(a, b);
	return 0;
}



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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019