qamel
qamel copied to clipboard
can't load package
When I run qamel build
in project qamel-hn
, I encountered the following error remind
can't load package: package qamel-hn: /Users/barry/gopath/src/qamel-hn/qamel-cgo-main.go: malformed #cgo argument: $(foreach
and My operating system is mac
My situation is the same as yours
These arguments are from a temporary makefile generated from qmake
invokation here. The resulted makefile looks like this:
EXPORT_VALID_ARCHS = x86_64
EXPORT_ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
EXPORT_ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
Normally make
would take care of expanding these function calls, but Go tools cannot. I suppose a direct fix would be to replace EXPORT_ARCH_ARGS
with -arch
+ profile.Arch
.
But after I added these codes on line 136 of internal/generator/cgo.go, I would report the error of null pointer reference.as the picture shows.
I have recompiled qamel after adding the code, and it still does not work.
My operating system is windows10.
Hmmm, that's weird, I've tested numerous times on macOS that my fix works. Stack trace in your screenshot indicates the panic happens before invoking qmake
, so I don't think it's related to my fix at all.
Can you please test again without adding the fix and see what happens?
Also your profile has target OS set to darwin
, but I doubt that would work.
I switched to mac for compilation and it succeeded immediately!
:))))))))))))))))
Originally, I thought that I would no longer support the mac platform, but it was solved, thanks for giving!
Now our software has supported windows, linux and mac operating systems.
Thanks again!