Results 1 to 2 of 2

Thread: dynamic linking, g++/gcc

  1. #1
    Join Date
    Oct 2010
    Beans
    52
    Distro
    Ubuntu Studio 10.04 Lucid Lynx

    dynamic linking, g++/gcc

    Hey,


    i need to dynamic link a program with OTHER libraries than in /usr/lib or /usr/local/lib .
    So how am i gonna tell that to the programm? I was finally able to compile it, but as soon as I try to run it i get dependency errors:
    Code:
    ./Tester: error while loading shared libraries: libModelv0.1.so: cannot open shared object file: No such file or directory
    hope anybody can help.

    A full line to finally compile the programm and be able to run it afterwarts would be perfectly fine.

    My actual try is:
    Code:
    	g++ -o Tester main.cpp -L. -lModelv0.1

  2. #2
    Join Date
    Sep 2009
    Beans
    1,293

    Re: dynamic linking, g++/gcc

    if you're looking for a command line version try setting LD_LIBRARY_PATH
    $ LD_LIBRARY_PATH=/path/to/libs mycommand

    for more permanent special library dirs you might want to add and entry conf file in
    /etc/ld.so.conf.d/
    and then run
    $ ldconfig -v

    [EDIT] Sorry, LD_LIBRARY_PATH not _DIR,
    Last edited by SevenMachines; January 20th, 2011 at 02:13 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •