ibm-messaging / mq-golang

Calling IBM MQ from Go applications
Apache License 2.0
168 stars 60 forks source link

Erro na compilação do MQ-golang ibmmq #include <cmqc.h> #85

Closed florentinolim closed 5 years ago

florentinolim commented 5 years ago

Please include the following information in your ticket.

[root@dxib02 mqm]# go version

go version go1.9.4 linux/amd64 [root@dxib02 mqm]#

[root@dxib02 gowork]# go install ./src/github.com/ibm-messaging/mq-golang/ibmmq

github.com/ibm-messaging/mq-golang/ibmmq

src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:52:18: fatal error: cmqc.h: No such file or directory

include

              ^

compilation terminated. [root@dxib02 gowork]#

ibmmqmet commented 5 years ago

From the README.md in this repository:

To use code in this repository, you will need to be able to build Go applications, and have a copy of MQ installed to build against. It uses cgo to access the MQI C structures and definitions. It assumes that MQ has been installed in the default location (on a Linux platform this would be /opt/mqm) but this can be changed with environment variables if necessary.

florentinolim commented 5 years ago

Thanks for replying, I'm using linux and I changed the varaiveis to:

cgo !windows CFLAGS: -I/optaplicacoes/ibm/mqm/inc -D_REENTRANT cgo !windows,!darwin LDFLAGS: -L/opt/aplicacoes/ibm/mqm/lib64 -lmqm_r -Wl,-rpath,/opt/mqm/lib64 -Wl,-rpath,/usr/lib64

ed Hat Enterprise Linux Server release 7.5 (Maipo)

include include include include

but the error continues and now it has the following error:

[root@dxib02 gowork]# go install ./src/github.com/ibm-messaging/mq-golang/ibmmq

github.com/ibm-messaging/mq-golang/ibmmq

src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:446:2: could not determine kind of name for C.MQBACK src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:400:2: could not determine kind of name for C.MQBEGIN src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:396:11: could not determine kind of name for C.MQBO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1232:10: could not determine kind of name for C.MQBYTE src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:774:11: could not determine kind of name for C.MQCA_FIRST src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:774:32: could not determine kind of name for C.MQCA_LAST src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:775:12: could not determine kind of name for C.MQCA_NAMES src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1007:19: could not determine kind of name for C.MQCCSI_APPL src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1078:30: could not determine kind of name for C.MQCC_FAILED src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:213:13: could not determine kind of name for C.MQCC_OK src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:202:14: could not determine kind of name for C.MQCHAR src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:992:13: could not determine kind of name for C.MQCHARV src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:304:2: could not determine kind of name for C.MQCLOSE src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:922:13: could not determine kind of name for C.MQCMHO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:424:2: could not determine kind of name for C.MQCMIT src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:175:12: could not determine kind of name for C.MQCNO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:202:2: could not determine kind of name for C.MQCONNX src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:927:2: could not determine kind of name for C.MQCRTMH src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:230:2: could not determine kind of name for C.MQDISC src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:960:2: could not determine kind of name for C.MQDLTMH src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1141:2: could not determine kind of name for C.MQDLTMP src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:956:13: could not determine kind of name for C.MQDMHO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1129:13: could not determine kind of name for C.MQDMPO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:177:6: could not determine kind of name for C.MQENC_NATIVE src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1003:22: could not determine kind of name for C.MQFLOAT32 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1004:22: could not determine kind of name for C.MQFLOAT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:608:2: could not determine kind of name for C.MQGET src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:593:12: could not determine kind of name for C.MQGMO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:87:8: could not determine kind of name for C.MQHCONN src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:107:7: could not determine kind of name for C.MQHMSG src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:977:16: could not determine kind of name for C.MQHM_NONE src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:96:7: could not determine kind of name for C.MQHOBJ src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:761:11: could not determine kind of name for C.MQIA_FIRST src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:761:32: could not determine kind of name for C.MQIA_LAST src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:776:30: could not determine kind of name for C.MQIA_NAME_COUNT src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1174:13: could not determine kind of name for C.MQIMPO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:669:2: could not determine kind of name for C.MQINQ src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1202:2: could not determine kind of name for C.MQINQMP src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1002:20: could not determine kind of name for C.MQINT16 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:999:20: could not determine kind of name for C.MQINT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1001:19: could not determine kind of name for C.MQINT8 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:124:28: could not determine kind of name for C.MQLONG src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:497:11: could not determine kind of name for C.MQMD src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:252:11: could not determine kind of name for C.MQOD src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:261:44: could not determine kind of name for C.MQOO_FAIL_IF_QUIESCING src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:263:2: could not determine kind of name for C.MQOPEN src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:283:24: could not determine kind of name for C.MQOT_TOPIC src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:991:11: could not determine kind of name for C.MQPD src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:498:12: could not determine kind of name for C.MQPMO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1009:19: could not determine kind of name for C.MQPTR src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:512:2: could not determine kind of name for C.MQPUT src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:559:2: could not determine kind of name for C.MQPUT1 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1079:10: could not determine kind of name for C.MQRC_PROPERTY_TYPE_ERROR src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:326:11: could not determine kind of name for C.MQSD src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:892:2: could not determine kind of name for C.MQSET src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1088:2: could not determine kind of name for C.MQSETMP src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:990:13: could not determine kind of name for C.MQSMPO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:365:12: could not determine kind of name for C.MQSRO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:473:2: could not determine kind of name for C.MQSTAT src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:469:12: could not determine kind of name for C.MQSTS src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:335:2: could not determine kind of name for C.MQSUB src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:369:2: could not determine kind of name for C.MQSUBRQ src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1059:18: could not determine kind of name for C.MQTYPE_BOOLEAN src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1068:18: could not determine kind of name for C.MQTYPE_BYTE_STRING src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1046:18: could not determine kind of name for C.MQTYPE_FLOAT32 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1051:18: could not determine kind of name for C.MQTYPE_FLOAT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1041:18: could not determine kind of name for C.MQTYPE_INT16 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1016:18: could not determine kind of name for C.MQTYPE_INT32 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1021:18: could not determine kind of name for C.MQTYPE_INT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1031:18: could not determine kind of name for C.MQTYPE_INT8 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1073:18: could not determine kind of name for C.MQTYPE_NULL src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1055:18: could not determine kind of name for C.MQTYPE_STRING src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:779:19: could not determine kind of name for C.MQ_OBJECT_NAME_LENGTH src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:650:18: could not determine kind of name for C.PMQCHAR src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:929:4: could not determine kind of name for C.PMQHMSG src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:653:10: could not determine kind of name for C.PMQLONG src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:264:4: could not determine kind of name for C.PMQVOID src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:139:3: could not determine kind of name for C.free src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1047:20: could not determine kind of name for C.sizeof_MQFLOAT32 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1052:20: could not determine kind of name for C.sizeof_MQFLOAT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:138:3: could not determine kind of name for C.strncpy

gcc errors for preamble: src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:47:5: error: expected '=', ',', ';', 'asm' or 'attribute' before '!' token cgo !windows CFLAGS: -I/optaplicacoes/ibm/mqm/inc -D_REENTRANT ^

florentinolim commented 5 years ago

Now, i have the folowing problem.

Can you help me?

[root@dxib02 gowork]# go install ./src/github.com/ibm-messaging/mq-golang/ibmmq

github.com/ibm-messaging/mq-golang/ibmmq

src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:444:2: could not determine kind of name for C.MQBACK src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:398:2: could not determine kind of name for C.MQBEGIN src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:394:11: could not determine kind of name for C.MQBO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1230:10: could not determine kind of name for C.MQBYTE src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:772:11: could not determine kind of name for C.MQCA_FIRST src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:772:32: could not determine kind of name for C.MQCA_LAST src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:773:12: could not determine kind of name for C.MQCA_NAMES src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1005:19: could not determine kind of name for C.MQCCSI_APPL src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1076:30: could not determine kind of name for C.MQCC_FAILED src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:211:13: could not determine kind of name for C.MQCC_OK src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:200:14: could not determine kind of name for C.MQCHAR src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:990:13: could not determine kind of name for C.MQCHARV src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:302:2: could not determine kind of name for C.MQCLOSE src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:920:13: could not determine kind of name for C.MQCMHO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:422:2: could not determine kind of name for C.MQCMIT src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:173:12: could not determine kind of name for C.MQCNO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:200:2: could not determine kind of name for C.MQCONNX src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:925:2: could not determine kind of name for C.MQCRTMH src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:228:2: could not determine kind of name for C.MQDISC src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:958:2: could not determine kind of name for C.MQDLTMH src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1139:2: could not determine kind of name for C.MQDLTMP src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:954:13: could not determine kind of name for C.MQDMHO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1127:13: could not determine kind of name for C.MQDMPO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:175:6: could not determine kind of name for C.MQENC_NATIVE src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1001:22: could not determine kind of name for C.MQFLOAT32 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1002:22: could not determine kind of name for C.MQFLOAT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:606:2: could not determine kind of name for C.MQGET src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:591:12: could not determine kind of name for C.MQGMO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:85:8: could not determine kind of name for C.MQHCONN src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:105:7: could not determine kind of name for C.MQHMSG src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:975:16: could not determine kind of name for C.MQHM_NONE src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:94:7: could not determine kind of name for C.MQHOBJ src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:759:11: could not determine kind of name for C.MQIA_FIRST src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:759:32: could not determine kind of name for C.MQIA_LAST src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:774:30: could not determine kind of name for C.MQIA_NAME_COUNT src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1172:13: could not determine kind of name for C.MQIMPO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:667:2: could not determine kind of name for C.MQINQ src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1200:2: could not determine kind of name for C.MQINQMP src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1000:20: could not determine kind of name for C.MQINT16 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1236:10: could not determine kind of name for C.MQINT32 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:997:20: could not determine kind of name for C.MQINT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:999:19: could not determine kind of name for C.MQINT8 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:122:28: could not determine kind of name for C.MQLONG src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:495:11: could not determine kind of name for C.MQMD src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:250:11: could not determine kind of name for C.MQOD src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:259:44: could not determine kind of name for C.MQOO_FAIL_IF_QUIESCING src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:261:2: could not determine kind of name for C.MQOPEN src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:281:24: could not determine kind of name for C.MQOT_TOPIC src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:989:11: could not determine kind of name for C.MQPD src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:496:12: could not determine kind of name for C.MQPMO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1007:19: could not determine kind of name for C.MQPTR src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:510:2: could not determine kind of name for C.MQPUT src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:557:2: could not determine kind of name for C.MQPUT1 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1077:10: could not determine kind of name for C.MQRC_PROPERTY_TYPE_ERROR src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:324:11: could not determine kind of name for C.MQSD src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:890:2: could not determine kind of name for C.MQSET src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1086:2: could not determine kind of name for C.MQSETMP src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:988:13: could not determine kind of name for C.MQSMPO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:363:12: could not determine kind of name for C.MQSRO src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:471:2: could not determine kind of name for C.MQSTAT src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:467:12: could not determine kind of name for C.MQSTS src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:333:2: could not determine kind of name for C.MQSUB src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:367:2: could not determine kind of name for C.MQSUBRQ src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1057:18: could not determine kind of name for C.MQTYPE_BOOLEAN src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1066:18: could not determine kind of name for C.MQTYPE_BYTE_STRING src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1044:18: could not determine kind of name for C.MQTYPE_FLOAT32 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1049:18: could not determine kind of name for C.MQTYPE_FLOAT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1039:18: could not determine kind of name for C.MQTYPE_INT16 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1014:18: could not determine kind of name for C.MQTYPE_INT32 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1019:18: could not determine kind of name for C.MQTYPE_INT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1029:18: could not determine kind of name for C.MQTYPE_INT8 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1071:18: could not determine kind of name for C.MQTYPE_NULL src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1053:18: could not determine kind of name for C.MQTYPE_STRING src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:777:19: could not determine kind of name for C.MQ_OBJECT_NAME_LENGTH src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:648:18: could not determine kind of name for C.PMQCHAR src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:927:4: could not determine kind of name for C.PMQHMSG src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:651:10: could not determine kind of name for C.PMQLONG src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:262:4: could not determine kind of name for C.PMQVOID src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:137:3: could not determine kind of name for C.free src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1045:20: could not determine kind of name for C.sizeof_MQFLOAT32 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:1050:20: could not determine kind of name for C.sizeof_MQFLOAT64 src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:136:3: could not determine kind of name for C.strncpy

ibmmqmet commented 5 years ago

The error seems to be complaining about

cgo !windows CFLAGS: -I/optaplicacoes/ibm/mqm/inc -D_REENTRANT

And that looks like you have deleted the initial '#' from the line. Should be

#cgo !windows ....
florentinolim commented 5 years ago

This is my configuration error is now in the shared library it does not find the directory

I export to variables but dont solve

[root@broker gowork]# export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"

my .bashrc

[root@broker gowork]# cat /root/.bashrc

.bashrc

User specific aliases and functions

alias rm='rm -i' alias cp='cp -i' alias mv='mv -i'

Source global definitions

if [ -f /etc/bashrc ]; then . /etc/bashrc fi export GOROOT=/usr/lib/golang export GOPATH=$HOME/gowork export MQ_INSTALLATION_PATH=/opt/aplicacoes/ibm/mqm export CGO_CFLAGS="-I$MQ_INSTALLATION_PATH/inc" export CGO_LDFLAGS="-L$MQ_INSTALLATION_PATH/lib64 -Wl,rpath=$MQ_INSTALLATION_PATH/lib64" [root@broker gowork]#

[root@broker gowork]# go install ./src/github.com/ibm-messaging/mq-golang/ibmmq

runtime/cgo

/usr/bin/ld: cannot find rpath=/opt/aplicacoes/ibm/mqm/lib64: Arquivo ou diretório não encontrado collect2: error: ld returned 1 exit status [root@broker gowork]# ls /opt/aplicacoes/ibm/mqm/lib64 amq64ax amqzxmr0 libimqc23gl.so.4.1 libmqds_r.so libmqiz.so libmqmcb_r.so libmqmxa_r.so libmqzi.so amq64ax_r compat libimqs23gl_r.so libmqds.so libmqjxds_r.so libmqmcb.so libmqmxa.so libmqz_r.so amqlcelp libcurl.so libimqs23gl_r.so.4.1 libmqecs_r.so libmqjx_r.so libmqmcs_r.so libmqmz1_r.so libmqzsd_r.so amqlcelp_r libedit.so libimqs23gl.so libmqecs.so libmqjxs_r.so libmqmcs.so libmqmzf_r.so libmqzsd.so amqwascx libimqb23gl_r.so libimqs23gl.so.4.1 libmqe_r.so libmqjxx_r.so libmqml_r.so libmqmzf.so libmqz.so amqwasoa libimqb23gl_r.so.4.1 libmqcxa64_r.so libmqe.so libmqmalda_r.so libmqmr_r.so libmqmzse.so amqzaax libimqb23gl.so libmqcxa64.so libmqicb_r.so libmqmaldb_r.so libmqm_r.so libmqutl_r.so amqzaax_r libimqb23gl.so.4.1 libmqcxa_r.so libmqicb.so libmqmax64_r.so libmqmr.so libmqutl.so amqzfu libimqc23gl_r.so libmqcxa.so libmqic_r.so libmqmax64.so libmqm.so libmqxzu_r.so amqzfud libimqc23gl_r.so.4.1 libmqdc_r.so libmqic.so libmqmax_r.so libmqmxa64_r.so libmqxzu.so amqzif_r libimqc23gl.so libmqdc.so libmqiz_r.so libmqmax.so libmqmxa64.so libmqzi_r.so [root@broker gowork]#

*/

cgo windows CFLAGS: -I"C:/Program Files/IBM/MQ/Tools/c/include"

cgo darwin LDFLAGS: -L/opt/mqm/lib64 -lmqm_r -Wl,-rpath,/opt/mqm/lib64 -Wl,-rpath,/usr/lib64

cgo windows LDFLAGS: -L "C:/Program Files/IBM/MQ/bin64" -lmqm

/*

cgo !windows CFLAGS: -I/opt/aplicacoes/ibm/mqm/inc -D_REENTRANT

cgo !windows,!darwin LDFLAGS: -L/opt/aplicacoes/ibm/mqm/lib64 -lmqm_r -Wl,-rpath,/opt/aplicacoes/ibm/mqm/lib64 -Wl,-rpath,/usr/lib64

include include include include

florentinolim commented 5 years ago

Correct patch! But the error still occurs .

I need help this problem I already try all possibilities but dont work.

github.com/ibm-messaging/mq-golang/ibmmq

/bin/ld: cannot find rpath=/opt/aplicacoes/ibm/mqm/lib64: No such file or directory collect2: error: ld returned 1 exit status

Contributors: Mark Taylor - Initial Contribution */

/*

cgo !windows CFLAGS: -I/opt/mqm/inc -D_REENTRANT

cgo windows CFLAGS: -I"C:/Program Files/IBM/MQ/Tools/c/include"

cgo !windows,!darwin LDFLAGS: -L/opt/mqm/lib64 -lmqm_r -Wl,-rpath,/opt/mqm/lib64 -Wl,-rpath,/usr/lib64

cgo darwin LDFLAGS: -L/opt/mqm/lib64 -lmqm_r -Wl,-rpath,/opt/mqm/lib64 -Wl,-rpath,/usr/lib64

cgo windows LDFLAGS: -L "C:/Program Files/IBM/MQ/bin64" -lmqm

*/

cgo !windows CFLAGS: -I/opt/aplicacoes/ibm/mqm/inc -D_REENTRANT

cgo !windows,!darwin LDFLAGS: -L/opt/aplicacoes/ibm/mqm/lib64 -lmqm_r -Wl,-rpath,/opt/aplicacoes/ibm/mqm/lib64 -Wl,-rpath,/usr/lib64

include

include

include

include

import "C"

import ( "encoding/binary" "io" "strings" "unsafe" )

cbrdy commented 5 years ago

I have the same error too.

$ go install ./src/github.com/ibm-messaging/mq-golang/ibmmq
src/github.com/ibm-messaging/mq-golang/ibmmq/mqi.go:52:18: fatal error: cmqc.h: No such file or directory

include

              ^

compilation terminated.

ibmmqmet commented 5 years ago

The build shell scripts and Dockerfile in the repositories show how you can create a correct build environment, ensuring the MQ client and SDK are available for compilation.