英文:
Use SWIG to wrap OpenCV's C++ API in GO
问题
我正在尝试使用SWIG来封装OpenCV的C++ API。目前,我已经在系统中安装了OpenCV。我的问题是:
-
是否可以在不将它们放入SWIG文件所在目录的情况下封装“系统级”库?例如,我的OpenCV头文件位于
/usr/local/opt/opencv/opencv2/opencv.hpp
。我可以在SWIG中使用%include "opencv2/opencv.hpp"
吗? -
我应该如何开始这项工作?我应该先封装常量吗?
谢谢。
英文:
I'm trying to use SWIG to wrap OpenCV's C++ API. For now, I have system-wise OpenCV installed. My questions are:
-
Is it possible to wrap "system-wise" library without putting them into the same directory of my SWIG files? For example, my opencv's header files are in
/usr/local/opt/opencv/opencv2/opencv.hpp
. Can I use%include "opencv2/opencv.hpp"
in SWIG? -
How should I start with this work? Should I wrap the CONSTANTs first?
thanks.
答案1
得分: 1
你可以包含任何你喜欢的头文件。它不一定要在同一个目录下。
我建议首先考虑你想要向Go程序提供的API。一个好的Go API通常与一个好的C API不同。
英文:
You can %include any header file you like. It doesn't have to be in the same directory.
I would start by thinking about the API you want to present to Go programs. A good Go API is often different from a good C API.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论