{"action":"opened","issue":{"url":"https://api.github.com/repos/shadowmint/go-static-linking/issues/2","labels_url":"https://api.github.com/repos/shadowmint/go-static-linking/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/shadowmint/go-static-linking/issues/2/comments","events_url":"https://api.github.com/repos/shadowmint/go-static-linking/issues/2/events","html_url":"https://github.com/shadowmint/go-static-linking/issues/2","id":59461796,"number":2,"title":"Unable to set a os env variable in #cgo directive","user":{"login":"avikalar","id":9191712,"avatar_url":"https://avatars.githubusercontent.com/u/9191712?v=3","gravatar_id":"","url":"https://api.github.com/users/avikalar","html_url":"https://github.com/avikalar","followers_url":"https://api.github.com/users/avikalar/followers","following_url":"https://api.github.com/users/avikalar/following{/other_user}","gists_url":"https://api.github.com/users/avikalar/gists{/gist_id}","starred_url":"https://api.github.com/users/avikalar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avikalar/subscriptions","organizations_url":"https://api.github.com/users/avikalar/orgs","repos_url":"https://api.github.com/users/avikalar/repos","events_url":"https://api.github.com/users/avikalar/events{/privacy}","received_events_url":"https://api.github.com/users/avikalar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-02T10:15:14Z","updated_at":"2015-03-02T10:15:14Z","closed_at":null,"body":"Hi, \r\n\r\nI have been trying to include an os env variable as part of the CGO build, but when I add path as \r\n\r\n```\r\n// #cgo linux CFLAGS: -I $LIBHOME/include\r\n// #cgo linux LDFLAGS: -L $LIBHOME/lib\r\n```\r\n\r\ngo build . gives me header file not found, whereas when I try using \r\n\r\n```\r\n// #cgo linux CFLAGS: -I ${LIBHOME}/include\r\n// #cgo linux LDFLAGS: -L ${LIBHOME}/lib\r\n```\r\nthe build returns a malformed cgo parameter error. In both cases I am unable to set the library path using an environment variable. Then, I bumped into your thread in stackoverflow(http://stackoverflow.com/questions/16747021/how-do-you-statically-link-a-c-library-in-go-using-cgo) and it seems to be working for you. Can you please help me out here ?\r\n\r\nThanks in advance,\r\nAvinash K"}}