Giter Club home page Giter Club logo

Comments (4)

Kostr avatar Kostr commented on September 25, 2024

Generally if we use a library or PCD from another package, we would need to include declaration (DEC) file for that package.

Why is that? Let's comment the Packages section in our UefiLessonsPkg/SimplestApp/SimplestApp.inf file:

#[Packages]
#  MdePkg/MdePkg.dec

In this case the build would fail with this error:

edk2/Build/UefiLessonsPkg/RELEASE_GCC5/X64/UefiLessonsPkg/SimplestApp/SimplestApp/DEBUG/AutoGen.h:16:10: fatal error: Uefi.h: No such file or directory
   16 | #include <Uefi.h>
      |          ^~~~~~~~

Here the build system complains that it can't find the header file Uefi.h. If you'll search for this file in the edk2 repo, you will find it in the MdePkg/Include folder (https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Uefi.h)

But as you see the build system couldn't find it in our case.

How does including MdePkg/MdePkg.dec fixes the issue? If you'll look at the https://github.com/tianocore/edk2/blob/master/MdePkg/MdePkg.dec you'll see that it has these statements:

...
[Includes]
  Include
...

This adds another folder (MdePkg/Include) folder to search for include files. And this is what we need to make our build system happy.

Just in case here is a documentation for the INF file [Packages] section:
https://edk2-docs.gitbook.io/edk-ii-inf-specification/3_edk_ii_inf_file_format/37_-packages-_sections

from uefi-lessons.

joyoseller20100802 avatar joyoseller20100802 commented on September 25, 2024

My thought about it is that the uefi add package(dsc dec) and class(inf) Based on c (.c file and .h file) ,a class (a inf) have many c file and their reference information of c file of other package and corresponding class can get from its dsc file.but it has it own MdePkg/MdePkg.dec to reflect the reference information,I think it's more intuitive.

from uefi-lessons.

joyoseller20100802 avatar joyoseller20100802 commented on September 25, 2024

In lesson 20 i thought it again ,inf can not use the information in dsc because dsc `s component include inf w if inf w use the information in its dsc can lead to cycle use ,so inf can not use the information in dsc in theory.

from uefi-lessons.

joyoseller20100802 avatar joyoseller20100802 commented on September 25, 2024

Of cause this is only on case ,other cases such as lesson 2 inf can use the information of its dsc .

from uefi-lessons.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.