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

  • SEARCH
  • Home
  • 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 6865435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:02:55+00:00 2026-05-27T03:02:55+00:00

There is such code: #include <cstdlib> #include <clang-c/Index.h> using namespace std; int main(int argc,

  • 0

There is such code:

#include <cstdlib>
#include <clang-c/Index.h>

using namespace std;

int main(int argc, char** argv)
{
    CXIndex Index = clang_createIndex(0, 0);
    CXTranslationUnit TU = clang_parseTranslationUnit(Index, 0, argv, argc, 0, 0, CXTranslationUnit_None);
    for (unsigned I = 0, N = clang_getNumDiagnostics(TU); I != N; ++I)
    {
        CXDiagnostic Diag = clang_getDiagnostic(TU, I);
        CXString String = clang_formatDiagnostic(Diag,
                clang_defaultDiagnosticDisplayOptions());
        fprintf(stderr, "%s\n", clang_getCString(String));
        clang_disposeString(String);
    }
    clang_disposeTranslationUnit(TU);

    clang_disposeIndex(Index);

    return 0;
}

And it’s compiled with following flags:

g++ main.cpp -g -fno-rtti `llvm-config --cxxflags --ldflags --libs` -lclang -o main

However when I want to run main:

./main

then there is following error:

./main: error while loading shared libraries: libclang.so: cannot open shared object file: No such file or directory

However:

$ sudo find / -name libclang.so
/usr/local/lib/libclang.so

Library seems to be on place. How to run this program?

  • 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-27T03:02:55+00:00Added an answer on May 27, 2026 at 3:02 am

    ldconfig creates the necessary links and cache to the most recent
    shared libraries found in the directories specified on the command
    line, in the file /etc/ld.so.conf, and in the trusted directories
    (/lib and /usr/lib)

    Try running /sbin/ldconfig and then if that doesn’t work try appending the file /etc/ld.so.conf with “/usr/local/lib” and then run /sbin/ldconfig

    Commands:

    1. Run the following command and then try compiling/running again

      /sbin/ldconfig

    2. If that doesn’t work then do this and then try compiling/running again

      echo “/usr/local/lib” >> /etc/ld.so.conf
      /sbin/ldconfig

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have following code #include <iostream> #include <cstdlib> using namespace std; int main() {
There is such code: #include <iostream> int main() { int size; std::cin >> size;
There is such code: #include <iostream> int main() { int a; int* p =
There is such code: #include <iostream> int main(){ unsigned int* wsk2 = new unsigned
There is such code: #include <iostream> int main(){ const int a = 2; int*
I have a program that has this code : #include<stdio.h> main(){ int input; char
There is such code: #include <iostream> class A{ int a; int fun(){} }; class
There is such code: #include <iostream> class A { public: int a; A() :
There is such code: #include <iostream> #include <string> int returnnumber() { return 2; }
there! I'm writting graph classes. I've wrote such code in Graphs.h : #include <vector>

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.