News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Symbol redefinition?

Started by HSE, August 07, 2022, 02:43:55 AM

Previous topic - Next topic

HSE

Hi Biterider!

I'm trying to build a 2 years ago project (32 bits, other machine) and I have strange errors of this kind:
\Objasm-C.1\Code\Inc\Windows\\winapifamily.inc(29) : Error A2143: Symbol redefinition: WINAPI_PARTITION_DESKTOP

Code (winapifamily.inc) Select
28:  ifndef WINAPI_PARTITION_DESKTOP
29:    WINAPI_PARTITION_DESKTOP equ (WINAPI_FAMILY eq WINAPI_FAMILY_DESKTOP_APP)
30:  endif


How is posible a redefinition? Any idea?

Thanks in advance, HSE
Equations in Assembly: SmplMath

Biterider

Hi HSE
"WINAPI_PARTITION_DESKTOP" is one of the symbols defined by MS to group the header files to reduce the load on the compiler and speed up the compilation process. This grouping also exists in the "include" files.
A redefinition can occur when the WINAPI_PARTITION_DESKTOP declaration is included more than once. For that reason I would look into the includes and try to figure out where it is being redefined.

Is this happening on any of the OA projects?  :rolleyes:

Biterider


HSE

Biterider,

Quote from: Biterider on August 07, 2022, 03:16:10 AM
A redefinition can occur when the WINAPI_PARTITION_DESKTOP declaration is included more than once.

Even inside ifndef ... endif?

Quote from: Biterider on August 07, 2022, 03:16:10 AM
Is this happening on any of the OA projects?  :rolleyes:

No. OA package projects and my last year projects don't have any problem.

Thanks, HSE
Equations in Assembly: SmplMath

HSE

This are settings of project. Obviously there was som chnge because at that time apparently WinHelpers.inc was not in defaults.

% include @Environ(OBJASM_PATH)\Code\Macros\Model.inc
SysSetup OOP, WIN32, ANSI_STRING, DEBUG(WND)

% includelib &LibPath&Windows\shell32.lib
% includelib &LibPath&Windows\shlwapi.lib
% includelib &LibPath&Windows\comdlg32.lib
% includelib &LibPath&windows\Comctl32.lib

% include &MacPath&Exception32.inc

;% include &MacPath&WinHelpers.inc           commented in August 2022
% include &IncPath&Windows\CommCtrl.inc
% include &IncPath&Windows\Richedit.inc
Equations in Assembly: SmplMath

Biterider

Hi HSE
To be sure, I've attached an .asm file with the includes you specified, which assembles correctly on my system.
Please check if this is the case on your computer.

Biterider

HSE

Equations in Assembly: SmplMath

Biterider

Hi HSE
If this works, then I think you maybe are including some file elsewhere in the source without realizing it.

Biterider

HSE

Biterider,

Quote from: Biterider on August 07, 2022, 04:32:17 AM
If this works, then I think you maybe are including some file elsewhere in the source without realizing it.

Yes, somewhere there is something  :biggrin:

Thanks, HSE

Equations in Assembly: SmplMath

HSE

Hi Biterider!

I found a duplicated inclusion of same object  :biggrin:

Very curious there is not check of that. Could be interesting for next time I make the same  :biggrin:

Must not be ofensive, of course:% ifdef ??ObjExpr
%     .err 100001 Take a better beer, ??ObjExpr is already declared
  endif 

  ??ObjName textequ ??ObjExpr     ;;Global symbol used in all comming defs


For sure there was something else because I can't reproduce includes error messages   :rolleyes:

Thanks, HSE
Equations in Assembly: SmplMath

Biterider

Hi HSE
Some time ago I implemented a mechanism to prevent further compilation on some common errors.
I extended it to support multiple inclusions in the attached experimental code.
This way, unnecessary error messages are avoided!
I haven't checked all path possibilities, so if you have some time, please try it.  :biggrin:

While testing the new code I noticed that some things are broken in UASM. For example, the .err directive no longer works. The @Line symbol doesn't seem to be there either.  :sad:

Biterider

HSE

Hi Biterider

Quote from: Biterider on August 09, 2022, 03:13:39 AM
I haven't checked all path possibilities, so if you have some time, please try it.  :biggrin:

Don' worry. With time, I will make all possible errors :biggrin:

Quote from: Biterider on August 09, 2022, 03:13:39 AM
While testing the new code I noticed that some things are broken in UASM. For example, the .err directive no longer works.

For 32 bits I use modified versions of JWAsm15, Asmc28 or UAsm46 with long lines. JWAsm is from last version, others are older versions.

In that versions ".err" work well in main file. With includes and macros usually lost track. Nidud impoved that.

Quote from: Biterider on August 09, 2022, 03:13:39 AM
The @Line symbol doesn't seem to be there either.  :sad:

That never worked in JWasm family. I think I asked Nidud but answer for sure is gone  :biggrin:

HSE
Equations in Assembly: SmplMath

Biterider

Hi HSE
Quote from: HSE on August 09, 2022, 05:22:28 AM
For 32 bits I use modified versions of JWAsm15, Asmc28 or UAsm46 with long lines. JWAsm is from last version, others are older versions.
In that versions ".err" work well in main file. With includes and macros usually lost track. Nidud impoved that.
Good to know...

Biterider