1
votes

what have to i install for compiling of file.c that use gtk2 e file glade(makes with glade 3.8)?

i have install libglade with Pacman -S and i tried to compile with gcc -export-dynamic File.c -o browser $(pkg-config --cflags --libs gtk+-2.0)\ $( pkg-config --cflags --libs libglade-2.0) after this MinGW doesn't work.. for each comand it put in output things like :

1367211018 [main] bash 9420 fork: child -1 - forked process 8876 died unexpected ly, retry 0, exit code 0xC0000005, errno 11 bash: fork: retry: No child processes 1368436447 [main] bash 9420 fork: child -1 - forked process 3968 died unexpected ly, retry 0, exit code 0xC0000005, errno 11 bash: fork: retry: No child processes 1370680659 [main] bash 9420 fork: child -1 - forked process 1404 died unexpected ly, retry 0, exit code 0xC0000005, errno 11 bash: fork: retry: No child processes bash: fork: No child processes

How can i resolve this and compile project with gtk(C),file.glade? Have you some guide?

1
Something in the build process crashed with an access violation (equivalent to a segfault on non-Windows platforms). What happens if you run just pkg-config --cflags --libs gtk+-2.0 by itself?andlabs
it works OutPut -mms-bitfields -pthread -mms-bitfields -IC:/msys32/mingw32/include/gtk-2.0 -IC:/msys32/mingw32/lib/gtk-2.0/include -IC:/msys32/mingw32/include/pango-1.0 -IC:/msys32/mingw32/include +eccPegasum
if i run gcc -W file.c $(pkg-config --cflags --libs gtk+-2.0) he responde with gcc: internal compiler error: Segmentation fault (program as) Please submit a full bug report, with preprocessed source if appropriate. See <gcc.gnu.org/bugs.html> for instructions.Pegasum
If program as means the program called "as" then the assembler is segfaulting, which is all sorts of bizarre. What does gcc --version say? Which pacman packages did you install?andlabs
the program is not called "as"/// gcc--version say gcc (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. /// i had install pacman -S mingw32/mingw-w64-i686-glade //pacman -S mingw32/mingw-w64-i686-libgladePegasum

1 Answers

1
votes

This is not exactly an answer, since I can't figure out exactly what your problem from the information provided. So, I need more space compared to that permitted by the "comment" box above (.. if SO moderators are upset by this, let me know, and I'll take down my submission).

First, what do you mean when you say "MinGW"? Do you mean:

1) you have built a proper MinGW environment and compiled all your code from scratch (e.g. following the excellent instructions such as these (http://ingar.satgnu.net/devenv/mingw32/index.html) )

2) You have download some Windows binaries for Glade etc?

3) You are using MSys2?

If you are using Msys2, I would be surprised for your Glade to be Gtk+ (2), as AlexPu (the head honcho at MSys2) has told me personally that he will not create a Gtk+ (2) variant of Glade, since he feels that would cause too much conflict with the Gtk3 variant. This means, on Msys2, the only way to have a (MinGW) Gtk+ (2) compliant Glade is to use the MSys2/AlexPu "create from scratch mystery mechanism". We have not ever been able to get that to build, not even with MSys2's help (and that process throws a lot of bash errors).

Therefore, one possibility is that you are using a Gtk3 Glade variant with Gtk2 code, which will never work, but that can't be the only "issue", see below.

Also, your reference to libs looks a bit different from what we would expect if you had proper MinGW Gtk+ machinery. For example, all of our Win/Gtk+ (2) apps, usually, would have to have at least the following libs required:

$(#gtk)\bin\libgtk-win32-2.0-0.dll

$(#gtk)\bin\libgdk-win32-2.0-0.dll

$(#gtk)\bin\libgobject-2.0-0.dll

$(#gtk)\bin\libglib-2.0-0.dll

... and usually many more for Pango, Cairo, etc.

These should be the same whether your compiled from scratch, or if just "installed via MSys2/pacman".

Of course, almost surely, there will be other dependencies, and "search paths" required, and various things must be on your "Path".

Second, your error messages are quite odd, and cite "bash" issues. That sounds more like "scripting/instruction" problems within whatever MinGW/Unix-like shell/system you are working in.

They don't sound like "proper Gtk crashes". Typically, Windows, will actually issue a SIGSEGV and also in the debugger log it will actually use the words "segmentation fault" etc. If the SIGSEGV is really nasty, Windows may not "say anything" explicitly (blank console, etc), and your GDB might see only "some mention" of "some" problem.

Also, if you are using Glade, then it is just an xml file that attempts to make your Gtk life easier. Gtk has code for interpreting the Glade xml files into otherwise virtual "Gtk code". Frankly, we have found that Glade is more trouble than its worth in many cases, and just writing the GUI via code is more efficient, again, often, not always.

Third, it is possible (we have done it) to use Glade based on Windows binaries, and link to libs therein, but that would be for the Glade libs, you would still need to obtain the (correct) Gtk+ libs.

As you can see, it is difficult to provide a precise answer without knowing more about your set up.

I would strongly recommend also that you do not run from the command line. It can be done, but there is much too much in the way of fiddly things that need to be "connected" to have Gtk/Glade/GCC etc all talking to each other correctly. I would strongly recommend installing Code::Blocks (http://www.codeblocks.org/); it's free and excellent (or some decent IDE). Then, you can very easily set up your paths/dependencies (after you have confirmed the existence of the dll's/lib's, and their exact path, versions, tc.).

Also, the CodeBlock's community has considerable experience integrating external packages (like Glade/GCC/Gtk etc).

Some, not all, MinGW dll's will include version numbers, right click the dll, click properties and look for, depending on your OS, "version" or "details" etc where the dll's version number is kept. All the Gtk ones will. Often, the file name also incorporates version number "indicator", but sometimes it's best to be sure.

BTW, if your Glade has a ver num > 3.8.5, then almost surely it's Gtk3.

Incidentally, had you coded everything "correctly" and supplied all the libs, etc etc. but some of the libs were Gtk2 while others were Gtk3 (and there are no other major problems), then Gtk itself would disallow it, and tell you it wont accept "mixed 2 and 3".

... as before, our experience with MSys2 has been an unhappy one. We have found that investing about a day or so and following "Ingar's instructions" (http://ingar.satgnu.net/devenv/mingw32/index.html) will provide you a built from scratch fully functioning Windows MinGW infrastructure with GCC/Gtk etc, and that you have complete control over, and know where everything is, and what everything does etc.