Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to build the MQ_exporter #20

Closed
patrickschilderING opened this issue Oct 18, 2019 · 2 comments
Closed

Not able to build the MQ_exporter #20

patrickschilderING opened this issue Oct 18, 2019 · 2 comments

Comments

@patrickschilderING
Copy link

patrickschilderING commented Oct 18, 2019

Hi,

I'm trying to compile release "Update for MQ V9.1.3"
I have installed MQ libraries "9.1.0.3-IBM-MQC-Redist-LinuxX64.tar" under /opt/mqm/

When compiling i get the following error message:
# github.com/ibm-messaging/mq-golang/mqmetric
../../src/github.com/ibm-messaging/mq-golang/mqmetric/channel.go:259:44: undefined: ibmmq.MQCFH
../../src/github.com/ibm-messaging/mq-golang/mqmetric/discover.go:65:26: undefined: ibmmq.MQObject

I used the following commands to compile:

export GOROOT=/usr/local/go
export GOPATH=$HOME/projects/mq_exporter
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
export PATH=$GOPATH:$GOROOT:$PATH
export MQ_INSTALLATION_PATH=/opt/mqm
export CGO_CFLAGS="-I$MQ_INSTALLATION_PATH/inc"
export CGO_LDFLAGS="-L$MQ_INSTALLATION_PATH/lib64 -Wl,-rpath,$MQ_INSTALLATION_PATH/lib64"
export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"

cd $HOME/projects/mq_exporter/cmd/mq_prometheus
env GOOS=windows GOARCH=amd64 go build *.go
@ibmmqmet
Copy link
Collaborator

Apart from anything else, you appear to be trying to cross-compile for Windows on a Linux machine. That's not going to work as the MQ libraries are platform-specific.

And your paths do not look right - I would expect to see "src/github.com/ibm-messaging" somewhere in them. As you would get from the instructions in the README:
git clone https://github.com/ibm-messaging/mq-metric-samples.git src/github.com/ibm-messaging/mq-metric-samples

@patrickschilderING
Copy link
Author

Thanks for the feedback. The issue was indeed related to cross compiling. When compiling the code on windows the build was successful.
The issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants