Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ridcully

exporting functions in c++ from a dll

This topic is 6768 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i am using run-time linking to import functions from a dll. now if i use GetProcAdress() i can''t just give an argument with the name of the desired function (as it should be) but i must use the depended viewer and copy the exported function name and paste it in vc. it looks something like "?InitDll@@YEKS" instead of plain InitDll then. i think this has got something to do with c++ calling conventions, but i ain''t sure at all. so how do i have to export the function in the dll in to import it with the proper name? thanks ridcully

Share this post


Link to post
Share on other sites
Advertisement
the name is mangled because of c++ compilation
you have to make the functions names complie as c names
do this by:

__declspec(dllexport) extern "C" int Foo(int Bob);

or something like that
its been a while -- i havent written a dll in months

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!