By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

static function in dll

P: n/a
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

Jun 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Markus Demetz wrote:
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


Hi, Markus,

Maybe you got this into the wrong group?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 28 '06 #2

P: n/a
> Hi, Markus,

Maybe you got this into the wrong group?

Sorry, it was the group below.

Markus
Jun 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.