简体   繁体   English

如何在Eclipse中将C项目与C ++静态库(使用opencv)链接

[英]How to link a C project with a C++ static library(using opencv) in eclipse

I have created a c++ static library in eclipse which is using opencv .It is build fine and I want to include it in another c project in the same workspace. 我在使用opencv的 eclipse中创建了一个c ++静态库,它构建良好,我想将其包含在同一工作区的另一个c项目中。

Trying with 尝试

1)I have included library path in properties->c/c++ build->setting ->GCC C compiler ->Includes ->" path of project ". 1)我已经在属性-> c / c ++ build->设置-> GCC C编译器->包含->“ 项目路径 ”中包含库路径。

2)properties->c/c++ build->setting ->GCC C Linker-> Libraries ->Liraries(-i)->" Name of Lib " 3).properties->c/c++ build->setting ->GCC C Linker-> Libraries ->Liraries(-i)->" path of Lib " 2)properties-> c / c ++ build->设置-> GCC C Linker->库-> Liraries(-i)->“ 库名称 ”“ 3).properties-> c / c ++ build-> setting-> GCC C链接器->库-> Liraries(-i)->“ 库路径

But,this is not working while running the c project cannot find the static library functions giving error -"UNDEFINED REFERENCE TO THE FUNCTION" 但是,这在运行c项目时无法正常工作,无法找到给出错误的静态库函数-“功能的未定义引用”

Suggest a way to solve the problem. 提出解决问题的方法。 Thanks in advance. 提前致谢。

Got the answer. 得到了答案。

These are the files needed to include "${workspace_loc:/staticLibrary}" MSDK/include /IPP_Legacy/x64/include Levmar/x64/include /opencv/lib opengl/x64/include/GL Tesseract/x64/include/tesseract freeGLUT/x64/include/GL /ffmpeg/x64/include/libavcodec compilers_and_libraries_2016.3.210/linux/ipp/include compilers_and_libraries_2016.3.210/linux/mkl/include compilers_and_libraries_2016.3.210/linux/tbb/include compilers_and_libraries_2016.3.210/linux/daal/include 这些是包含“ $ {workspace_loc:/ staticLibrary}”所需的文件MSDK / include / IPP_Legacy / x64 / include Levmar / x64 / include / opencv / lib opengl / x64 / include / GL Tesseract / x64 / include / tesseract freeGLUT / x64 / include / GL / ffmpeg / x64 / include / libavcodec编译器_and_libraries_2016.3.210 / linux / ipp / include编译器_and_libraries_2016.3.210 / linux / mkl / include编译器_and_libraries_2016.3.210 / linux / tbb / include编译器_and_libraries_2016.3.210 / linux / da

After these inclusion I faced a error of /usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line for which I got help from the link http://i0.wp.com/omtlab.com/wp-content/uploads/2013/07/4.png 这些包含之后,我遇到了/usr/lib/x86_64-linux-gnu/libstdc++.so.6的错误:添加符号错误:命令行缺少DSO,我从链接http://i0.wp获得了帮助。 com / omtlab.com / wp-content / uploads / 2013/07 / 4.png

now the program is working all fine Thank you 现在程序运行正常了,谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM