www.digitalmars.com         C & C++   DMDScript  

c++.windows - DLL problem

reply "=?iso-8859-1?Q?Robert_M._M=FCnch?=" <robert.muench robertmuench.de> writes:
Hi, I'm trying to compile some foreign code and get the following error  
messages. What's the problem with dllimport here?

/*
  * Implementation of e4_CommonUniqueID.
  */

e4_CommonUniqueID::e4_CommonUniqueID() :
                                        ^
e4id.cpp(39) : Error: initializer or function body for dllimport not  
allowed

e4_CommonUniqueID::e4_CommonUniqueID() : ID(-1), SP(0) {}

e4_CommonUniqueID::e4_CommonUniqueID(const e4_CommonUniqueID &referrer)
     :
     ^
e4id.cpp(42) : Error: initializer or function body for dllimport not  
allowed

     : ID(referrer.ID),
       SP(referrer.SP)
{
}

e4_CommonUniqueID::e4_CommonUniqueID(int uid, int usp)
     :
     ^
e4id.cpp(48) : Error: initializer or function body for dllimport not  
allowed

     : ID(uid),
       SP(usp)
{
}

e4_CommonUniqueID &
e4_CommonUniqueID::operator=(const e4_CommonUniqueID &referrer)
{
^
e4id.cpp(55) : Error: initializer or function body for dllimport not  
allowed

{
    ID = referrer.ID;
    SP = referrer.SP;

    return *this;
}

e4_CommonUniqueID::~e4_CommonUniqueID() {}
                                         ^
e4id.cpp(62) : Error: initializer or function body for dllimport not  
allowed


-- 
Robert M. Münch
Management & IT Freelancer
http://www.robertmuench.de
Nov 06 2004
parent reply "Walter" <newshound digitalmars.com> writes:
Importing a function means referring to that function in some other DLL.
Therefore, providing a definition of an import (rather than just a
declaration) must be an error.

"Robert M. Münch" <robert.muench robertmuench.de> wrote in message
news:opsg1yp5h5heztw6 news.digitalmars.com...
 Hi, I'm trying to compile some foreign code and get the following error
 messages. What's the problem with dllimport here?

 /*
   * Implementation of e4_CommonUniqueID.
   */

 e4_CommonUniqueID::e4_CommonUniqueID() :
                                         ^
 e4id.cpp(39) : Error: initializer or function body for dllimport not
 allowed

 e4_CommonUniqueID::e4_CommonUniqueID() : ID(-1), SP(0) {}

 e4_CommonUniqueID::e4_CommonUniqueID(const e4_CommonUniqueID &referrer)
      :
      ^
 e4id.cpp(42) : Error: initializer or function body for dllimport not
 allowed

      : ID(referrer.ID),
        SP(referrer.SP)
 {
 }

 e4_CommonUniqueID::e4_CommonUniqueID(int uid, int usp)
      :
      ^
 e4id.cpp(48) : Error: initializer or function body for dllimport not
 allowed

      : ID(uid),
        SP(usp)
 {
 }

 e4_CommonUniqueID &
 e4_CommonUniqueID::operator=(const e4_CommonUniqueID &referrer)
 {
 ^
 e4id.cpp(55) : Error: initializer or function body for dllimport not
 allowed

 {
     ID = referrer.ID;
     SP = referrer.SP;

     return *this;
 }

 e4_CommonUniqueID::~e4_CommonUniqueID() {}
                                          ^
 e4id.cpp(62) : Error: initializer or function body for dllimport not
 allowed


 -- 
 Robert M. Münch
 Management & IT Freelancer
 http://www.robertmuench.de
Nov 07 2004
parent reply "=?iso-8859-1?Q?Robert_M._M=FCnch?=" <robert.muench robertmuench.de> writes:
On Sun, 7 Nov 2004 19:51:48 -0800, Walter <newshound digitalmars.com>  
wrote:

 Importing a function means referring to that function in some other DLL.
 Therefore, providing a definition of an import (rather than just a
 declaration) must be an error.
Ah, I see. Ok, thanks. I was irritated in that there was an implementation but didn't saw the DLL thing... Thanks. BTW: I try to post into the c++.windows group which fails. Is this group no longer existant? -- Robert M. Münch Management & IT Freelancer http://www.robertmuench.de
Nov 09 2004
parent reply "Walter" <newshound digitalmars.com> writes:
"Robert M. Münch" <robert.muench robertmuench.de> wrote in message
news:opsg7e7hmrheztw6 news.digitalmars.com...
 BTW: I try to post into the c++.windows group which fails. Is this group
 no longer existant?
You're posting in it now!
Nov 10 2004
parent "=?iso-8859-1?Q?Robert_M._M=FCnch?=" <robert.muench robertmuench.de> writes:
On Wed, 10 Nov 2004 17:25:09 -0800, Walter <newshound digitalmars.com>  
wrote:

 BTW: I try to post into the c++.windows group which fails. Is this group
 no longer existant?
You're posting in it now!
Oh, yeah. I meant c++.command-line Sorry. Robert
Nov 11 2004