Closed zwdong1994 closed 6 years ago
I find out the reason that cause the problem. The sequence of the declaration will cause this problem. For example, at this instance, if I change the sequence of the declaraton in the no_pri_result.go, the error will disapear.
// #cgo CPPFLAGS: -I../../c-deps/libroach/include
// #cgo LDFLAGS: -lroach
// #cgo LDFLAGS: -lrocksdb
// #cgo LDFLAGS: -lprotobuf
// #cgo LDFLAGS: -lsnappy
// #cgo LDFLAGS: -lstdc++
//
// #include <stdlib.h>
// #include <select_from_libroach.h>
In fact, I'm not sure whether this feature is right. However, after the modification of the declaration sequence, the problems were solved.
I have wrote a module in the libroach, and using it in the cockroach. As is the following show:
Functions in the libroach:
How to call it: Go file's positon: cockroach/pkg/newresult/no_pri_result.go
Besides, I also add the director of this file in the build/common.mk. As is following show:
However, there were some compile errors happened. As is following show:
According to the error output, it seemly like I have lost -lstdc++. However, I have added it before the compile. So, what should I do to solve this problem?