全部博文(2005)
分类: LINUX
2010-04-09 17:16:34
chinaunix网友2010-06-19 09:17:50
我测试过了,在编译时设置LD_LIBRARY_PATH没有用的,该值只是在运行时有效。 zcx@zcx-laptop:~/study/dllstudy/test2$ export LD_LIBRARY_PATH=`pwd` zcx@zcx-laptop:~/study/dllstudy/test2$ echo $LD_LIBRARY_PATH /home/zcx/study/dllstudy/test2 zcx@zcx-laptop:~/study/dllstudy/test2$ gcc -o test test.c -ltest /usr/bin/ld: cannot find -ltest collect2: ld returned 1 exit status zcx@zcx-laptop:~/study/dllstudy/test2$ gcc -o test test.c -L. -ltest zcx@zcx-laptop:~/study/dllstudy/test2$ ./test