On Fri, Oct 18, 2013 at 2:10 AM, Nishit Patira <nishitpat...@gmail.com> wrote:
> Hey,
>
> Pasting both inf and C files for your reference,
>
> INF FILE
> #/*++
> #
> #  Module Name:
> #
> #    DIMM.inf
> #
> #  Abstract:
> #
> #    DIMM is EFI based tool which returns the Channel number and DIMM number
> given a physical address.
> #
>
> #  Notes:
> #    BASE_NAME   - names the output file (mount.efi here)
> #    FILE_GUID   - required by the build tool, but not used anywhere for
> this
> #    BUILD_TYPE  - tells the build process to use the
> #                  [build.$(PROCESSOR).$(BUILD_TYPE)] section of the DSC
> file
> #                  to build it. Make sure the DSC file has this section.
> #    FV          - define as NULL to indicate to the build tools that the
> #                  final build target does not go into any firmware volume.
> #
> --*/
>
> [defines]
> INF_VERSION          = 0x00010015
> BASE_NAME            = DIMMApp
> FILE_GUID            = ECEE8016-615E-452c-A7E5-F773E7421F91
> MODULE_TYPE          = UEFI_APPLICATION
> ENTRY_POINT          = EfiFlashMain
>
> [sources.common]

Maybe [Sources] instead? I can't remember, but I think .common only
works for 'EdkCompatibilityPkg' type modules.

>   DIMMApp.c
>   DIMMApp.h
>
>
> [Packages.common]

Same here?

-Jordan

>   MdePkg/MdePkg.dec
>   MdeModulePkg/MdeModulePkg.dec
>   DuetPkg/DuetPkg.dec
>   ShellPkg/ShellPkg.dec
>   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
>   IntelFrameworkPkg/IntelFrameworkPkg.dec
>
> [libraryclasses]
>
> UefiUsbLib
> UefiLib
> UefiApplicationEntryPoint
> UefiDecompressLib
> UefiBootServicesTableLib
> TimerLib
> UefiScsiLib
> ReportStatusCodeLib
> PrintLib
> PerformanceLib
> PeCoffLib
> PeCoffExtraActionLib
> PeCoffGetEntryPointLib
> PciLib
> PciExpressLib
> PciCf8Lib
> PcdLib
> MemoryAllocationLib
> IoLib
> HobLib
> DxeServicesTableLib
> DevicePathLib
> DebugLib
> CpuLib
> CacheMaintenanceLib
> BaseMemoryLib
> BaseLib
> ExtractGuidedSectionLib
> SerialPortLib
> DxeServicesLib
> SynchronizationLib
> DebugPrintErrorLevelLib
>
> [depex]
>
>  TRUE
> ----------------------------------------------------------------------------------------------------------------
>
> C FILE (I cannot reproduce the entire program, because a part of it involves
> Intel IP.I hope you understand)
>
> #include <DIMMApp.h>
> #include <Uefi.h>
> #include <Library/PcdLib.h>
> #include <Library/UefiLib.h>
> #include <Protocol/EfiShellInterface.h>
> #include <Library/UefiBootServicesTableLib.h>
> #include <Library/ShellLib.h>
> #include <Library/PrintLib.h>
> #include <Library/BaseLib.h>
> #include <Base.h>
> #include <Library/UefiApplicationEntryPoint.h>
> //#define DEBUG_EFI 0
> EFI_SHELL_INTERFACE      *SI;
> EFI_HANDLE MyHandle=NULL;
>
> EFI_GUID  gEfiInteloolProtocolGuid = EFI_INTEL_TOOL_PROTOCOL_GUID;
>
> EFI_BOOT_SERVICES     *gBS;
> void ExitProgram(void);
>
> // Entry point EfiFlashMain funtion
> EFI_STATUS
>
> EFIAPI
> EfiFlashMain (
>   IN EFI_HANDLE         ImageHandle,
>   IN EFI_SYSTEM_TABLE   *SystemTable
>   )
> {
>     EFI_STATUS Status = EFI_SUCCESS;
>     EFI_INTEL_TOOL_PROTOCOL         *mToolProtocol;
>     UINT32                       TranslateStatus = 0;
>
>     //Initialize as a shell app and run
>    // EFI_SHELL_APP_INIT (ImageHandle, SystemTable); (This is not required
> in EDK II)
>     gBS = SystemTable->BootServices;
>
>     // Check the required version of EFI system
>     // At least, we should run on a system that keeps to EFI1.02 SPEC
>     if (!EFI_PROPER_VERSION (1, 10))
>     {
>         print(L"\n EFI Version not supported. This program requires EFI
> 1.10\n");
>
>         return EFI_UNSUPPORTED;
>     }
>     MyHandle = ImageHandle;
>
> Print(L"\n--------------------------------------------------------------\n");
>     Print(L"\nCopyright (c) 2012, Intel Corporation. All rights reserved.");
>
> Print(L"\n--------------------------------------------------------------");
>     //Parse
>     if(SI->Argc != 2)
>     {
>         Print(L"\nInvalid arguments. ");
>         ExitProgram();
>     }
>
>
> Regards,
> Nishit Patira
>
>
> On Fri, Oct 18, 2013 at 2:12 PM, Li, Elvin <elvin...@intel.com> wrote:
>>
>> MdePkg\Library\UefiApplicationEntryPoint definitely implements
>> _ModuleEntryPoint, so link error seems strange to me…
>>
>>
>>
>> If you could send out the skeleton of your .c and .inf files which could
>> reproduce your issue, it would be great.
>>
>>
>>
>> From: Nishit Patira [mailto:nishitpat...@gmail.com]
>> Sent: Friday, October 18, 2013 4:04 PM
>>
>>
>> To: edk2-devel@lists.sourceforge.net
>> Subject: Re: [edk2] error LNK2001: unresolved external symbol
>> _ModuleEntryPoint
>>
>>
>>
>> I added the library class UefiApplicationEntryPoint in INF file and
>> <Library/UefiApplicationEntryPoint.h> in C file . Yet, the error still
>> persists
>>
>>
>>
>> Regards,
>>
>> Nishit Patira
>>
>> On Fri, Oct 18, 2013 at 12:39 PM, Li, Elvin <elvin...@intel.com> wrote:
>>
>> Do you do this in your code?
>>
>> 1.       UefiApplicationEntryPoint in [LibraryClasses] in the INF file?
>>
>> 2.       include <Library/UefiApplicationEntryPoint.h> in the C file?
>>
>>
>>
>> Thanks
>>
>> Elvin
>>
>> From: Nishit Patira [mailto:nishitpat...@gmail.com]
>> Sent: Friday, October 18, 2013 2:48 PM
>> To: edk2-devel@lists.sourceforge.net
>> Subject: Re: [edk2] error LNK2001: unresolved external symbol
>> _ModuleEntryPoint
>>
>>
>>
>> Sorry,
>>
>> the code snippet i meant to mention (which gives error) was
>>
>> #ifdef EFI_BOOTSHELL
>> EFI_APPLICATION_ENTRY_POINT(EfiFlashMain)
>> #endif
>>
>> FI_STATUS
>> EFIAPI
>> EfiFlashMain (
>>   IN EFI_HANDLE         ImageHandle,
>>   IN EFI_SYSTEM_TABLE   *SystemTable
>>   )
>>
>>
>> This is the snippet which works fine,
>> #ifdef EFI_BOOTSHELL
>> EFI_APPLICATION_ENTRY_POINT(_ModuleEntryPoint)
>> #endif
>>
>> EFI_STATUS
>> EFIAPI
>> _ModuleEntryPoint(
>>   IN EFI_HANDLE         ImageHandle,
>>   IN EFI_SYSTEM_TABLE   *SystemTable
>>   )
>>
>> Sorry for the gaffe.
>>
>> Thanks & Regards,
>> Nishit Patira
>>
>>
>>
>>
>>
>> On Fri, Oct 18, 2013 at 12:02 PM, Nishit Patira <nishitpat...@gmail.com>
>> wrote:
>>
>> Hi,
>>
>> I am writing an application in EDK II and for the given snippet of code, i
>> get the error
>> error LNK2001: unresolved external symbol _ModuleEntryPoint :-
>>
>> #ifdef EFI_BOOTSHELL
>> EFI_APPLICATION_ENTRY_POINT(EfiFlashMain)
>> #endif
>>
>> However, _ModuleEntryPoint is not used anywhere in the program.
>> Also, if I change the code to
>>
>> #ifdef EFI_BOOTSHELL
>> EFI_APPLICATION_ENTRY_POINT(_ModuleEntryPoint)
>> #endif
>>
>> the application compiles.
>>
>> Could you please tell why this is happening.
>>
>> Regards,
>>
>> Nishit Patira
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
>> from
>> the latest Intel processors and coprocessors. See abstracts and register >
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
>> from
>> the latest Intel processors and coprocessors. See abstracts and register >
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to