Re: [Vala] why valac says "error: Failed to execute child process (Exec format error)"



I have to do these "export operation" every time when I run msys2
since I don't know how to let msys2 do this automaticaly yet
[code]
export LANG=en
export PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/mingw64/bin
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/mingw64/lib/pkgconfig
[/code]

mingw-w64-x86_64-pkg-config seems to be same with what I have
installed with "pacman -S pkg-config"
[code]
$ pacman -S mingw-w64-x86_64-pkg-config
error: duplicated database entry 'curl'
error: duplicated database entry 'filesystem'
error: duplicated database entry 'libcurl'
warning: mingw-w64-x86_64-pkg-config-0.29.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-x86_64-pkg-config-0.29.1-1

Total Installed Size:  1.32 MiB
Net Upgrade Size:      0.00 MiB
[/code]

gobjetct has been installed, although I don't know how I installed it,
maybe "pacman -S mingw-w64-x86_64-gobject-introspection" did, maybe
not
[code I erase many other pacakges here]
$ pkg-config --list-all
gobject-introspection-no-export-1.0 gobject-introspection - GObject
Introspection
gobject-2.0                         GObject - GLib Type, Object,
Parameter and Signal Library
gobject-introspection-1.0           gobject-introspection - GObject
Introspection


$ echo $PKG_CONFIG_PATH
/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig:/mingw64/lib/pkgconfig

$ ls  /mingw64/lib/pkgconfig/go*.pc
/mingw64/lib/pkgconfig/gobject-2.0.pc
/mingw64/lib/pkgconfig/gobject-introspection-1.0.pc
/mingw64/lib/pkgconfig/gobject-introspection-no-export-1.0.pc

[/code]

this can be tested by compiling a gobject sample
"someobject.smallest.c" found on
http://blog.csdn.net/xbl1986/article/details/6701047 , sorry the
webpage is in Chinese, but the code is in English
[code]
$ gcc someobject.smallest.c `pkg-config --cflags --libs gobject-2.0`
$ ./a.exe
****init the type system****
****init type system OK ****
-- some_object_class_init # 41
-- some_object_init # 48
-- some_object_dispose # 25
-- some_object_finalize # 32
****finish GObject Demo ****
[/code]

however
[code]
$ valac --cc=gcc ./helloworld.vala
Package gobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-2.0' found
Compilation failed: 1 error(s), 0 warning(s)
error: pkg-config exited with status 1

# I can compile the produced C file as I mentioned in last post
$ gcc helloworld.vala.c -o helloworld.vala.exe `pkg-config --cflags
--libs glib-2.0` `pkg-config --cflags --libs gobject-2.0`

$ ./helloworld.vala.exe
hello world
[/code]

2016-06-22 0:32 GMT+08:00 Al Thomas <astavale yahoo co uk>:



________________________________
From: oyster <lepto python gmail com>
Sent: Tuesday, 21 June 2016, 16:53
Subject: Re: [Vala] why valac says "error: Failed to execute child process
(Exec format error)"

sorry, I installed gcc/pkgconfig/gobject now
$ pacman -S mingw-w64-x86_64-gcc
$ pacman -S pkg-config

This comment (
https://github.com/commercialhaskell/stack/issues/377#issuecomment-118182127
)
says "I should be using the package mingw-w64-x86_64-pkg-config instead of
pkg-config"


$ pacman -S mingw-w64-x86_64-gobject-introspection



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]