goland go modules enable the compiler can not find the project go cgo dependent .c or .h file problem solved one case

Development tools goland, golang version 1.13, projects which used cgo, with a specific point of operation oracle of godror, this component library is written c language, the need to use a series of .c and .h files compiler to complete compilation process.

Project which started go modules, later go mod vendor development tools inside can not see any of .c or .h files, as follows:

Only .go files and other documents, no odpi to use the .c and .h files, compile-time error:

error fatal: 'dpiImpl.h' File not found
#include "dpiImpl.h"
can not find the file dpiImpl.h, repeated attempts to go mod vendor does not solve the problem, and finally suddenly thought, I recently goland once File-> Invalidate caches / Restart operations, certainly some of the files are cleared away, from the cache strange is my another project also uses godror, also in the development tools inside can not see .c and .h file, but the compiler run all the best, explanation is certainly somewhere to compile the results to the cache, looking down along the way the problem will be solved:

File->Settings->Go

 Dep-> Do not select Enable dep integration

Go Modules (vgo), select Enable Go Modules (vgo) integration, the Proxy agents which enter a URL, such as goproxy.cn the like, do the following Vendoring mode is selected, as shown below:

I am here to address is the local agent built nexus, do not control this, you can replace the agent on the line.

Build the project again:

On it.

发布了177 篇原创文章 · 获赞 21 · 访问量 50万+

Guess you like

Origin blog.csdn.net/peihexian/article/details/104653674