so动态链接库的使用

参考的makefile
CC = g++
flag = -c -g -Wall -o
objects = ChenYu.o Dictionary.o Index.o mainProgram.o Poem.o Ranking.o StructedDoc.o \
StructedDocSet.o TDInfo.o WordSegmentor.o TextEntity.o
FullText:$(objects)
    $(CC) -g -Wall -o FullText $(objects) libSeg.a -lPyAnnotator -L ../lib
    cp FullText ../bin
        


TextEntity.o:TextEntity.h
    $(CC) $(flag) TextEntity.o TextEntity.cpp

ChenYu.o:ChenYu.h StructedDoc.h
    $(CC) $(flag) ChenYu.o ChenYu.cpp
    
Dictionary.o:Dictionary.h
    $(CC) $(flag) Dictionary.o Dictionary.cpp  
Index.o:Dictionary.h StructedDocSet.h StructedDoc.h TDInfo.h Index.h
    $(CC) $(flag) Index.o Index.cpp  
mainProgram.o:StructedDocSet.h
    $(CC) $(flag) mainProgram.o mainProgram.cpp  
Poem.o:Poem.h StructedDoc.h
    $(CC) $(flag) Poem.o Poem.cpp  
Ranking.o:Index.h Dictionary.h
    $(CC) $(flag) Ranking.o Ranking.cpp

StructedDoc.o:StructedDoc.h
    $(CC) $(flag) StructedDoc.o StructedDoc.cpp
StructedDocSet.o:StructedDocSet.h WordSegmentor.h
    $(CC) $(flag) StructedDocSet.o StructedDocSet.cpp
TDInfo.o:TDInfo.h
    $(CC) $(flag) TDInfo.o TDInfo.cpp
WordSegmentor.o:WordSegmentor.h
    $(CC) $(flag) WordSegmentor.o WordSegmentor.cpp

clean:
    rm  FullText $(objects)


编译完成后,运行前,还要走这么一步,方能找到动态链接库
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/dev/FullText_test/lib
/dev/FullText_test/lib放置了so动态链接库

转载于:https://www.cnblogs.com/speedmancs/archive/2009/09/24/1573153.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值