我在尝试执行时遇到如下问题报告。我应该去哪里让它知道在哪里找到.so lib在$ {HOME} / projects / OpenImageIO / dist / linux64 / lib下?
开始:/ home / chaoren / Dropbox / hw2 / hw2_3 / home / chaoren / Dropbox / hw2 / hw2_3:加载共享库时出错:libOpenImageIO.so.1.2:无法打开共享对象文件:没有这样的文件或目录
我通过导入我的Makefile
来构建这个项目OFILES = Matrix.o LinearAlgebra.o PerlinNoise.o Camera.o OIIOFiles.o Image.o Utilities.o Grid.o SparceGrid.o VolumeOperations.o Ray.o Face.o Line.o Lights.o Group.o PolySurf.o File.o OBJFile.o Vector.o
AFILES = $(OFILES)
ROOTDIR = .
LIB = $(ROOTDIR)/libVR.a
LINKS = Magick++-config --cppflags --cxxflags --ldflags --libs -lm -lOpenImageIO -L/usr/local/lib -L${HOME}/projects/OpenImageIO/dist/linux64/lib
INCLUDES = Magick++-config --cppflags --cxxflags -I${HOME}/projects/OpenImageIO/dist/linux64/include
CXX = g++ -Wall -g -O2 -D_THREAD_SAFE -pthread -fopenmp
.C.o:
$(CXX) -c $(INCLUDES) $<
all: $(AFILES)
ar rv $(LIB) $?
hw2_1: hw2_1.C
$(CXX) hw2_1.C $(INCLUDES) $(LIB) $(LINKS) -o hw2_1
hw2_2: hw2_2.C
$(CXX) hw2_2.C $(INCLUDES) $(LIB) $(LINKS) -o hw2_2
hw2_3: hw2_3.C
$(CXX) hw2_3.C $(INCLUDES) $(LIB) $(LINKS) -o hw2_3
noiseimage: noiseimage.C
$(CXX) noiseimage.C $(INCLUDES) $(LIB) $(LINKS) -o noiseimage
clean:
rm -f *.o *.gch core $(LIB) vr vrppm *~ vRender hw2_1 hw_2 hw2_3
答案 0 :(得分:0)
KDevelop4使用CMake作为其默认构建系统。在CMake中,所有库和其他程序元素都在特殊文件(CMakeLists.txt)中标识。然后该文件成为实际构建可执行文件的make文件的基础。