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

errors while compiling cross platform from Linux to Windows #210

Open
krishna9081 opened this issue Feb 26, 2024 · 5 comments
Open

errors while compiling cross platform from Linux to Windows #210

krishna9081 opened this issue Feb 26, 2024 · 5 comments

Comments

@krishna9081
Copy link

krishna9081 commented Feb 26, 2024

Please include the following information in your ticket.

  • Version information for MQ, mq-golang, Go compiler
    MQ
    Name: IBM MQ
    Version: 9.3.4.1
    Level: p934-001-231123
    BuildType: IKAP - (Production)
    Platform: IBM MQ for Linux (x86-64 platform)
    Mode: 64-bit
    O/S: Linux 5.15.133.1-microsoft-standard-WSL2
    O/S Details: Ubuntu 22.04.1 LTS (Jammy Jellyfish)
    InstName: MQNI93L23112300P
    InstDesc: IBM MQ V9.3.4.1 (Redistributable)
    Primary: N/A

Go version: v1.18.1

Compiler : x86_64-w64-mingw32-gcc

GCCGO="gccgo"

  • A small code sample that demonstrates the issue.

❯ CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CGO_LDFLAGS="-L$MQ_INSTALLATION_PATH/lib64 -Wl,-rpath,$MQ_INSTALLATION_PATH/lib64" go build -o mqget.exe mqget.go
github.com/ibm-messaging/mq-golang/v5/ibmmq
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lmqm: No such file or directory
collect2: error: ld returned 1 exit status

@ibmmqmet
Copy link
Collaborator

If you're going to try to cross-compile, you need to point at the Windows MQ client include/library directories. Look at ibmmq/mqi.go for the usual LDFLAGS/CFLAGS needed for Windows. And then you'd have to map your Windows MQ installation directory to however WSL sees it. Though I've not tried cross-compiles, so don't know how successful it might be.

@krishna9081
Copy link
Author

krishna9081 commented Feb 26, 2024

Thanks Mark
I tried from a Windows system, but I am getting the below errors ...not sure if I'm doing something wrong, can you guide me

image

@ibmmqmet
Copy link
Collaborator

That looks like you're mixing up powershell and traditional command prompt operations.

@krishna9081
Copy link
Author

Thanks again Mark! ... Indeed I was mixing up PS and command prompt. I was able to do a windows build , but getting a new blocker now ...am I missing any thing ?
image

These are the Flags I'm using
image

@zemlya25
Copy link

Did you install mqm on windows machine? if it's installed check all path and ensure it contains path to dll
It's all about dynamic linking

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

3 participants