Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6086411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:45:07+00:00 2026-05-23T11:45:07+00:00

g++ -o Test Test.cpp -lTest /usr/bin/ld: cannot find -lTest collect2: ld returned 1 exit

  • 0
g++ -o Test Test.cpp -lTest
/usr/bin/ld: cannot find -lTest
collect2: ld returned 1 exit status

If symbols from shared/dynamic libraries are loaded on-demand at runtime, why is it a fatal error for a library to be missing at compile-time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:45:08+00:00Added an answer on May 23, 2026 at 11:45 am
    1. Inter-library dependencies can be difficult to deal with at run time; the compile-time check lets the linker detect and sometimes resolve dependency loops and add any additional library dependencies to the runtime link list.
    2. Would you prefer to find out that you misspelled a symbol name at compile/link time, or at runtime? Most people prefer the former, so the linker checks that all symbols are resolved instead of deferring it to the runtime loader; this of course requires all the libraries to be present.
    3. Suppose a dynamic library requires a static library to be present which otherwise wouldn’t be linked in. On most platforms you can’t (or can’t sanely or safely) load static libraries at runtime, so the linker needs to deal with these at link time. (This is actually a sub-case of #1.)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given some source file test.cpp I would like to create a shared library libtest.so
I've been getting this undefined symbol building with this command line: $ gcc test.cpp
I'm trying to call Error(My Test) in normal cpp class (Not a COM object,
I have a simple test file, TestMe.cpp: #include <gtest/gtest.h> TEST(MyTest, SomeTest) { EXPECT_EQ(1, 1);
I have two precompiled library: X.a and Y.a and a test.cpp (without main function)
I am trying to compile an object file using the code below. //--Begin test.cpp
How do I inherit from a virtual template class, in this code: // test.h
// File test.cpp #include <my_global.h> #include <algorithm> int main() { return 0; } Compiled
I am trying to compile a sample c++ file test.cpp using IBM xlC compiler
The following code will cause compile errors in g++4.4: // File test.cpp namespace A

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.