How to static link EDK II library into application in Visual Studio 2008 tool chain

874 views Asked by At

I have EDK II application and library in package and it works fine when I compile it with library source codes. Now I want to remove the library source codes and link that library with application through .lib file.

I remove library source codes references from my application project and now I'm getting this message while I'm building this application:

DemoApp.lib(DemoApp.obj) : error LNK2001: unresolved external symbol TestFunction
fatal error LNK1120: 1 unresolved externals.

To solve this, in DSC documentation they mention that I need to add library instance into make file as shown in below:

LIBS = $(LIBS) $(LIB_DIR)/$(LibInstanceName)

Problem is how can I add this entry into make file / EDK II build system?

I'm using VS2008 as my tool chain.

1

There are 1 answers

0
Dilshan Jayakody On

Finally I made it by adding [BuildOptions] entry into Application INF.

In that section I add parameters to Microsoft Linker to get the .lib file from library path:

MSFT:DEBUG_VS2008x86_X64_SLINK_FLAGS = /LIBPATH:"C:\TestApp\DEBUG_VS2008x86\X64\TestAppPkg\Library\TestLib\TestLib\OUTPUT" "TestLib.lib"