//**************************main 文件*****************************
package main
/*
#include ".\libinc\BL5460Tools.h"
#include ".\libinc\DeviceMgr.h"
#include ".\inc\SelfDebugPaltformView.h"
#include ".\inc\CfgAutoTune.h"
#cgo CFLAGS: -I .\libinc
#cgo CFLAGS: -I .\inc
#cgo LDFLAGS: -L .\lib
*/
import "C"
func main() {
C.DEVMGR_Open("xxxxx", DEVMGR_RIGHTS_READ|DEVMGR_RIGHTS_WRITE|DEVMGR_RIGHTS_OVERLAPPED)
}
//*************************输出********************************************************************************
# _/D_/go-work/IICDDD/goIIC/src
C:\Users\vincent\AppData\Local\Temp\go-build529751362\_\D_\go-work\IICDDD\goIIC\src\_obj\t1.cgo2.o: In function `cgo_befb8c42c7a6_Cfunc_DEVMGR_Open':
D:/go-work/IICDDD/goIIC/src/t1.go:56: undefined reference to `DEVMGR_Open@8'
collect2.exe: error: ld returned 1 exit status
#cgo LDFLAGS: -L .\lib 这个目录下全是.lib文件,没有源码。在vs2010下都可以正常使用。不知道go总是找不到函数,为啥?
有疑问加站长微信联系(非本文作者)