| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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 |
| Message-ID: | <001a01c24da3$35aec790$46ca09c0@aniraj> |
| Reply-To: | "Niraj Agarwal" <niraja AT npi DOT stpn DOT soft DOT net> |
| From: | "Niraj Agarwal" <niraja AT npi DOT stpn DOT soft DOT net> |
| To: | "cygwin" <cygwin AT cygwin DOT com> |
| Subject: | DLL Linking Problem |
| Date: | Tue, 27 Aug 2002 13:54:48 +0530 |
| MIME-Version: | 1.0 |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000 |
| X-Virus-Scanned: | by AMaViS perl-11 |
| Note-from-DJ: | This may be spam |
------=_NextPart_000_0018_01C24DD1.4F09EF70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: base64
SGkgQWxsLA0KDQpJIGhhdmUgd3JpdHRlbiBhIHNpbXBsZSBkbGwgdXNpbmcgVkMrKyBjb21waWxl
ciBhbmQgbm93IGkgYW0gdHJ5aW5nIHRvIGxpbmsgdGhlIHNhbWUgdG8gbXkgY29kZSBydW5uaW5n
IGluIGN5Z3dpbiBlbnZpcm9ubWVudC4NCg0KSSBoYXZlIGNyZWF0ZWQgYSBkZWZpbml0aW9uIGZp
bGUgYW5kIHVzaW5nIGRsbHRvb2wgaSBoYXZlIGdlbmVyYXRlZCAuYSBmaWxlLiANCkkgd2FzIGFi
bGUgdG8gY29tcGlsZSBhbmQgbGluayBwcm9ncmFtIHN1Y2Nlc3NmdWxseSBidXQgaSBhbSBmYWNp
bmcgb25lIHByb2JsZW0gd2hlbiBpIGFtIHRyeWluZyB0byBydW4gdGhlIHByb2dyYW0uIGl0IGlz
IHNheWluZyB0aGF0IGVudHJ5IHBvaW50IGZvciB0aGUgZnVudGlvbiBpcyBub3QgZGVmaW5lZCBp
biB0aGUgZGxsLg0KDQpOb3RlIDpUaGUgZGxsIGZpbGUsIGRlZiBmaWxlIGFuZCBzYW1wbGUgcHJv
Z3JhbSB1c2luZyBkbGwgaXMgYWxzbyBhdHRhY2hlZC4NCg0KUGxlYXNlIGhlbHAgbWUgaW4gdGhp
cyByZWdhcmQuDQoNClRoYW5rcyBhbmQgYmVzdCByZWdhcmRzLA0KTmlyYWogQWdhcndhbA0KU2Vu
aW9yIE1lbWJlciBUZWNobmljYWwgU3RhZmYNCk5ldHdvcmsgUHJvZ3JhbXMoSSkgTHRkLg0KTm9p
ZGENCg0KDQoNCg==
------=_NextPart_000_0018_01C24DD1.4F09EF70
Content-Type: application/octet-stream;
name="TestDll.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="TestDll.cpp"
// TestDll.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "TestDll.h"
#include <stdio.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;
}
// This is an example of an exported variable
//TESTDLL_API int nTestDll=0;
// This is an example of an exported function.
TESTDLL_API printVal()
{
printf("Hello World");
//return 42;
}
// This is the constructor of a class that has been exported.
// see TestDll.h for the class definition
CTestDll::CTestDll()
{
return;
}
------=_NextPart_000_0018_01C24DD1.4F09EF70
Content-Type: application/octet-stream;
name="TestDll.h"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="TestDll.h"
// The following ifdef block is the standard way of creating macros =
which make exporting=20
// from a DLL simpler. All files within this DLL are compiled with the =
TESTDLL_EXPORTS
// symbol defined on the command line. this symbol should not be defined =
on any project
// that uses this DLL. This way any other project whose source files =
include this file see=20
// TESTDLL_API functions as being imported from a DLL, wheras this DLL =
sees symbols
// defined with this macro as being exported.
#ifdef TESTDLL_EXPORTS
#define TESTDLL_API __declspec(dllexport)
#else
#define TESTDLL_API __declspec(dllimport)
#endif
// This class is exported from the TestDll.dll
class TESTDLL_API CTestDll {
public:
CTestDll(void);
// TODO: add your methods here.
};
//extern TESTDLL_API int nTestDll;
TESTDLL_API printVal();
------=_NextPart_000_0018_01C24DD1.4F09EF70
Content-Type: application/octet-stream;
name="TestDll.def"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="TestDll.def"
LIBRARY TestDll.dll=0A=
EXPORTS=0A=
printVal=0A=
------=_NextPart_000_0018_01C24DD1.4F09EF70
Content-Type: application/octet-stream;
name="TestMain.c"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="TestMain.c"
extern printVal();=0A=
=0A=
main()=0A=
{=0A=
printVal();=0A=
}=0A=
------=_NextPart_000_0018_01C24DD1.4F09EF70
Content-Type: text/plain; charset=us-ascii
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
------=_NextPart_000_0018_01C24DD1.4F09EF70--
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |