How to import a function from a library?

Z

zqhpnp

I build the following code,and generate a library,who can tell me how
to import the function fn() in my applications,thank you very much!

#ifdef _BUILD_DLL
#define DLLFUNCTION __declspec(dllexport)
#else
#define DLLFUNCTION __declspec(dllimport)
#endif
#include<iostream.h>
DLLFUNCTION void fn()
{
cout<<"GTK\n";
}
 
M

Martin Ambuhl

I build the following code,and generate a library,who can tell me how
to import the function fn() in my applications,thank you very much!

There are several reasons that you will not get a useful answer here.

1. Your code is C++, a different language from C, which is the topic of
< You might ask C++ questions in (surprise!)
< However,

2. Your question is not about C++ either, but about a particular
platform's idiosyncratic dynamic libraries. Since neither C not C++
have any specifications for how that platform should implement libraries
and, indeed, the definition of neither language has even a whisper about
DLLs, you need to take your question to a newsgroup for your particular
platform. No apparently constructive answer given here should be
trusted. You need experts for your platform. I would guess you are
using Microsoft's virus-with-a-mouse and, luckily Microsoft has a number
of active newsgroups with people waiting to answer your question.

3. When you do post a C++ question to <or a Windows
question to one of the MS newsgroups, be sure to follow a week or so
worth of postings to that newsgroup first. This can be done in a short
period by using <http://groups.google.com> and will save you
misunderstandings later. Also, before posting C++ questions, learn the
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,458
Latest member
Chris#

Latest Threads

Top