error enumerated type mixed with another type - enums

While compiling this above mention warning facing because of that one linker error is generating
I try to comment it but related to that undefined error is coming

Related

AdobeGlyphList.txt loading error: The type initializer for 'iText.IO.Util.ResourceUtil' threw an exception

I use the iText7 component for extracting text from PDF on dotnet core 3, but for no apparent reason I started to receive the following error message: AdobeGlyphList.txt loading error: The type initializer for 'iText.IO.Util.ResourceUtil' threw an exception.
The error occurs on the highlighted line.
This worked for me. Before you get to that line of code you first need to enable the
Common Language Runtime Exception
in visual studio as shown
This will throw the actual error message causing this. In my case it was a library that was being referenced by itext that was missing. I guess because of .Net core or some other reason not sure why.
I searched for the dll and referenced it in my solution and it worked
Installing NuGet Microsoft.DotNet.PlatformAbstractions worked for me.

How do I better diagnose linker error LNK2022?

I have a Visual Studio linker error that popped up recently. I stumbled upon a workaround but it is driving me crazy that I can't figure out why it is happening in the first place. I need to learn how to better diagnose it.
So my question is not about how to fix it, but how to diagnose it better. In short what I'm trying to learn here is how to get the linker (or some other tool) to tell me more info about the problem. So this question is not about this particular enum or how I coded it exactly.
The project is a C++/CLI project I have a managed enum which I wanted to refer to in several other header files. So I tried to put a forward declaration of it in the shared file that I use for all my other forward declarations. That started giving me this error.
1>profileregioncli.obj : error LNK2022: metadata operation failed (801311E4) : Duplicate managed types have different visibilities.
OK, fine. My forward declaration probably looks different to the linker than the definition. But I cannot see how the declarations are different in code. And technically, since the linker doesn't even bother to tell me exactly what type is involved I cannot even be 100% sure it's this enum.
So how do I determine following two things?
Exactly what symbol is mismatching AND
Exactly what is the difference (to the linker) between the two versions.
Obviously the first item I probably know. The second, not at all.
What I have tried so far
I've tried setting linker output to full verbosity but it doesn't tell me anything new. Here is the full linker output
1>------ Build started: Project: Core.Sdk, Configuration: Release x64 ------
1>Generating code
1>0 of 1470 functions ( 0.0%) were compiled, the rest were copied from previous compilation.
1> 0 functions were new in current compilation
1> 0 functions had inline decision re-evaluated but remain unchanged
1>Finished generating code
1>profileregioncli.obj : error LNK2022: metadata operation failed (801311E4) : Duplicate managed types have different visibilities.
1>LINK : fatal error LNK1255: link failed because of metadata errors
1>Done building project "corecli_v16.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 10 up-to-date, 0 skipped ==========
ILDasm Microsoft recommends trying to use ILDasm for this error but that doesn't work. When I tried using it from the command line as they described, it tells me I have to use it interactive mode. When I then try to use it in interactive mode and open up the .OBJ file in question, it wants an .EXE or DLL, not an .OBJ
MAP File I tried changing the linker settings to generate a MAP file but it never does. So I'm guessing thats not generated unless linking is successful.
Change Something, anything Sometimes the best way to figure out an obscure linker error is to make a change -- any change -- to force the linker to give you a different error so I tried changing the managed enum type to derive from System:UInt32 (a valid thing to do which I do with some of my other managed enums) just to see if I would get a different error. And I did get it to tell me that there were two different definitions of the enum in question, but not what they were. But aside from that, no extra information
But this still leads me to want to see the two definitions side-by-side. Not in code but as the linker sees them. How do I do that?

LNK1220: '/PGD' requires '/LTCG:[PGINSTRUMENT|PGOPTIMIZE]' specification

While building project in VS2008, I get the error
1>LINK : fatal error LNK1220: '/PGD' requires '/LTCG:[PGINSTRUMENT|PGOPTIMIZE]' specification
It was building fine earlier. I am not sure what I changed in properties and that causing this error now. My Linker -> Optimization settings are such Profile guided database is set to "$(TargetDir)$(TargetName).pgd" and all other fields are set to "Default". Any ideas?

Upgrading "initialization from incompatible pointer type" warning to an error

I am working on a code base that's compiled with gcc, which is doing a lot of initialisation of structures containing function pointers.
Whenever anyone makes a mistake with the function types I get the warning "initialization from incompatible pointer type". I would like to upgrade this to an error, because it's obviously wrong.
Unfortunately I cannot seem to find what the compiler option name of this warning is to use with `-Werror='. And turning all warnings into errors isn't an options here (for reasons which are not relevant right now).
Apparently adding -fdiagnostics-show-option is supposed to annotate each compiler warning with the compiler option name, and indeed, it does so... for all warnings except this one. So now I'm confused. Any suggestions?
This is gcc 4.4.5 for ARM, running on Linux.

What does this Xcode link warning mean? can't add line info to anonymous symbol

I am working towards getting rid of all link warnings, but I am getting three that I don't quite understand and a google search for this warning hasn't been helpful.
The output to Xcode looks like:
ld: warning: can't add line info to anonymous symbol __ZN16CLineAlignWidgetD0Ev.lsda from /path/to/CLineAlignWidget.o
What causes this warning and what can be done to fix it?
I have looked at the CLineAlignWidget class and it looks like other classes which aren't generating this warning.
Thank you.
I went to the llvm IRC channel and asked this question and got back the following response:
d0k: It's a compiler bug, but I think it's harmless

Resources