如何将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的库文件放到本地指定库目录吗?

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com