// it's for Latex

pages

Linux에서 OpenCV Library 설정하는 법

Makefile에 다음의 붉은 문구를 추가한다.
-----------------------------------------------------------------------------------
# Makefile for Basler pylon sample program
.PHONY: all clean

# The program to build
NAME       := Grab

# Installation directories for pylon
PYLON_ROOT ?= /opt/pylon5

# Build tools and flags
LD         := $(CXX)
CPPFLAGS   := $(shell $(PYLON_ROOT)/bin/pylon-config --cflags)
CXXFLAGS   := #e.g., CXXFLAGS=-g -O0 for debugging
LDFLAGS    := $(shell $(PYLON_ROOT)/bin/pylon-config --libs-rpath)
LDLIBS     := $(shell $(PYLON_ROOT)/bin/pylon-config --libs) -L/usr/local/lib

# Rules for building
all: $(NAME)

$(NAME): $(NAME).o
    $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

$(NAME).o: $(NAME).cpp
    $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<

clean:
    $(RM) $(NAME).o $(NAME)
-------------------------------------------------------------------------------------
출처 : https://github.com/chili-epfl/qml-cvcamera/issues/8

-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------

혹은 .bashrc에 다음과 같은 구문을 추가한다.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
----------------------------------------------------------------
출처:https://stackoverflow.com/questions/12335848/opencv-program-compile-error-libopencv-core-so-2-4-cannot-open-shared-object-f 

댓글 없음:

댓글 쓰기