Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. terminology refresher class ??

terminology refresher class ??

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
9 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Building a ( static ) library. If we agree that DECLARATION are in header file and DEFINITIONS are in C++ .cpp source file what is a correct term for #include such library header file in code so the source code using the library have what ? "reference point" ? (and how does it correlate with linker ?)

    Mircea NeacsuM L 2 Replies Last reply
    0
    • L Lost User

      Building a ( static ) library. If we agree that DECLARATION are in header file and DEFINITIONS are in C++ .cpp source file what is a correct term for #include such library header file in code so the source code using the library have what ? "reference point" ? (and how does it correlate with linker ?)

      Mircea NeacsuM Offline
      Mircea NeacsuM Offline
      Mircea Neacsu
      wrote on last edited by
      #2

      Haven’t seen any standard term. If you need such term, I’d rather go for “inclusion point”. The word “reference” has many uses and adding another one is not going to make things clearer. Anyway it has no direct relation to the linker. It is purely a textual inclusion and it will go through preprocessor and compiler before.

      Mircea

      L 1 Reply Last reply
      0
      • L Lost User

        Building a ( static ) library. If we agree that DECLARATION are in header file and DEFINITIONS are in C++ .cpp source file what is a correct term for #include such library header file in code so the source code using the library have what ? "reference point" ? (and how does it correlate with linker ?)

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        The source code may be using definitions of classes/functions etc in an external library. The header file provides this information so the compiler can create a reference in the object code. Such references will then be used by the linker to fix the links to a library or other object code module. For example given the followin directory structure:

        PROJECT
        LIB
        CLIENT

        you might have:

        // Library.h the defintions of the library, in the LIB subdirectory
        void Foo(char* name);

        // Library.c the implementation of the library, in the LIB subdirectory
        void Foo(char* name)
        {
        printf("Hello, World! A message from %s\n", name);
        }

        //Implementor.cpp the program that will use the library, in the CLIENT subdirectory
        #include "../LIB/Library.h"
        int main(int argc, char** argv)
        {
        Foo("fred");

        return 0;
        

        }

        Does that make sense?

        L 1 Reply Last reply
        0
        • L Lost User

          The source code may be using definitions of classes/functions etc in an external library. The header file provides this information so the compiler can create a reference in the object code. Such references will then be used by the linker to fix the links to a library or other object code module. For example given the followin directory structure:

          PROJECT
          LIB
          CLIENT

          you might have:

          // Library.h the defintions of the library, in the LIB subdirectory
          void Foo(char* name);

          // Library.c the implementation of the library, in the LIB subdirectory
          void Foo(char* name)
          {
          printf("Hello, World! A message from %s\n", name);
          }

          //Implementor.cpp the program that will use the library, in the CLIENT subdirectory
          #include "../LIB/Library.h"
          int main(int argc, char** argv)
          {
          Foo("fred");

          return 0;
          

          }

          Does that make sense?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          It does not clearly define what I was asking for. But I sort of like the relation "definition" library client

          L 1 Reply Last reply
          0
          • Mircea NeacsuM Mircea Neacsu

            Haven’t seen any standard term. If you need such term, I’d rather go for “inclusion point”. The word “reference” has many uses and adding another one is not going to make things clearer. Anyway it has no direct relation to the linker. It is purely a textual inclusion and it will go through preprocessor and compiler before.

            Mircea

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            So a combination of Richard's

            library
            client

            with "client's inclusion point #include " would make some sense.

            Mircea NeacsuM 1 Reply Last reply
            0
            • L Lost User

              It does not clearly define what I was asking for. But I sort of like the relation "definition" library client

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Member 14968771 wrote:

              It does not clearly define what I was asking for.

              Maybe because your question did not clearly define what you were looking for.

              1 Reply Last reply
              0
              • L Lost User

                So a combination of Richard's

                library
                client

                with "client's inclusion point #include " would make some sense.

                Mircea NeacsuM Offline
                Mircea NeacsuM Offline
                Mircea Neacsu
                wrote on last edited by
                #7

                Sorry, I don't understand what you try to accomplish. Are you trying to document how your library has to be used by a client program? In this case, I've seen instructions like: "... place an include directive to in your program" or even: "... place an include directive to before the include directive for " If you are looking for something else, try to explain more.

                Mircea

                L 1 Reply Last reply
                0
                • Mircea NeacsuM Mircea Neacsu

                  Sorry, I don't understand what you try to accomplish. Are you trying to document how your library has to be used by a client program? In this case, I've seen instructions like: "... place an include directive to in your program" or even: "... place an include directive to before the include directive for " If you are looking for something else, try to explain more.

                  Mircea

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  I was trying to find if there is a specific term for the process , not just "place include..." Something similar to declare function define function relation. I guess there is none. However years ago there was a book of C code standards - something "ANSI C ..." maybe it is in there. I used to have a copy.

                  L 1 Reply Last reply
                  0
                  • L Lost User

                    I was trying to find if there is a specific term for the process , not just "place include..." Something similar to declare function define function relation. I guess there is none. However years ago there was a book of C code standards - something "ANSI C ..." maybe it is in there. I used to have a copy.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    It is still not clear what you mean by "the process". There is no process as such, you just need to ensure that the compiler can find all declarations and/or definitions of any functions that you are trying to use. Either within your source file or in an associated header.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups