Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Nonshared DATA segment required



Permlink Replies: 14 - Last Post: Jun 23, 2014 9:42 AM Last Post By: alfonso classico
Mats karlsson

Posts: 64
Registered: 11/8/99
Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 25, 2012 1:02 PM
Hi,
I have problem debugging an application that links to some libraries.

When turning on CodeGuard, the first things that happens is a popup
popping up saying

Nonshared DATA segment required

After clicking OK, the debugger faults and I can't get any further.
Any ideas what is going on?

-totte
Mats karlsson

Posts: 64
Registered: 11/8/99
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 25, 2012 1:22 PM   in response to: Mats karlsson in response to: Mats karlsson
Found out that creating an empty console project, and enabling
codeguard causes this.

I am running on Win8 preview and perhaps that is the problem?

-totte

On 6/25/2012 1:02 PM, totte karlsson wrote:
Hi,
I have problem debugging an application that links to some libraries.

When turning on CodeGuard, the first things that happens is a popup
popping up saying

Nonshared DATA segment required

After clicking OK, the debugger faults and I can't get any further.
Any ideas what is going on?

-totte
taskit taskit

Posts: 3
Registered: 3/21/08
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 22, 2012 9:53 AM   in response to: Mats karlsson in response to: Mats karlsson
Same for me with an empty project and the release version of Windows 8.
Any solution?
totte karlsson wrote:
Found out that creating an empty console project, and enabling
codeguard causes this.

I am running on Win8 preview and perhaps that is the problem?

-totte

On 6/25/2012 1:02 PM, totte karlsson wrote:
Hi,
I have problem debugging an application that links to some libraries.

When turning on CodeGuard, the first things that happens is a popup
popping up saying

Nonshared DATA segment required

After clicking OK, the debugger faults and I can't get any further.
Any ideas what is going on?

-totte
Tamás Bencze

Posts: 4
Registered: 1/14/01
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 24, 2012 3:42 AM   in response to: Mats karlsson in response to: Mats karlsson
Hi! I have the same problem with Win8 x64 Preview.
Without codeguard!
Also I checked that my project doesn't depend on cg32.dll. (Dependeny Walker)
I did a release build also. Same problem.

It's terrible having unable to run my on win 8 that runs on windows 7 well.

I checked the tdump dump, and there is a segment .rdata and .reloc that got SHARED flags.
Tried to change them without any success.
IDE is so "high level", that it is close to impossible to set simple linker flags, like /GS what needs here, I think.

I have no idea of the solution.
Tamás Bencze

Posts: 4
Registered: 1/14/01
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 24, 2012 8:58 AM   in response to: Tamás Bencze in response to: Tamás Bencze
I found a runtime code that can be the origin of the message.
In the runtime source c0nt.asm contains the message "NONSHARED data segement required.
The message comes up after some version checking, probably durnig dll attching to a process.
I'm no way an asm expert, so have no clue what to do with this.
I hope you can find out something!

...
...
call GetVersion
mov edx, offset nonsharedMsg <==== Here!
and eax, 080000000h
jz msgSet
mov edx, offset win32sMsg
msgSet:
push edx
call __ErrorMessage
...
...
richard rotheroe

Posts: 9
Registered: 4/5/99
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 24, 2012 1:09 PM   in response to: Tamás Bencze in response to: Tamás Bencze
On Sat, 24 Nov 2012 03:42:33 -0800, Tamás Bencze <> wrote:

Hi! I have the same problem with Win8 x64 Preview.
Without codeguard!
Also I checked that my project doesn't depend on cg32.dll. (Dependeny Walker)
I did a release build also. Same problem.

It's terrible having unable to run my on win 8 that runs on windows 7 well.

I checked the tdump dump, and there is a segment .rdata and .reloc that got SHARED flags.
Tried to change them without any success.
IDE is so "high level", that it is close to impossible to set simple linker flags, like /GS what needs here, I think.

I have no idea of the solution.

I started getting this error when I enabled CodeGuard for my C++Builder XE3 project on
Windows 8 Pro 64 bit. It stopped when I disabled it.

I am keen to hear any fixes.

Regards
Richard
Tamás Bencze

Posts: 4
Registered: 1/14/01
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 24, 2012 1:39 PM   in response to: richard rotheroe in response to: richard rotheroe
Do you have debugging enabled, and only codeguard disabled?

I will check it again, but as I said I don't have CG enabled, and I checked with deleting cg32.dll also. Strange.
For me it is with C++ Builder XE.

Thanks
richard rotheroe

Posts: 9
Registered: 4/5/99
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 24, 2012 2:21 PM   in response to: Tamás Bencze in response to: Tamás Bencze
On Sat, 24 Nov 2012 13:39:40 -0800, Tamás Bencze <> wrote:

Do you have debugging enabled, and only codeguard disabled?

I will check it again, but as I said I don't have CG enabled, and I checked with deleting cg32.dll also. Strange.
For me it is with C++ Builder XE.

Thanks

I have debug information true, and debug line number information true.
All others are false.

Regards
Richard
Mark Jacobs


Posts: 21
Registered: 11/21/03
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 4, 2012 3:21 AM   in response to: richard rotheroe in response to: richard rotheroe
This practically forces you to upgrade to XE3! Bad show Embarcadero!
--
_
Mark Jacobs

"richard rotheroe" <richard dot rotheroe at ntlworld dot com> wrote in message news:525036 at forums dot embarcadero dot com...
On Sat, 24 Nov 2012 13:39:40 -0800, Tamás Bencze <> wrote:

Do you have debugging enabled, and only codeguard disabled?

I will check it again, but as I said I don't have CG enabled, and I checked with deleting cg32.dll also. Strange.
For me it is with C++ Builder XE.

Thanks

I have debug information true, and debug line number information true.
All others are false.

Regards
Richard
taskit taskit

Posts: 3
Registered: 3/21/08
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2012 1:21 AM   in response to: Mark Jacobs in response to: Mark Jacobs
No!!! you dont need to upgrade.
I am using C++ Builder XE3 with Windows 8 Pro X64 and I have the same problem.
I think its a general incompatibility with windows 8.
I would advise you to NOT UPGRADE UNTIL this bug is FIXED.
Mark Jacobs wrote:
This practically forces you to upgrade to XE3! Bad show Embarcadero!
--
_
Mark Jacobs

"richard rotheroe" <richard dot rotheroe at ntlworld dot com> wrote in message news:525036 at forums dot embarcadero dot com...
On Sat, 24 Nov 2012 13:39:40 -0800, Tamás Bencze <> wrote:

Do you have debugging enabled, and only codeguard disabled?

I will check it again, but as I said I don't have CG enabled, and I checked with deleting cg32.dll also. Strange.
For me it is with C++ Builder XE.

Thanks

I have debug information true, and debug line number information true.
All others are false.

Regards
Richard
taskit taskit

Posts: 3
Registered: 3/21/08
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2012 1:43 AM   in response to: Mats karlsson in response to: Mats karlsson
I also have the problem with codeguard on Windows 8 Pro X64 together with the Rad Studio 2007.
I created a new VCL project in the C++ Builder, enabled codeguard and then ... guess.... "NON SHARED DATA SEGMENT REQUIRED"
For me that means: codeguard is not windows 8 compatible.
Hopefully this is only a bug and that they dont remove codeguard in future versions.
totte karlsson wrote:
Hi,
I have problem debugging an application that links to some libraries.

When turning on CodeGuard, the first things that happens is a popup
popping up saying

Nonshared DATA segment required

After clicking OK, the debugger faults and I can't get any further.
Any ideas what is going on?

-totte
Alex Belo

Posts: 626
Registered: 10/8/06
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2012 2:51 AM   in response to: taskit taskit in response to: taskit taskit
taskit taskit wrote:

Hopefully this is only a bug and that they dont remove
codeguard in future versions.

CodeGuard is removed from 64 bit XE3 version. I don't know for sure if
some other debug tool is added instead of CG.

--
Alex
Tamás Bencze

Posts: 4
Registered: 1/14/01
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 20, 2012 12:42 AM   in response to: taskit taskit in response to: taskit taskit
Finally I got a solution for my case!

For me CG was not an issue as I described above already.

A have a lot of old code and some of them had the pragma -dc, and it puts const string literals to specific data segment.
It seems that those segment are shared.

After all, disabling -dc compiler flag lets it run on windows 8.
So besides CG incompatibility the compiler flag -dc kills windows 8 deployment as well.

Good to know!

Regards,
Tamas
Jan Mertens

Posts: 1
Registered: 7/10/00
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2014 3:17 PM   in response to: Mats karlsson in response to: Mats karlsson
totte karlsson wrote:
Hi,
I have problem debugging an application that links to some libraries.

When turning on CodeGuard, the first things that happens is a popup
popping up saying

Nonshared DATA segment required

After clicking OK, the debugger faults and I can't get any further.
Any ideas what is going on?

-totte

I had it also with XE2 in windows 8 (windows 7 == ok) and got rid of it with:
Project/Options/Packages/Runtime packages/Link with runtime packages: all targets (configurations) on false
AND
Project/Options/C++ Linker/Link with Dynamic RTL/: all targets on false
Delphy runtime library: on

Jan
alfonso classico

Posts: 1
Registered: 7/23/14
Re: Nonshared DATA segment required
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 23, 2014 9:42 AM   in response to: Mats karlsson in response to: Mats karlsson
Got that same error when trying to rebuild an old project (BCB5 / 2003) that was running perfectly on Windows xp and 7.
To solve the issue I did set : Project Options/ Compiler/ Pre-compiled headers to "none".
Everything works fine after.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02