hi friend,
how to create and use dynamic library in c language?
thank very much.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Nov 7, 2012, 10:41 AM
Go into the Visual Studio command prompt, type notepad mydll.c, enter the following code and save it:
Now type the following at the command prompt to compile this into a .dll (notice that a .lib is created at the same time though we won't need this):
cl /LD mydll.c
Next type notepad myexe.c, enter the following code and save it:
Now, type the following at the command prompt to compile this into an .exe which calls the function in the .dll at runtime:
cl myexe.c
Finally type :
myexe
to run it and you should see the following output:
VulpesPosted Nov 8, 2012, 11:21 AM
If you start VS by clicking on the Start Button and then selecting it from 'All Programs', then there may be an additional 'Visual Studio Command Prompt' option like there is in the current version.
Otherwise, it might be a menu option within VS itself - I just can't remember, I'm afraid :(
Incidentally, you can download the free VC++ 2010 Express edition from the following link if you want a more up to date edition. What I've done above definitely works in this:
http://www.microsoft.com/visualstudio/en-gb/express
Ken HPosted Nov 8, 2012, 6:41 AM
thanks
VulpesPosted Nov 8, 2012, 6:29 AM
It would really be better to do it from the command line first before trying to get it to work in VC++ 6 which is an exercise in itself :)
Ken HPosted Nov 8, 2012, 6:08 AM
I try to follow your code, but i can not achieve, and why?
my project in Annex.