我正在嘗試使用 CGO 來使用 realsense2.dll(英特爾的 RealSense 相機(jī)庫)。我在 Windows 11 x64 上。當(dāng)我的目錄布局為:rs2test去.modrealsense2.dllcontext.go(C 代碼的包裝器)devicelist.go(C 代碼的包裝器)error.go(C 代碼的包裝器)main.go在 C 代碼文件的每個(gè)包裝器中,我有以下指令:/*#cgo CFLAGS: -I../../../include/librealsense2#cgo LDFLAGS: -L${SRCDIR} -lrealsense2#include "../../../include/librealsense2/rs.h"#include "../../../include/librealsense2/h/rs_context.h"#include "../../../include/librealsense2/h/rs_pipeline.h"#include "../../../include/librealsense2/h/rs_option.h"#include "../../../include/librealsense2/h/rs_frame.h"*/但是,當(dāng)我嘗試將包裝文件放入自己的包中時(shí),如下所示:rs2testrs2/context.gors2/devicelist.gors2/error.gors2/realsense2.dll去.modmain.go并將指令更改為:#cgo CFLAGS: -I../../../../include/librealsense2#cgo LDFLAGS: -L${SRCDIR} -lrealsense2#include "../../../../include/librealsense2/rs.h"#include "../../../../include/librealsense2/h/rs_context.h"#include "../../../../include/librealsense2/h/rs_pipeline.h"#include "../../../../include/librealsense2/h/rs_option.h"#include "../../../../include/librealsense2/h/rs_frame.h"我得到退出狀態(tài) 0xc0000135 谷歌說這意味著應(yīng)用程序未能正確初始化。我也試過 -L${SRCDIR}/rs2 但它說 -lrealsense2 沒有找到。
- 1 回答
- 0 關(guān)注
- 144 瀏覽
添加回答
舉報(bào)
0/150
提交
取消