Connecting Tech Pros Worldwide Help | Site Map

static function in dll

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 28th, 2006, 03:05 PM
Markus Demetz
Guest
 
Posts: n/a
Default static function in dll

Hi,

I'm quite new to C++.

I'm developing under Microsoft Visual Studio, andI've written some
classes and want them to be exported to a .dll. I use a macro DLL_EXPORT
and everything goes well.

But when I try to export a static function, the client, which imports
the function gives a linking error.

class Station {
...

/* database */
DLL_EXPORT void write2db(bool recursive);
DLL_EXPORT virtual void removeFromDb();
static DLL_EXPORT Station* loadFromDb(int id, bool recursive);

...

};

DLL_EXPORT is changed accordingly to __declspec(dllexport) and
__declspec(dllimport).

So my question is:
1. is it possible to export static functions and how?

Thank you for any help,
Markus


  #2  
Old June 28th, 2006, 03:25 PM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: static function in dll

Markus Demetz wrote:[color=blue]
> Hi,
>
> I'm quite new to C++.
>
> I'm developing under Microsoft Visual Studio, andI've written some
> classes and want them to be exported to a .dll. I use a macro DLL_EXPORT
> and everything goes well.
>
> But when I try to export a static function, the client, which imports
> the function gives a linking error.
>
> class Station {
> ...
>
> /* database */
> DLL_EXPORT void write2db(bool recursive);
> DLL_EXPORT virtual void removeFromDb();
> static DLL_EXPORT Station* loadFromDb(int id, bool recursive);
>
> ...
>
> };
>
> DLL_EXPORT is changed accordingly to __declspec(dllexport) and
> __declspec(dllimport).
>
> So my question is:
> 1. is it possible to export static functions and how?
>
> Thank you for any help,
> Markus
>[/color]

Hi, Markus,

Maybe you got this into the wrong group?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
  #3  
Old June 28th, 2006, 03:25 PM
Markus Demetz
Guest
 
Posts: n/a
Default Re: static function in dll

> Hi, Markus,[color=blue]
>
> Maybe you got this into the wrong group?
>[/color]
Sorry, it was the group below.

Markus
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.