@TOC
设置全局变量
- cb_dll_path存放codeblocks安装路径,
/usr/share/codeblocks,仅供参考 - cb_path存放codeblocks源码路径,
/home/hjw/devel/codeblocks,仅供参考 - cb_release_type,和cb_path相同,
/home/hjw/devel/codeblocks,仅供参考 - wxWidgets源码路径,
/home/hjw/devel/wxWidgets-3.0.4,仅供参考, lib路径是/home/hjw/devel/wxWidgets-3.0.4/build_gtk3_shared_monolithic_unicode/lib
准备编译工程
- 先下载好类vim插件 cbVike,地址
- 用codeblocks打开
vike-unix.cbp文件,检查以下各路径是否正确

- 记得在编译器设置添加其他编译选项,不然编译会报各种null、指针啥的未声明的错误

- 点击build开始编译,如果成功的话,将在该路径下生成4个文件
(base) hjw@hjw-Inspiron-7559:~/devel/cbvike-master/build/bin_unix/release$ ls cbVike.cbplugin cbVike.zip libcbVike.cbplugin libcbVike.so (base) hjw@hjw-Inspiron-7559:~/devel/cbvike-master/build/bin_unix/release$
讯享网
此时会报libcbvike.so not found错误,且cbVike.cbplugin压缩包里没有libcbVike.so库文件,是因为vike-unix.cbp文件中zip -9j命令后面用的是libcbvike.so,而实际编译成功后生成的是libcbVike.so,找不到libcbvike.so文件所以生成的cbVike.cbplugin压缩包没有库文件,需要做以下修改:

讯享网<Target title="release"> <Option output="build/bin_unix/release/libcbVike.so" prefix_auto="0" extension_auto="0" /> <Option object_output="build/obj_unix/release/" /> <Option type="3" /> <Option compiler="gcc" /> <Compiler> <Add option="-O2" /> </Compiler> <Linker> <Add option="-s" /> </Linker> <ExtraCommands> <Add after="zip -j9 ./build/bin_unix/release/cbVike.zip manifest.xml" /> <Add after="zip -j9 ./build/bin_unix/release/cbVike.cbplugin ./build/bin_unix/release/libcbVike.so ./build/bin_unix/release/cbVike.zip" /> <Mode after="always" /> </ExtraCommands> </Target>
需要将倒数第5行<Add after="zip -j9 ./build/bin_unix/release/cbVike.cbplugin ./build/bin_unix/release/libcbVike.so ./build/bin_unix/release/cbVike.zip" />,libvike.so改称libVike.so。
- 点击codeblocks
plugins–>manage plugins,install new选择libcbVike.cbplugin

如果没有将生成的cbVike.cbplugin修改成libVike.cbplugin,会报找不到libcbVike.so错误

然而修改完成,最后log后台报以下错误,似乎是missing symbols?
Loaded 0 plugins Info[Warning]: One or more plugins were not loaded. This usually happens when a plugin is built for a different version of the Code::Blocks SDK. Check the application log for more info. List of failed plugins: libcbVike.so /home/hjw/.local/share/codeblocks/plugins/libcbVike.so: not loaded (missing symbols?) Loaded 0 plugins Info[Warning]: One or more plugins were not loaded. This usually happens when a plugin is built for a different version of the Code::Blocks SDK. Check the application log for more info. List of failed plugins: libcbVike.so
麻烦各位大佬看看是啥问题,~/.bashrc添加了export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/.local/share/codeblocks/plugins",然后soure ~/.bashrc仍报以上错误。估计得安装codeblock17版本才匹配这个cbVike插件。
参考资料
- https://blog.csdn.net/weixin_/article/details/
- https://blog.csdn.net/hyman_zh/article/details/





版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/97710.html