2013年8月28日星期三

/ Usr / bin / ld: cannot find-l: libjpeg.so.8.3.0

In After the image acquisition camera uses libjpeg library memory JPEG images into BMP image for subsequent processing, but when there is a compiler
/ usr / bin / ld: cannot find-l: libjpeg.so.8.3.0
collect2: ld returned 1 exit status

mistake, I installed libjpeg library, the path has libjpeg.so.8.3.0. Baidu up but has not been resolved, the forum friends encountered such questions? Please help, the card for a few days, be grateful
------ Solution -------------------------- ------------------
ldconfig-v | grep libjpeg you want to see if there is a library. If not, re-set the environment variable LD_LIBRARY_PATH plus your library path; such as:
export LD_LIBRARY_PATH = / usr / lib: $ (LD_LIBRARY_PATH)
------ Solution ----------------------- ---------------------
amount. . . That compilation statements plus -L/usr/local/libjpeg
-L is a compile time dynamic library search path
how so many people ask this question recently. . . . Free search landlord under linux dynamic library link under way, a clear understanding of the program behaves as easy to find the problem
------ For reference only -------------- -------------------------



I run ldconfig-v | grep libjpeg appear as a result,
[root @ localhost usr] # ldconfig-v | grep libjpeg
libjpeg.so.8 -> libjpeg.so.8.3.0
libjpeg.so.62 -> libjpeg.so.62.0.0
libjpeg.so.62 would have been on a virtual machine is in / usr / lib directory, I'll libjpegsrc.v8c.tar.gz unzip installed in / usr / local / libjpeg directory, Makefile path is given in / usr / local / libjpeg / lib.
compiled on the virtual machine when it emerged the above problem, you say set the environment variable I tried it, there
bash: LD_LIBRARY_PATH: command not found

I see a post that says so, LIBRARY_PATH is compiled with, LD_LIBRARY_PATH is used at runtime.


------ For reference only ---------------------------------- -----
you knock on the wrong command, in front of export did not add it?
------ For reference only -------------------------------------- -
export LD_LIBRARY_PATH = / usr / local / libjpeg / lib: $ (LD_LIBRARY_PATH)
------ For reference only ----------------- ----------------------


Yeah
plus
[root @ localhost ffmpeg] # export LD_LIBRARY_PATH = / usr / local / libjpeg / lib: $ (LD_LIBRARY_PATH)
bash: LD_LIBRARY_PATH: command not found

------ For reference only ---------------------------------- -----
should still knocking on the wrong, and you try to enter only the expo, and then filled with the tab key, and then finish up the back of the keyboard input characters one by one, do not use copy.

Also see the command prompt, you should execute commands as root, right? If not root, first switch to the root user, ensure that there must execute permissions.
------ For reference only -------------------------------------- -


Hello, can add about qq do? Remote Assistance, thank you! My qq 564174616
------ For reference only --------------------------------- ------


I tried the method in accordance with what you say, or the same error.
------ For reference only -------------------------------------- -
compiled statement added -L/usr/lib
run when it is used LD_LIBRARY_PATH
------ For reference only ---------------------------- -----------


But my libjpeg library is installed in / usr / local / libjpeg directory, do not want to install to / usr / lib directory under it?
------ For reference only -------------------------------------- -


You see my Makefile, has been added.

# use pkg-config for getting CFLAGS abd LDFLAGS
# pkg-config - cflags - libs libavutil.pc libavcodec.pc libavformat.pc libavdevice.pc libavfilter.pc libswscale.pc
FFMPEG_LIBS = libavdevice libavformat libavfilter libavcodec libswscale libavutil
CFLAGS + = $ (shell pkg-config - cflags $ (FFMPEG_LIBS))
LDFLAGS + = $ (shell pkg-config - libs $ (FFMPEG_LIBS))
CFLAGS + = -I/usr/local/libjpeg/include
LDFLAGS + = -L/usr/local/libjpeg/lib-l: libjpeg.so.8.3.0

EXAMPLES = encoding

OBJS = $ (addsuffix. o, $ (EXAMPLES))

%:%. o
$ (CC) $ <$ (LDFLAGS)-o $ @

%. o:%. c
$ (CC) $ <$ (CFLAGS)-c-o $ @

. phony: all clean

all: $ (OBJS) $ (EXAMPLES)

clean:
rm-rf $ (EXAMPLES) $ (OBJS)

------ For reference only ---------------------------------- -----
LDFLAGS + = -L/usr/local/libjpeg/lib-ljpeg
If / usr / local / libjpeg / lib under no libjpeg.so file, create a libjpeg.so to libjpeg.so.8.3.0 soft connection
------ For reference only - -------------------------------------

  
But my libjpeg library is installed in / usr / local / libjpeg directory, do not want to install to / usr / lib directory under it?  


o! wrong, misleading LZ, sorry.
------ For reference only -------------------------------------- -



as you say

    
    
But my libjpeg library is installed in / usr / local / libjpeg directory, do not want to install to / usr / lib directory under it?    
  
  
  
o! wrong, misleading LZ, sorry.  


okay, thank you very much!
------ For reference only -------------------------------------- -



First / usr / local / libjpeg / lib Here are the following documents:
libjpeg.a libjpeg.la libjpeg.so libjpeg.so.8 libjpeg.so.8.3.0
I also tried to add a soft link ln-s libjpeg.so libjpeg.so.8.3.0

then follow LDFLAGS + = -L/usr/local/libjpeg/lib-ljpeg modify the Makefile

make appear after the following error:
[root @ localhost ffmpeg] # make
cc encoding.c -I/usr/local/ffmpeg/include -I/usr/local/libjpeg/include-c-o encoding.o
encoding.c: In function 'main':
encoding.c: 369: warning: 'avcodec_alloc_context' is deprecated (declared at / usr / local / ffmpeg / include / libavcodec / avcodec.h: 3423)
encoding.c: 384: warning: 'avcodec_open' is deprecated (declared at / usr / local / ffmpeg / include / libavcodec / avcodec.h: 3569)
encoding.c: 533: warning: 'avcodec_encode_video' is deprecated (declared at / usr / local / ffmpeg / include / libavcodec / avcodec.h: 4273)
encoding.c: 577: warning: 'avcodec_encode_video' is deprecated (declared at / usr / local / ffmpeg / include / libavcodec / avcodec.h: 4273)
cc encoding.o -L/usr/local/ffmpeg/lib-lavdevice-lavformat-lavfilter-lavcodec-lswscale-lavutil -L/usr / local / libjpeg / lib-ljpeg-o encoding
/ usr / bin / ld: skipping incompatible / usr / local / libjpeg / lib / libjpeg.so when searching for-ljpeg
/ usr / bin / ld: skipping incompatible / usr / local / libjpeg / lib / libjpeg.a when searching for-ljpeg
/ usr / bin / ld: skipping incompatible / usr / local / libjpeg / lib / libjpeg.so when searching for-ljpeg
/ usr / bin / ld: skipping incompatible / usr / local / libjpeg / lib / libjpeg.a when searching for-ljpeg
/ usr / bin / ld: warning: libswresample.so.0, needed by / usr / local / ffmpeg / lib / libavfilter.so, not found (try ; using-rpath or-rpath-link)
encoding.o: In function `jpeg_decompress':
encoding.c: (. text +0 x1548): undefined reference to `jpeg_mem_src '
encoding.o: In function `main ':
encoding.c: (. text +0 x19fa): undefined reference to `avcodec_init '
/ usr / local / ffmpeg / lib / libavfilter.so: undefined reference to `swr_set_channel_mapping @ LIBSWRESAMPLE_0 '
/ usr / local / ffmpeg / lib / libavfilter.so: undefined reference to `swr_alloc @ LIBSWRESAMPLE_0 '
/ usr / local / ffmpeg / lib / libavfilter.so: undefined reference to `swr_set_matrix @ LIBSWRESAMPLE_0 '
/ usr / local / ffmpeg / lib / libavfilter.so: undefined reference to `swr_next_pts @ LIBSWRESAMPLE_0 '
/ usr / local / ffmpeg / lib / libavfilter.so: undefined reference to `swr_free @ LIBSWRESAMPLE_0 '
/ usr / local / ffmpeg / lib / libavfilter.so: undefined reference to `swr_init @ LIBSWRESAMPLE_0 '
/ usr / local / ffmpeg / lib / libavfilter.so: undefined reference to `swr_alloc_set_opts @ LIBSWRESAMPLE_0 '
/ usr / local / ffmpeg / lib / libavfilter.so: undefined reference to `swr_convert @ LIBSWRESAMPLE_0 '
collect2: ld returned 1 exit status
make: *** [encoding] Error 1

------ For reference only ---------------------------------- -----
I also tried to add a soft link ln-s libjpeg.so libjpeg.so.8.3.0

soft link wrong
------ For reference only ---------------------------- -----------


What does this mean? Detailed point you can say?
------ For reference only -------------------------------------- -


I run ldconfig-v | grep libjpeg appear as a result,
[root @ localhost usr] # ldconfig-v | grep libjpeg
libjpeg.so.8 -> libjpeg.so.8.3.0
libjpeg.so.62 -> libjpeg.so.62.0.0

There libjpeg6 virtual machine itself, the library, but my application to use libjpeg8 library, so I installed in / usr / local / libjpeg directory.
------ For reference only -------------------------------------- -
you libjpeg.so.8.3.0 pointing libjpeg.so
ls / usr / local / libjpeg / lib facie entity which is the jpeg library to libjpeg.so pointing to it
------ For reference only -------- -------------------------------


or not, you can add friends? I qq 564174616 Remote Assistance look

没有评论:

发表评论