| 发表于:2008-01-23 10:23:181楼 得分:0 |
那个kdevelop版本是3.5的.我在官网上找到的解释是这样 : http://www.kdevelop.org/mediawiki/index.php/faq#how_to_create_a_.so_library.3f how to create a .so library? add a target to the project primary: program prefix: bin file name: libxxx linker flags-> other: -shared -wl,-soname,libxxx.so.1 -o libxxx.so.1.0.1 however, on some systems it results in the following error message during project compilation: -soname command not recognized. if that happens use only -shared -o libxxx.so add the cpp/h files to this target set compiler flags for c++ -fpic there is also a libtool based method: add a sub-project "libxxx" add a target choice "library (libtool)" choice "lib" put your library name "xxx" add your files build the project (use 'build project' or f8). now, you should have a new library named libxxx.so.0.0.0 这两种方法都试了,根本生成的不是.so文件.第一种按照它原本的步骤会报错.创建时在连接选项中加的-shared -wi在目标建立好后的属性中根本没有.自己由重新加了过,生成的是没有后缀名的文件.手动把它改成.so也不行. 第二种方法生成的是.la文件,还是个文本格式的.呃,对linux下编程不熟,不知道这个libtool的.la到底是什么东西. 请教下有谁知道在kdevelop3.5里面怎么生成.so文件啊? | | |
|