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 8399885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:25:29+00:00 2026-06-09T21:25:29+00:00

I am compiling the program found here , and at runtime I get an

  • 0

I am compiling the program found here, and at runtime I get an error:

Here is what I do to compile it:

$ g++ -I/home/jpthomps/Desktop/pl-6.0.2/src main.cpp -L/usr/local/lib/swipl-6.0.2/lib/x86_64-linux -lswipl
main.cpp: In function ‘int main()’:
main.cpp:8:39: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
main.cpp:20:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

Then when I try to run the compiled program:

$ ./a.out
./a.out: error while loading shared libraries: libswipl.so.6.0.2: cannot open shared object file: No such file or directory

Do I need to add something to my .cpp file to tell it where the libswipl.so.6.0.2 file is located?

  • 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-06-09T21:25:31+00:00Added an answer on June 9, 2026 at 9:25 pm

    The problem that you see is related to the inability of the running a.out to find your dynamic library. There are several system-dependent ways to deal with the issue. For example, on Linux you can set LD_LIBRARY_PATH to include the directory where libswipl.so.6.0.2 is located.


    Although the compilation warnings are not related to the runtime error, it is still a good idea to fix them:

    static const char * av[] = {"calc.pl", NULL};
    ....
    const char * expression = "pi/2";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am compiling a simple program class Test { public static void main(String[] args)
I am getting the following error while compiling a sample program in Qt 4.5
I'm getting illegal use of floating point error on compiling the following program. Please
I'm having problems compiling a CUDA program that uses GLUT on MacOsX. Here is
Recently I tried compiling program something like this with GCC: int f(int i){ if(i<0){
While compiling a program in Java I got this big WARNING warning: [unchecked] unchecked
I am compiling my program that will run on linux gcc 4.4.1 C99. I
I'm compiling a program on my 64bit machine, but I'm not sure if it
I am compiling a program through clang+llvm (version 3.1) and trying to run it
I was compiling a C++ program in Cygwin using g++ and I had 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.