How to include the library in the compilation path?

I read this post about go and tried to compile the source code here

I downloaded the source code, compiled the first file with make , and I see that the object is generated:

 $pwd /Users/oscarryz/code/go/rsc/rosetta/graph $ls -ltR total 136 -rw-r--r-- 1 oscarryz staff 61295 Sep 17 16:20 _go_.6 drwxr-xr-x 3 oscarryz staff 102 Sep 17 16:20 _obj -rw-r--r-- 1 oscarryz staff 126 Sep 17 16:17 Makefile -rw-r--r-- 1 oscarryz staff 2791 Sep 17 16:17 graph.go ./_obj: total 0 drwxr-xr-x 3 oscarryz staff 102 Sep 17 16:20 rsc.googlecode.com ./_obj/rsc.googlecode.com: total 0 drwxr-xr-x 3 oscarryz staff 102 Sep 17 16:20 hg ./_obj/rsc.googlecode.com/hg: total 0 drwxr-xr-x 3 oscarryz staff 102 Sep 17 16:20 rosetta ./_obj/rsc.googlecode.com/hg/rosetta: total 136 -rw-r--r-- 1 oscarryz staff 68486 Sep 17 16:20 graph.a 

There is no my question, how can I refer to this compiled code from the maze directory:

 /Users/oscarryz/code/go/rsc/rosetta/maze/maze.go 

Whose import declarations are:

 import ( "bytes" "fmt" "rand" "time" "rsc.googlecode.com/hg/rosetta/graph" ) 

And right now, the error message cannot be compiled:

 6g -o _go_.6 maze.go maze.go:20: can't find import: rsc.googlecode.com/hg/rosetta/graph make: *** [_go_.6] Error 1 
+4
source share
1 answer

Well, I found this was not so difficult.

6g flags: -I DIR search for packets in DIR

I have to specify the -I option as follows:

 6g -I ../graph/_obj/ -o _go_.6 maze.go 
+3
source

All Articles