编译链接动态链接库生成调用
sudo ldconfig
g++ -std=c++11 -fPIC -g -c least_square_method.cpp -o libleast_square_method.o
g++ -std=c++11 -g -shared -Wl,-soname,libleast_square_method.so -o libleast_square_method.so libleast_square_method.o -lc
sudo cp libleast_square_method.so /usr/local/lib/
g++ -std=c++11 -fPIC -g -c laneIPMso.cpp -o liblaneIPMso.o -I/usr/local/include -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L /usr/local/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lpthread -lopencv_calib3d -lopencv_features2d -lopencv_nonfree -lopencv_objdetect -lleast_square_method
g++ -std=c++11 -g -shared -Wl,-soname,liblaneIPMso.so -o liblaneIPMso.so liblaneIPMso.o -I/usr/local/include -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L /usr/local/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lpthread -lopencv_calib3d -lopencv_features2d -lopencv_nonfree -lopencv_objdetect -lleast_square_method
sudo cp liblaneIPMso.so /usr/local/lib/
g++ -std=c++11 -g testSO.cpp -o laneIPM -llaneIPMso -I/usr/local/include -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L /usr/local/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lpthread -lopencv_calib3d -lopencv_features2d -lopencv_nonfree -lopencv_objdetect -lleast_square_method
./laneIPM