Subject: Re: [edk2] Buidl Error C2496 from AutoGen.c
From: Andrew Fish <firstname.lastname@example.org>
To: galla rao <email@example.com>
Date: 2013-07-11 06:12:45
Thanks FengThere is some piece of code where variables are declared asand when needed, i was porting this to UDK compatible
The earlier code was on EDK which used /TP option.so the same i am trying to continue on UDK as wellIs there a way to overcome this behaviour with /TP optionAlternate solution is to remove /TP and declare the variables at the beginning of the function (or) open a block to declare variables and run the code, it does work
On Thu, Jul 11, 2013 at 7:55 AM, Tian, Feng <firstname.lastname@example.org> wrote:
Why are you using /TP compiler option? From MSDN, you are trying to treat AutoGen.c as C++ file?
/TC and /TP are "global" variants of /Tc and /Tp. They specify to the compiler to treat all files named on the command line as C source files (/TC) or C++ source files (/TP), without regard to location on the command line in relation to the option.
I am trying to build a optionrom with UDK2010.SR1.UP1 libraries
with /TP as compiler switch
I see error C2496 from AutoGen.c, though i never use these PCD's
when i don't use /TP flag, this error is not seen
c:\udk2010.up1\Build\MdeModule\RELEASE_VS2010\X64\MdeModulePkg\Bus\Pci\Sasdriver\SasDriver\DEBUG\AutoGen.c(65) : error C2496: '_gPcd_FixedAtBuild_PcdMaximumLinkedListLength' : 'selectany' can only be applied to data items with external linkage
c:\udk2010.up1\Build\MdeModule\RELEASE_VS2010\X64\MdeModulePkg\Bus\Pci\Sasdriver\SasDriver\DEBUG\AutoGen.c(72) : error C2496: '_gPcd_FixedAtBuild_PcdMaximumAsciiStringLength' : 'selectany' can only be applied to data items with external linkage
c:\udk2010.up1\Build\MdeModule\RELEASE_VS2010\X64\MdeModulePkg\Bus\Pci\Sasdriver\SasDriver\DEBUG\AutoGen.c(79) : error C2496: '_gPcd_FixedAtBuild_PcdMaximumUnicodeStringLength' : 'selectany' can only be applied to data items with external linkage
I am using /TP(for convenience of declaring varaibles) and also some extern "C" code
Please help me know how to overcome this error
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
edk2-devel mailing list