当前位置: 技术问答>linux和unix
有关一个linux.sh
来源: 互联网 发布时间:2016-10-01
本文导语: CC="g++" CFLAGS="-Iinclude -Iaddinc "`pkg-config openssl --cflags` LINKOPT="-L../lib -lncps_apimsg"`pkg-config openssl --cflags` rm -rf addinc/openssl a=`ls -1 src` for i in $a do n=`basename $i .cpp` if [ src/$n.cpp -nt obj/$n.o ] then echo $n $CC $CFLAGS -c...
CC="g++"
CFLAGS="-Iinclude -Iaddinc "`pkg-config openssl --cflags`
LINKOPT="-L../lib -lncps_apimsg"`pkg-config openssl --cflags`
rm -rf addinc/openssl
a=`ls -1 src`
for i in $a
do
n=`basename $i .cpp`
if [ src/$n.cpp -nt obj/$n.o ]
then
echo $n
$CC $CFLAGS -c src/$n.cpp -o obj/$n.o
fi
done
ar rv libncps_apimsg.a obj/*.o
mv obj/CMT*.o lib/
mv obj/cmtmsg.o lib/
ar rv libncps_api.a obj/*.o
mv -f lib/*.o obj/
mv *.a lib/
cd sample
sh linux.sh
echo "make complete"
这样运行后会出现
Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'openssl' found
但是我已经装了openssl路径是/soft/ncps/openssl-0.9.8m
于是我改写了linux.sh
CC="g++"
CFLAGS="-I/usr/include -Iinclude -Iaddinc -I/soft/ncps/openssl-0.9.8m -I/soft/ncps/openssl-0.9.8m/include -I/soft/ncps/"
LINKOPT="-L../lib -lncps_apimsg -L/soft/ncps/openssl-0.9.8m -lssl -lcrypto"
rm -rf addinc/openssl
a=`ls -1 src`
for i in $a
do
n=`basename $i .cpp`
if [ src/$n.cpp -nt obj/$n.o ]
then
echo $n
$CC $CFLAGS -c src/$n.cpp -o obj/$n.o
fi
done
ar rv libncps_apimsg.a obj/*.o
mv obj/CMT*.o lib/
mv obj/cmtmsg.o lib/
ar rv libncps_api.a obj/*.o
mv -f lib/*.o obj/
mv *.a lib/
cd sample
sh linux.sh
echo "make complete"
可是一样找不到openssl的包,求解,谢谢!
CFLAGS="-Iinclude -Iaddinc "`pkg-config openssl --cflags`
LINKOPT="-L../lib -lncps_apimsg"`pkg-config openssl --cflags`
rm -rf addinc/openssl
a=`ls -1 src`
for i in $a
do
n=`basename $i .cpp`
if [ src/$n.cpp -nt obj/$n.o ]
then
echo $n
$CC $CFLAGS -c src/$n.cpp -o obj/$n.o
fi
done
ar rv libncps_apimsg.a obj/*.o
mv obj/CMT*.o lib/
mv obj/cmtmsg.o lib/
ar rv libncps_api.a obj/*.o
mv -f lib/*.o obj/
mv *.a lib/
cd sample
sh linux.sh
echo "make complete"
这样运行后会出现
Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'openssl' found
但是我已经装了openssl路径是/soft/ncps/openssl-0.9.8m
于是我改写了linux.sh
CC="g++"
CFLAGS="-I/usr/include -Iinclude -Iaddinc -I/soft/ncps/openssl-0.9.8m -I/soft/ncps/openssl-0.9.8m/include -I/soft/ncps/"
LINKOPT="-L../lib -lncps_apimsg -L/soft/ncps/openssl-0.9.8m -lssl -lcrypto"
rm -rf addinc/openssl
a=`ls -1 src`
for i in $a
do
n=`basename $i .cpp`
if [ src/$n.cpp -nt obj/$n.o ]
then
echo $n
$CC $CFLAGS -c src/$n.cpp -o obj/$n.o
fi
done
ar rv libncps_apimsg.a obj/*.o
mv obj/CMT*.o lib/
mv obj/cmtmsg.o lib/
ar rv libncps_api.a obj/*.o
mv -f lib/*.o obj/
mv *.a lib/
cd sample
sh linux.sh
echo "make complete"
可是一样找不到openssl的包,求解,谢谢!
|
你的openssl是怎么装的。
你的include路径也有问题,应该把openssl的库放在include上
调整你的pkg-config也是一个解决办法
你的include路径也有问题,应该把openssl的库放在include上
调整你的pkg-config也是一个解决办法