Jump to content
  • Advertisement
Sign in to follow this  
Eddycharly

simple DevCpp question

This topic is 5062 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

Hi, i moved from vc to devcpp, and have a little problem to port one of my old projects. The problem is that this project uses a dll with a shared section in it. Under vc, it was as simple as adding a few pragmas to get the shared section working, like this : // variables shared across all instances of the dll #pragma data_seg("SHARED") #pragma comment (linker, "/SECTION:SHARED,RWS") HHOOK HookHandle = 0; int DllLoadCount = 0; char ExecutionPath[257] = ""; #pragma data_seg() Now, these pragmas don't seem to work with devcpp. The devcpp documentation i have is pretty poor. I also tried google, but it looks like i got a lot unrelated answers.. Would be nice if someone could point me in the right direction. Cheers, thanks.

Share this post


Link to post
Share on other sites
Advertisement
Dev-Cpp's documentation isn't so good because it's just an IDE, it uses the MinGW compiler, [google], I don't know much about DLLs, but couldn't you just use extern?

Share this post


Link to post
Share on other sites
i really don't like the gcc docs, quite hard to read.
also the word "shared" seems to apear everywhere in the options, that doesn't help to find a relevant answer..
thanks, i'm going to investigate in the mingw and gnu compilers docs.
i don't think i can use extern here, extern is to share data at compile time between compilation units. what i want is to have a data section shared by all the instances of the loaded dll at run time.

thanks a lot.

Share this post


Link to post
Share on other sites
Ok, i finally found it.
If anyone is interested, here is the devcpp version :

HHOOK __attribute__((section ("SHARED"), shared)) HookHandle = 0;
int __attribute__((section ("SHARED"), shared)) DllLoadCount = 0;
char __attribute__((section ("SHARED"), shared)) ExecutionPath[257] = "";

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!