how can i solve ldconfig create link with version number

Aylwyn Lake

Suppose I have /a/lib/dir that has files

-rwxrwxr-x libboost_signals.so
-rwxrwxr-x libboost_signals.so.1.55.0

And I create a file: /etc/ld.so.conf.d/testlib.conf with content

/a/lib/dir

And run

sudo ldconfig
sudo ldconfig -v | head

libboost_signals.so.1.55.0 -> libboost_signals.so.1.55.0

Since ldconfig create a link libboost_signals.so.1.55.0 not libboost_signals.so,

I can't use -lboost_signals when use g++ to compile the source code.

But -L/a/lib/dir/ -lboost_signals is ok.


Edit the .bashrc file as:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/a/lib/dir

then

source .bashrc

will be the same result.

So what is the correct way to add system LD_LIBRARY_PATH?

Maxim Egorushkin

I can't use -lboost_signals when use g++ to compile the source code.

But -L/a/lib/dir/ -lboost_signals is ok.

LD_LIBRARY_PATH and /etc/ld.so.conf.d control the behaviour of the run-time linker ld.so only and do not affect the linking of the object files and libraries done by ld, this is why -L/a/lib/dir/ must be used.

There is no config file or environment variable to add to ld linker path. People normally hard-code extra linker paths in the makefile. Makefiles often consider LDFLAGS environment variable though.

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Any suggestions on how i can create an email link in a java button

来自分类Dev

How can I create a template version of this method that is used when template parameter is std::vector

来自分类Dev

Given a table of data and number of occurrences, can I create the underlying dataset?

来自分类Dev

How do I create a link to a pdf file with rails?

来自分类Dev

How can I create a histogram in R?

来自分类Dev

How can I create this complicated SQL query?

来自分类Dev

How can I create an array of functions?

来自分类Dev

How can I get the Mercurial Changeset ID from a revision number?

来自分类Dev

How can I *only* get the number of bytes available on a disk in bash?

来自分类Dev

How can I intentionally create a simple runtime error?

来自分类Dev

How can I create thumbnail with carrierwave and a imagemagick script?

来自分类Dev

How can I create a php function that will gather all

来自分类Dev

How can I create a temporary table using PetaPoco?

来自分类Dev

How can I create an element in HTML/CSS with a semicircle border at the top?

来自分类Dev

How can I create HUD (mirrored) layout/screen Android?

来自分类Dev

How can I create a SUM of one column within a query in SQL?

来自分类Dev

How do I use GitHub to create version 2 of a repository, but keep both versions active?

来自分类Dev

knockoutjs - How can I populate an empty observable array in response to user action (anchor link click)

来自分类Dev

How can I align <label>,<input>, text, input fields, a real button, and a "<a> link button" properly and with the same font?

来自分类Dev

How to create a Randomly Generated number

来自分类Dev

How to create a simple share linkedIn link?

来自分类Dev

How to hide create site link for particular user

来自分类Dev

How can I find out what version is passed to setup in setup.py?

来自分类Dev

Can I create a class which can be unpacked?

来自分类Dev

How can i increase the number of ticks, a controller goes through, in a staggered animation (Flutter)

来自分类Dev

How do I link to a pdf in AngularJS?

来自分类Dev

How do I link boost to my program?

来自分类Dev

How can I create simple interactive GUI for c++ OpenCV application?

来自分类Dev

Why can't I create a new Color?

Related 相关文章

  1. 1

    Any suggestions on how i can create an email link in a java button

  2. 2

    How can I create a template version of this method that is used when template parameter is std::vector

  3. 3

    Given a table of data and number of occurrences, can I create the underlying dataset?

  4. 4

    How do I create a link to a pdf file with rails?

  5. 5

    How can I create a histogram in R?

  6. 6

    How can I create this complicated SQL query?

  7. 7

    How can I create an array of functions?

  8. 8

    How can I get the Mercurial Changeset ID from a revision number?

  9. 9

    How can I *only* get the number of bytes available on a disk in bash?

  10. 10

    How can I intentionally create a simple runtime error?

  11. 11

    How can I create thumbnail with carrierwave and a imagemagick script?

  12. 12

    How can I create a php function that will gather all

  13. 13

    How can I create a temporary table using PetaPoco?

  14. 14

    How can I create an element in HTML/CSS with a semicircle border at the top?

  15. 15

    How can I create HUD (mirrored) layout/screen Android?

  16. 16

    How can I create a SUM of one column within a query in SQL?

  17. 17

    How do I use GitHub to create version 2 of a repository, but keep both versions active?

  18. 18

    knockoutjs - How can I populate an empty observable array in response to user action (anchor link click)

  19. 19

    How can I align <label>,<input>, text, input fields, a real button, and a "<a> link button" properly and with the same font?

  20. 20

    How to create a Randomly Generated number

  21. 21

    How to create a simple share linkedIn link?

  22. 22

    How to hide create site link for particular user

  23. 23

    How can I find out what version is passed to setup in setup.py?

  24. 24

    Can I create a class which can be unpacked?

  25. 25

    How can i increase the number of ticks, a controller goes through, in a staggered animation (Flutter)

  26. 26

    How do I link to a pdf in AngularJS?

  27. 27

    How do I link boost to my program?

  28. 28

    How can I create simple interactive GUI for c++ OpenCV application?

  29. 29

    Why can't I create a new Color?

热门标签

归档