如何将openssl,uuid和crypto的库文件放到本地指定库目录
发布网友
发布时间:2022-04-25 19:44
我来回答
共2个回答
热心网友
时间:2022-06-16 20:20
1. 编译过程中去掉-static选项;
[plain] view plaincopyprint?
CC = arm-linux-g++
CC-EW = arm-linux-gcc
CCFLAGS = -g3 -Wall -o0 -I../../../tools/eldk42/arm/usr/include/ -I../../../tools/eldk42/arm/usr/include/C++/4.2.2/ -I./energywise/include/
CCFLAGS-EW = -g3 -Wall -o0 -I../../../tools/eldk42/arm/usr/include/ -I../../../tools/eldk42/arm/usr/include/C++/4.2.2/ -I./energywise/include/ -I./energywise/ref_agent/ -I./energywise/src -I\openssl -I.
LDFLAGS = -L../../../tools/lib/ -lpthread -lCiscoEnergyWiseSdk
RM = rm -f
SOURCES_CPP = main.cpp model.cpp modelc.cpp IniFile.cpp \
ClientSocket.cpp Thread.cpp SensorReader.cpp \
LcdWriter.cpp Monitor.cpp Helper.cpp Mutex.cpp serial.cpp
OBJECTS = $(SOURCES_CPP:%.cpp=%.o) RefAgent.o
all: p
.PHONY : all
%.o: %.cpp
$(CC) $(CCFLAGS) -c $< -o $@
RefAgent.o: ./energywise/ref_agent/RefAgent.c
$(CC-EW) $(CCFLAGS-EW) -c ./energywise/ref_agent/RefAgent.c -o RefAgent.o
p : $(OBJECTS)
$(CC) $(LDFLAGS) -static -o p $(OBJECTS)
把最后一行中的-static去掉,变成
[plain] view plaincopyprint?
CC = arm-linux-g++
CC-EW = arm-linux-gcc
CCFLAGS = -g3 -Wall -o0 -I../../../tools/eldk42/arm/usr/include/ -I../../../tools/eldk42/arm/usr/include/C++/4.2.2/ -I./energywise/include/
CCFLAGS-EW = -g3 -Wall -o0 -I../../../tools/eldk42/arm/usr/include/ -I../../../tools/eldk42/arm/usr/include/C++/4.2.2/ -I./energywise/include/ -I./energywise/ref_agent/ -I./energywise/src -I\openssl -I.
LDFLAGS = -L../../../tools/lib/ -lpthread -lCiscoEnergyWiseSdk
RM = rm -f
SOURCES_CPP = main.cpp model.cpp modelc.cpp IniFile.cpp \
ClientSocket.cpp Thread.cpp SensorReader.cpp \
LcdWriter.cpp Monitor.cpp Helper.cpp Mutex.cpp serial.cpp
OBJECTS = $(SOURCES_CPP:%.cpp=%.o) RefAgent.o
all: p
.PHONY : all
%.o: %.cpp
$(CC) $(CCFLAGS) -c $< -o $@
RefAgent.o: ./energywise/ref_agent/RefAgent.c
$(CC-EW) $(CCFLAGS-EW) -c ./energywise/ref_agent/RefAgent.c -o RefAgent.o
p : $(OBJECTS)
$(CC) $(LDFLAGS) -o p $(OBJECTS)
在本地库目录../../../../tools/lib中,既有静态库文件*.a供静态链接使用,又有*.so和其符号链接供动态链接使用;
热心网友
时间:2022-06-16 20:20
您好,请问您是想知道如何将openssl,uuid和crypto的库文件放到本地指定库目录吗?