Sign in to follow this  

simple DevCpp question

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

This topic is 4776 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this