Windows Compilation Trouble

1,140 views
Skip to first unread message

gjwat...@gmail.com

unread,
Oct 2, 2013, 5:48:47 PM10/2/13
to go-...@googlegroups.com
Should "pkg-config.exe" be installed separately in addition to MinGW?

I've installed the 32-bit 4.8.1 version of MinGW from here: http://sourceforge.net/projects/mingw/files/latest/download , and the Qt 5.1.1 windows installer from here: http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-windows-opensource-5.1.1-mingw48_opengl-x86-offline.exe , and added the following paths:

CPATH += C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include;C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore\5.1.1\QtCore
LIBRARY_PATH += C:\Qt\Qt5.1.1\5.1.1\mingw48_32\lib
PATH += C:\Qt\Qt5.1.1\5.1.1\mingw48_32\bin

...however, I'm receiving the following error when attempting to compile the particle example with go 1.2rc1:

# pkg-config --cflags Qt5Core Qt5Widgets Qt5Quick glib-2.0
exec: "pkg-config": executable file not found in %PATH%

...running "where pkg-config.exe" turns up nothing and a system-wide search failed to find the program.  I've searched for a missing package in the mingw-get-setup utility, but have not found any package that would provide the "pkg-config.exe" program.  Should this program be downloaded separately?

Thanks in advance.

gjwat...@gmail.com

unread,
Oct 2, 2013, 5:51:21 PM10/2/13
to go-...@googlegroups.com
Just to add to the previous post, C:\MinGW\bin *has* been added to the system %PATH%.

Thanks again.

Gustavo Niemeyer

unread,
Oct 2, 2013, 6:03:17 PM10/2/13
to gjwat...@gmail.com, go-...@googlegroups.com
Eivind, do you have an idea about what might be wrong in his setup?
> --
> You received this message because you are subscribed to the Google Groups
> "go-qml" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to go-qml+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--

gustavo @ http://niemeyer.net

André Paquet

unread,
Oct 2, 2013, 8:19:42 PM10/2/13
to go-...@googlegroups.com
Had the same problem. Looked around the internet to find the file somewhere. Found it, put it in Mingw\bin only to have a new error of the same kind, and then another. I stopped trying at this point.

Gustavo Niemeyer

unread,
Oct 2, 2013, 9:13:36 PM10/2/13
to André Paquet, go-...@googlegroups.com
If someone does find out the proper instructions, please let us know
so we can fix the README.

gjwat...@gmail.com

unread,
Oct 3, 2013, 11:52:02 AM10/3/13
to go-...@googlegroups.com
I believe I'm close.

Downloaded the following:

1. qt-5.1.1-x64-mingw481r2-opengl.exe ( http://sourceforge.net/projects/qtx64/files/qt-x64/5.1.1/mingw-4.8/qt-5.1.1-x64-mingw481r2-opengl.exe/download )
2. glib-dev_2.26.1-1_win64.zip ( http://ftp.gnome.org/pub/gnome/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip )
3. (MinGW) x64-4.8.1-release-posix-seh-rev5.7z ( http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/64-bit/threads-posix/seh/x64-4.8.1-release-posix-seh-rev5.7z/download )
4. pkg-config-lite-0.28-1_bin-win32.zip ( http://sourceforge.net/projects/pkgconfiglite/files/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip/download )

Ran the (1) Qt installer and accepted the defaults.
Extracted the (2) glib-dev installer to "C:\glib-dev_2.26.1-1_win64".
Extracted the (3) MinGW software to "C:\MinGW64".
Extracted (4) pkg-config-lite's "pkg-config.exe" to "C:\MinGW64\bin" and copied its "aclocal" subfolder to "C:\MinGW64\share".

I created a CPATH environment variable with the following paths:

C:\Qt\qt-5.1.1-x64-mingw-opengl\qt-5.1.1-x64-mingw-opengl\include;C:\Qt\qt-5.1.1-x64-mingw-opengl\qt-5.1.1-x64-mingw-opengl\include\QtCore\5.1.1\QtCore

I created a PKG_CONFIG_PATH environment variable with the following paths:

C:\Qt\qt-5.1.1-x64-mingw-opengl\qt-5.1.1-x64-mingw-opengl\lib\pkgconfig;C:\glib-dev_2.26.1-1_win64\lib\pkgconfig

I appended the following paths to the PATH environment variable:

C:\MinGW64\bin;C:\Qt\qt-5.1.1-x64-mingw-opengl\qt-5.1.1-x64-mingw-opengl\bin

The console was restarted and I attempted to recompile the particle QML sample, which failed with the following message:

# github.com/niemeyer/qml
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lintl
collect2.exe: error: ld returned 1 exit status

The problem now appears that the "intl" library is missing.  I am still researching...

Gustavo Niemeyer

unread,
Oct 3, 2013, 12:55:10 PM10/3/13
to gjwatersjr, go-...@googlegroups.com
As a data point, that intl library comes from one of these packages
you downloaded, as it's not explicitly referenced by the qml package.

By the way, have you seen the notes about MinGW 64bit linked here in
the list in a recent thread:

http://qt-project.org/wiki/MinGW-64-bit

This makes it sound like the 32bit versions might give you an easier ride.

I'm also quite curious about how the Eivind seemed to have such a
smooth ride installing it on Windows.

André Paquet

unread,
Oct 3, 2013, 2:31:31 PM10/3/13
to go-...@googlegroups.com
Can't test it at the moment, but libintl is part of gettext I believe, which can be download from the third party section here: http://www.gtk.org/download/win64.php . But, the link to gettext binaries is broken so you can really find it here: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip

Hope this help.

gjwat...@gmail.com

unread,
Oct 4, 2013, 1:05:57 PM10/4/13
to go-...@googlegroups.com
André,

I tried installing "libintl-8.dll" into the "C:\MinGW\bin" folder and did not have any luck compiling.  "Ld" still complains that it cannot find -lintl.  Do you know where the dll should be placed, or, if any additional environment variables which need to be set?

Thanks in advance.

André Paquet

unread,
Oct 4, 2013, 1:35:32 PM10/4/13
to go-...@googlegroups.com
I found out it wasn't the right file. Look instead for libintl.a (to be put in the lib folder of your mingw installation if I recall) in the proxy-libintl package in the first link of my email (http://www.gtk.org/download/win64.php). I still hit a wall soon after finding this out. Although the examples compiled, some entry point in libstdc++.dll or something similar wasn't found when launching a compiled binary.

After toying a little bit last evening, I think the way to go is to use the mingw environment bundled with the QT you linked (that may have explained my problems with the dll). The bundled mingw misses pkg-config and maybe the same other files than the standalone mingw. 

When I then go get the package, I hit a compilation error introduced in the latest commit (see issue #11 I believe) so I went to bed with the goal to try again today or in the week-end.

Hope this helps, sorry for misleading you and others.

André

gjwat...@gmail.com

unread,
Oct 4, 2013, 2:01:42 PM10/4/13
to go-...@googlegroups.com
Thanks, André.  After extracting proxy-libintl ( http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/proxy-libintl-dev_20090911_win64.zip ) into C:\MinGW64 the now compilation proceeds further before erroring.  Below is the error at which compilation currently halts:


# github.com/niemeyer/qml
In file included from ..\..\github.com\niemeyer\qml\all.cpp:2:0:
..\..\github.com\niemeyer\qml\cpp/capi.cpp: In function 'void windowShow(QQuickWindow_*)':
..\..\github.com\niemeyer\qml\cpp/capi.cpp:179:22: error: expected type-specifier before 'ShowWindow'
     reinterpret_cast<ShowWindow *>(win)->show();
                      ^
..\..\github.com\niemeyer\qml\cpp/capi.cpp:179:22: error: expected '>' before 'ShowWindow'
..\..\github.com\niemeyer\qml\cpp/capi.cpp:179:22: error: expected '(' before 'ShowWindow'
..\..\github.com\niemeyer\qml\cpp/capi.cpp:179:34: error: expected primary-expression before '>' token
     reinterpret_cast<ShowWindow *>(win)->show();
                                  ^
..\..\github.com\niemeyer\qml\cpp/capi.cpp:179:40: error: 'QQuickWindow_* {aka void*}' is not a pointer-to-object type
     reinterpret_cast<ShowWindow *>(win)->show();
                                        ^
..\..\github.com\niemeyer\qml\cpp/capi.cpp:179:48: error: expected ')' before ';' token
     reinterpret_cast<ShowWindow *>(win)->show();

Gustavo Niemeyer

unread,
Oct 4, 2013, 2:08:47 PM10/4/13
to gjwat...@gmail.com, go-...@googlegroups.com
This was reported as issue #11 in the tracker, and Eivind just figured
out the problem. I happened to internally use a class name that also
exists within the Windows API, and the message doesn't help at all.

I'll commit a fix in a moment. Thanks to Eivind for figuring it out.

Gustavo Niemeyer

unread,
Oct 4, 2013, 2:22:59 PM10/4/13
to gjwatersjr, go-...@googlegroups.com
That's done.

gjwat...@gmail.com

unread,
Oct 4, 2013, 2:48:07 PM10/4/13
to go-...@googlegroups.com, gjwatersjr
Thanks, Gustavo.  I've downloaded the latest qml source and tried re-compiling.  Here is the result..

# mohavecounty.us/QmlTest
.\main.go:24: cannot use window.Root() (type qml.Object) as type *qml.Object in assignment:
        *qml.Object is pointer to interface, not interface
.\main.go:38: text.Int undefined (type *qml.Object has no field or method Int)
.\main.go:39: text.Int undefined (type *qml.Object has no field or method Int)
.\main.go:40: text.Int undefined (type *qml.Object has no field or method Int)
.\main.go:41: text.Int undefined (type *qml.Object has no field or method Int)
.\main.go:56: ctrl.Root.Object undefined (type *qml.Object has no field or method Object)
.\main.go:72: emitter.Destroy undefined (type *qml.Object has no field or method Destroy)

Gustavo Niemeyer

unread,
Oct 4, 2013, 2:57:56 PM10/4/13
to gjwatersjr, go-...@googlegroups.com
Yeah, this change was announced here in the list:

https://groups.google.com/d/msg/go-qml/AlR9aXVdBTQ/2tAxB7khvWAJ

gjwat...@gmail.com

unread,
Oct 4, 2013, 4:17:54 PM10/4/13
to go-...@googlegroups.com, gjwatersjr
Thank you.  I've replaced the outdated "sparkle" source with the latest available.

To recap, here are updated installation instructions:

Download "qt-5.1.1-x64-mingw481r2-opengl.exe".
Run the executable.
Accept all defaults.

Download "pkg-config-lite-0.28-1_bin-win32.zip".
Extract the archive.
Copy the "bin" and "share" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".

Download "glib_2.26.1-1_win64.zip".
Extract the archive.
Copy the "bin", "manifest", and "share" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".

Download "glib-dev_2.26.1-1_win64.zip".
Extract the archive.
Copy the "bin", "include", "lib", "manifest", "share", and "src" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".

Download "proxy-libintl-dev_20090911_win64.zip".
Extract the archive.
Copy the "include", "lib", "manifest", and "src" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".

Download "gettext-runtime_0.18.1.1-2_win64.zip".
Extract the archive.
Copy the "bin", "manifest", and "share" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".

Create a "CPATH" environment variable and add the following path(s): C:\Qt\qt-5.1.1-x64-mingw-opengl\qt-5.1.1-x64-mingw-opengl\include;C:\Qt\qt-5.1.1-x64-mingw-opengl\qt-5.1.1-x64-mingw-opengl\include\QtCore\5.1.1\QtCore

Create a "LIBRARY_PATH" environment variable and add the following path(s): C:\Qt\qt-5.1.1-x64-mingw-opengl\qt-5.1.1-x64-mingw-opengl\lib

Create a "PKG_CONFIG_PATH" environment variable and add the following path(s): C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64\bin;C:\Qt\qt-5.1.1-x64-mingw-opengl\qt-5.1.1-x64-mingw-opengl\lib\pkgconfig

Append the following paths to the "PATH" environment variable: C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64\bin;C:\Qt\qt-5.1.1-x64-mingw-opengl\qt-5.1.1-x64-mingw-opengl\bin

The sparkle example now compiles, however, when running the executable the following error is printed at the console:

fatal error: malloc/free - deadlock
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x41e56a]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fefe8a8ee7
runtime.throw(0x62fd60)
        C:/go/src/pkg/runtime/panic.c:464 +0x74
runtime.mallocgc(0x10, 0x0, 0x0)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist259766551/go/src/pkg/runtime/malloc.goc:51 +0x57runtime.mal(0x10)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist259766551/go/src/pkg/runtime/malloc.goc:700 +0x3b
copyin(0x4e3260, 0x22fb88, 0x22fba0)
        C:/go/src/pkg/runtime/iface.c:153 +0x6a
runtime.convT2E(0x4e3260, 0x62e80f, 0x31, 0x4e3260, 0x31)
        C:/go/src/pkg/runtime/iface.c:221 +0x46
runtime.newErrorString(0x62e80f, 0x31, 0x22fbd8)
        C:/go/src/pkg/runtime/error.go:74 +0x3d
runtime.panicstring(0x62e80f)
        C:/go/src/pkg/runtime/panic.c:477 +0x94
runtime.sigpanic()
        C:/go/src/pkg/runtime/os_windows.c:337 +0xca
runtime.mallocgc(0x10, 0x0, 0x0)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist259766551/go/src/pkg/runtime/malloc.goc:70 +0xfa
runtime.mal(0x10)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist259766551/go/src/pkg/runtime/malloc.goc:700 +0x3b
copyin(0x4e3260, 0x22fd10, 0x22fd28)
        C:/go/src/pkg/runtime/iface.c:153 +0x6a
runtime.convT2E(0x4e3260, 0x62e80f, 0x31, 0x4e3260, 0x31)
        C:/go/src/pkg/runtime/iface.c:221 +0x46
runtime.newErrorString(0x62e80f, 0x31, 0x22fd60)
        C:/go/src/pkg/runtime/error.go:74 +0x3d
runtime.panicstring(0x62e80f)
        C:/go/src/pkg/runtime/panic.c:477 +0x94
runtime: unexpected return pc for runtime.sigpanic called from 0x7fefe8a8ee7
runtime.sigpanic()
        C:/go/src/pkg/runtime/os_windows.c:337 +0xca

goroutine 4 [syscall]:
runtime.cgocall(0x49bb72, 0x83df90)
        C:/go/src/pkg/runtime/cgocall.c:149 +0x120 fp=0x83df78
github.com/niemeyer/qml._Cfunc_idleTimerInit(0x639a9c)
        C:/Temp/go-build553703215/github.com/niemeyer/qml/_obj/_cgo_defun.c:223
+0x34 fp=0x83df90
github.com/niemeyer/qml.guiLoop()
        K:/Development/go/src/github.com/niemeyer/qml/bridge.go:31 +0x48 fp=0x83
dfa0
runtime.goexit()
        C:/go/src/pkg/runtime/proc.c:1389 fp=0x83dfa8
created by github.com/niemeyer/qml.Init
        K:/Development/go/src/github.com/niemeyer/qml/qml.go:58 +0xa3

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0x639adc)
        C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist259766551/go/src/pkg/runti
me/sema.goc:199 +0x33
sync.(*Mutex).Lock(0x639ad8)
        C:/go/src/pkg/sync/mutex.go:66 +0xd9
github.com/niemeyer/qml.Init(0x0)
        K:/Development/go/src/github.com/niemeyer/qml/qml.go:59 +0xb6
main.main()
        K:/Development/go/src/mohavecounty.us/QmlTest/main.go:10 +0x2c

goroutine 3 [syscall]:
runtime.goexit()
        C:/go/src/pkg/runtime/proc.c:1389

Gustavo Niemeyer

unread,
Oct 4, 2013, 6:01:08 PM10/4/13
to gjwatersjr, go-...@googlegroups.com
This might be related to the 64 bit support of qt+mingw [1], but I
really can't tell at this point.

We'll need someone with more familiarity on the environment to dive
in. I've invited Nate Finch to play a bit with it, and he's been
looking. He may be able to spot what's up there.

[1] http://qt-project.org/wiki/MinGW-64-bit

gjwat...@gmail.com

unread,
Oct 4, 2013, 7:57:25 PM10/4/13
to go-...@googlegroups.com, gjwatersjr
Thanks, Gustavo.

In the mean time I'll try setting up a different MinGW/Qt environment on the Windows box and recompiling.

Nate Finch

unread,
Oct 5, 2013, 8:45:57 AM10/5/13
to go-...@googlegroups.com, gjwatersjr


On Friday, October 4, 2013 4:17:54 PM UTC-4, gjwat...@gmail.com wrote:
Download "pkg-config-lite-0.28-1_bin-win32.zip".
Extract the archive.
Copy the "bin" and "share" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".

Download "glib_2.26.1-1_win64.zip".
Extract the archive.
Copy the "bin", "manifest", and "share" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".

Download "glib-dev_2.26.1-1_win64.zip".
Extract the archive.
Copy the "bin", "include", "lib", "manifest", "share", and "src" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".

Download "proxy-libintl-dev_20090911_win64.zip".
Extract the archive.
Copy the "include", "lib", "manifest", and "src" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".

Download "gettext-runtime_0.18.1.1-2_win64.zip".
Extract the archive.
Copy the "bin", "manifest", and "share" subfolders to "C:\Qt\qt-5.1.1-x64-mingw-opengl\mingw64".


Note - I think the easiest way to do these 5 steps is just to install the all-in-one GTK bundle and add its bin dir to path:



Reply all
Reply to author
Forward
0 new messages