2

Recently in a homework assignment, I ran into what seems to be a common problem for new programmers, in that I used #include in the program, but it failed at compilation time. I learned that this was due to not explicitly linking the library at compile time. I didn't fully understand WHY at the time. This thread GCC linked library for compile ultimately explained that concept for me.

I see this relationship as perhaps the linker running first at compile time, then piping its' output to the compiler. If this is incorrect, please give me a more precise analogy.

My real question here is a general one, that is, what libraries, when not explicitly linked at compile time, will cause a compilation failure (on a Unix (Linux) system using gcc (GCC) 8.2.1 20181127)? Is there perhaps a list somewhere showing those libraries and the actual argument to link those libraries at compile time?

At this time no expected or actual results, other than the original failure at compile time using the include for but failing to use -lm.

2
  • libraries are linked at link time, not at compile time. You could perhaps use an overview of the C compilation process? Commented Mar 25, 2019 at 18:13
  • Thank you Mr. Dodd. That link was indeed a helpful link. Commented Mar 29, 2019 at 15:39

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.