golang static lib

go build -x -v -ldflags "-s -w" -buildmode=c-archive -o GoServer.a GoServer.go

 

package main

import "C"
//export verifyLicense
func verifyLicense() {
fmt.Println("hello from golang")
}


cmake
add_library(libGoServer STATIC IMPORTED )
set_target_properties(libGoServer PROPERTIES
IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/GoServer.a")

add_executable(ABOCRServer ${SOURCE_FILES})
target_link_libraries(ABOCRServer ${OpenCV_LIBS} iphlpapi libGoServer)
posted @ 2017-11-07 09:48  飞晨信息  阅读(374)  评论(0)    收藏  举报