Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: 'PWS0' in module 'pwsclass' clashes with module pwsclass_0


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Mar 13, 2018 10:17 AM Last Post By: Alex Belo
Brian Dumas

Posts: 7
Registered: 10/3/99
'PWS0' in module 'pwsclass' clashes with module pwsclass_0  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2018 8:59 AM
Hello All, Please help.

Windows 7 Pro 32 bit.
Codegear RAD Studio 2007

When I compile a static library I have, I am getting the above message. I've searched the entire code base and the PWS0 is only defined in one CPP file and is in a header files as an extern. There is a pwsclass.cpp in my project, but there is no pwsclass_0 file. Can someone suggest how I can locate why this is happening. I know from running searches that the reason most often given is that the PWS0 is defined in more than one place, but I cannot find it anywhere else.

Another strange thing that might be connected to this:

In the code in the pwsclass.cpp I have this function

void CreateSharedPWS()
{
	char mapname[100];
	unsigned bd;
#ifndef REV507WINH
	// --------------------------------------------------------------------
	// Initialize WS Context
	wscont = NULL;
	if (SMA->Allocate("MAPPED_WSCONTEXT", sizeof(WS_context)))
	{
		WSContextMap = SMA->handle;
		wscont = (WS_context*)SMA->lpvObject;
	}
	if (wscont == NULL)
	{
		KVDMessageDlg("Error creating mapped view of wscont...aborting", mtError, TMsgDlgButtons() << mbOK, 0);
		assert(wscont != NULL);
	}
#endif
	for (int pwsnum = 0; pwsnum < MAX_PWS_BOARDS; pwsnum++)
	{
		sprintf(mapname, "PWSOBJECT[%d]", pwsnum);
		if (SMA->Allocate(mapname, sizeof(TPWS)))
		{
			pwshandle[pwsnum] = SMA->handle;
			PWS[pwsnum] = (TPWS*)SMA->lpvObject;
			if (!SMA->existed) PWS[pwsnum]->INITIALIZED = false;
		}
	}//for pwsnum
	PWS0 = PWS[0];
	PWS1 = PWS[1];
	PWS2 = PWS[2];
	PWS3 = PWS[3];
}


Obviously the code that is between the #ifndef REV507WINH and the #endif does not get compiled because the REV507WINH was not defined. However, if I take out those two lines, or define REV507WINH, the code compiles, but when I step through it in the debugger, the code that should now be compiled appears like it has not been compiled. Meaning, there are no blue debug dots next to it and when I step though it, it steps over that block.

I'm lost.

Thanks for any help and suggestions.

Brian
Alex Belo

Posts: 626
Registered: 10/8/06
Re: 'PWS0' in module 'pwsclass' clashes with module pwsclass_0  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2018 10:17 AM   in response to: Brian Dumas in response to: Brian Dumas
Brian Dumas wrote:

Codegear RAD Studio 2007

When I compile a static library I have, I am getting the above
message. I've searched the entire code base and the PWS0 is only
defined in one CPP file and is in a header files as an extern. There
is a pwsclass.cpp in my project, but there is no pwsclass_0 file. Can
someone suggest how I can locate why this is happening.

Perhaps the same unit (or different version of the unit) somehow
compiles twice in your project?..

However, if I take out those two lines, or define REV507WINH, the
code compiles, but when I step through it in the debugger, the code
that should now be compiled appears like it has not been compiled.

Make sure that you have not 2 copies of the same file opened in IDE
or/and there is no another version of the unit in project.

Also you can try to create new project and add all needed files to make
sure that project file is not corrupted.

--
Alex
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02