| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"Allen" |
| Date: |
01 Feb 2007 08:20:12 PM |
| Object: |
Question about shared library (DLL) export & import |
I write 3 classes:
class CRPCParaPacker
{
private:
CRPCInParaPacker inPack;
CRPCOutParaPacker outPack;
};
I want to export only CRPCParaPacker class. So in the header file of
CRPCParaPacker, I use
#ifdef WIN32
#ifdef RPCPACKER_EXPORTS
#define RPCPACKER_API __declspec(dllexport)
#else
#define RPCPACKER_API __declspec(dllimport)
#endif
#ifndef RPCPACKER_EXPORTS
#pragma comment(lib, "RPCPacker.lib")
#pragma message("Automatically linking with RPCPacker.dll")
#endif
#pragma warning(disable : 4251)
#endif
class CRPCInParaPacker;
class CRPCOutParaPacker;
class RPCPACKER_EXPORTS CRPCParaPacker
{
private:
CRPCInParaPacker inPack;
CRPCOutParaPacker outPack;
};
Class CRPCInParaPacker and CRPCOutParaPacker are not exported.
When compile above classes into DLL, it is ok.
But when used in other application, it is compiled with errors:
rpcparapacker.h(190) : error C2079: "CRPCParaPacker::inPacker" uses
undefined class"CRPCInParaPacker"
rpcparapacker.h(190) : error C2079: "CRPCParaPacker::outPacker" uses
undefined class"CRPCOutParaPacker"
Why?
.
|
|
| User: "Ian Collins" |
|
| Title: Re: Question about shared library (DLL) export & import |
01 Feb 2007 08:23:55 PM |
|
|
Allen wrote:
I write 3 classes:
class CRPCParaPacker
{
private:
CRPCInParaPacker inPack;
CRPCOutParaPacker outPack;
};
I want to export only CRPCParaPacker class. So in the header file of
CRPCParaPacker, I use
#ifdef WIN32
You've come to the wrong place, try a windows group.
--
Ian Collins.
.
|
|
|
|

|
Related Articles |
|
|