Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » GTK+ from the ground up?(Trying to setup a simple GTK+example app w/o luck )
GTK+ from the ground up? [message #635747] Wed, 27 October 2010 23:08 Go to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
I have spent way to many hours trying to get a basic GTK+ app to build in CDT. I admit to being a rookie but something is missing here. Does anyone have a ground up example for getting a simple GTK+ app working using CDT on Windows? No matter what I try, I cannot get past the include reference errors.

I started a new app using both the empty and hello world examples, download GTK (tried 2.16 and 2.22), import it as an archive, paste some example GTK code into main and then the fun begins.

My include references keep giving errors and sometimes when I fix one, another old one comes back. I feel like I am running in circles. I have tried every fix I could find but have not been able to get through this. Does anyone have a complete example from the ground up?

Thanks!

Re: GTK+ from the ground up? [message #636152 is a reply to message #635747] Fri, 29 October 2010 13:37 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
No replies...perhaps I made a bad assumption. Has anyone done any development for GTK+ on Windows CDT?
Re: GTK+ from the ground up? [message #636438 is a reply to message #635747] Mon, 01 November 2010 10:03 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Wed, 27 Oct 2010 19:08:48 -0400, Joe <1010eclipse@austinlakes.com>
wrote:

>I started a new app using both the empty and hello world examples, download GTK (tried 2.16 and 2.22), import it as an archive, paste some example GTK code into main and then the fun begins.

I'm not familiar with the "import it as an archive" step. Why are you
not just extracting the GTK development kit and referencing it as a
source of include files in your project configuration?
Re: GTK+ from the ground up? [message #636479 is a reply to message #636438] Mon, 01 November 2010 14:26 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
John McCabe wrote on Mon, 01 November 2010 06:03
On Wed, 27 Oct 2010 19:08:48 -0400, Joe <1010eclipse@austinlakes.com>
wrote:

>I started a new app using both the empty and hello world examples, download GTK (tried 2.16 and 2.22), import it as an archive, paste some example GTK code into main and then the fun begins.

I'm not familiar with the "import it as an archive" step. Why are you
not just extracting the GTK development kit and referencing it as a
source of include files in your project configuration?



So the import is something I read in the help files and I thought it sounded like the right way to go. It is accessed from File>Import and opens a zip file. I thought it would also help with references to paths. But I am wide open to suggestions since that did not work out to well.

Can you give some details of what worked for you? What did you extract? Where did it come from? Details of how you reference things are probably the biggest part of what I am missing. Please help! Thx.
Re: GTK+ from the ground up? [message #636641 is a reply to message #636479] Tue, 02 November 2010 10:13 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Mon, 01 Nov 2010 10:26:35 -0400, Joe <1010eclipse@austinlakes.com>
wrote:

>So the import is something I read in the help files and I thought it sounded like the right way to go. It is accessed from File>Import and opens a zip file. I thought it would also help with references to paths. But I am wide open to suggestions since that did not work out to well.

Oh! Interesting.

>Can you give some details of what worked for you? What did you extract? Where did it come from? Details of how you reference things are probably the biggest part of what I am missing. Please help! Thx.

To be honest I've never used GTK+ much, and it's a long time since I
used it at all. However I'm happy to let you know what I'd _probably_
do!

I'm assuming from your earlier message though that you've got Eclipse
(Helios?) set up with MinGW as your C/C++ compiler on Windows. If not,
then let me know more details. If so, I would be inclined to go to:

http://www.gtk.org/download-windows.html

and download the 2.22 bundle (gtk+-bundle_2.22.0-20101016_win32.zip)
then extract it.

After that, follow the instructions in the
gtk+-bundle_2.22.0-20101016_win32.README.txt file that's extracted
e.g. use Windows Explorer to move to c:\, create a folder opt, go in
to opt, create a folder gtk, then move all the files and folders from
the extracted zip (i.e. bin, etc, include and so on) in to c:\opt\gtk.

Then add c:\opt\gtk\bin to your PATH environment variable, open a
command prompt and try the:

pkg-config --cflags gtk+-20

command and the

gtk-demo

command that is mentioned in the file.

Now, in Eclipse, create a new C (or C++ project if you're thinking of
using something like gtkmm - http://www.gtkmm.org/en/). Right click on
the project and select "Properties", go to the "C/C++ General" ->
"Paths and symbols" page and select the "Includes" tab. Select "GNU C"
on the left pane, the use the "Add..." button to add the paths you
need from c:\opt\gtk\include. You might then want to select the
"Library Paths" tab and add any required paths from c:\opt\gtk\lib.

The write some code and see if it builds.

I haven't done this recently but that would be my plan to start with.

Hope this helps
John
Re: GTK+ from the ground up? [message #636726 is a reply to message #636641] Tue, 02 November 2010 14:36 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
So - I had a little go. I followed my previous instructions except
instead of c:\opt\gtk I went straight for c:\gtk.

Created a new C project on Eclipse and created a file called base.c
with the contents defined in this page:

http://www.gtk.org/tutorial1.2/gtk_tut-2.html

To build it I had to go to the project properties and set the
following include paths under "C/C++ General", "Paths and symbols",
"Includes", GNU C:

c:\gtk\include\gtk-2.0
c:\gtk\include\glib-2.0
c:\gtk\lib\glib-2.0\include
c:\gtk\include\cairo
c:\gtk\include\pango-1.0
c:\gtk\lib\gtk-2.0\include
c:\gtk\include\gdk-pixbuf-2.0
c:\gtk\include\atk-1.0

(in addition to the normal MinGW paths that should already be in
there).

In the "Libraries" tab add:

gtk-win32-2.0.dll

In the "Library Paths" tab add:

c:\gtk\lib

Then go to "C/C++ Build", "Settings" and in "Tool Settings", "GCC C
Compiler", "Miscellaneous" add in the "Other flags" box:

-mms-bitfields

Built fine and running it opened a little window with nothing in it.
That web page gives you some details of the libraries you need further
down, but it uses a gtk-config command that presumably doesn't work on
Windows so you need to add the relevant libraries and paths in as I've
done above if you're doing anything more ambitious.

Hope this helps.
John
Re: GTK+ from the ground up? [message #637232 is a reply to message #636726] Thu, 04 November 2010 16:45 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
You have no idea how much I appreciate you doing this!!!! I was trying to mimic your example but am stuck here...

In the "Libraries" tab add:

gtk-win32-2.0.dll


Where is the Libraries tab????


I did find this...


In the "Library Paths" tab add:

c:\gtk\lib


What am I missing?
Thx again!
Re: GTK+ from the ground up? [message #637239 is a reply to message #637232] Thu, 04 November 2010 16:55 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Thu, 04 Nov 2010 12:45:38 -0400, Joe <1010eclipse@austinlakes.com>
wrote:

>You have no idea how much I appreciate you doing this!!!! I was trying to mimic your example but am stuck here...
>
>In the "Libraries" tab add:
>
>gtk-win32-2.0.dll
>
>Where is the Libraries tab????

Right click on the project and select "Properties". Go to "C/C++
General", "Paths and Symbols". That should take you to a page where
the "Includes" and the "Library Paths" tabs are. Between these,
certainly on Eclipse Helios, there are "Symbols" and "Libraries" tabs
so you should be able to see it there.

>I did find this...
>
>
>In the "Library Paths" tab add:
>
>c:\gtk\lib
>
>What am I missing?
>Thx again!
Re: GTK+ from the ground up? [message #637250 is a reply to message #637239] Thu, 04 November 2010 17:40 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
I dont have that tab there and noticed that my Eclipse says "Galileo" on startup. From about I see Version: 3.5.2
Build id: M20100211-1343. Is there a difference I should care about?

I did find another place to put that in under C++ build>settings>MinGW C Linker, then add it to the Libraries box. That seemd to work and it builds now.

I also noticed that it also builds w/o the "-mms-bitfields" additional parameters. What should those do?

Build seems to work consistently now but nothing happens when I run except for a message at the top of the console window that starts with <terminated>..

Very close, but not quite there..
Re: GTK+ from the ground up? [message #637285 is a reply to message #637250] Thu, 04 November 2010 20:29 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
Apparently I did not look close enough. I still have a console error on build.

**** Build of configuration Debug for project test8 ****

**** Internal Builder is used for build ****
gcc -Ic:\gtk\include\gtk-2.0 -Ic:\gtk\include\glib-2.0 -Ic:\gtk\lib\glib-2.0\include -Ic:\gtk\include\cairo -Ic:\gtk\include\pango-1.0 -Ic:\gtk\lib\gtk-2.0\include -Ic:\gtk\include\gdk-pixbuf-2.0 -Ic:\gtk\include\atk-1.0 -O0 -g3 -Wall -c -fmessage-length=0 -mms-bitfields -obase.o ..\base.c
gcc: no input files
Build error occurred, build is stopped
Time consumed: 93 ms.


Searching on "gcc: no input files" is a wild goose chase so far. Any suggestions?
Re: GTK+ from the ground up? [message #637417 is a reply to message #637250] Fri, 05 November 2010 13:30 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Thu, 04 Nov 2010 13:40:39 -0400, Joe <1010eclipse@austinlakes.com>
wrote:

>I dont have that tab there and noticed that my Eclipse says "Galileo" on startup. From about I see Version: 3.5.2
>Build id: M20100211-1343. Is there a difference I should care about?
>
>I did find another place to put that in under C++ build>settings>MinGW C Linker, then add it to the Libraries box. That seemd to work and it builds now.

Yes, that would be the one. As I mentioned, I'm using Helios so I
guess that's one of the changes between Helios and Galileo.

>I also noticed that it also builds w/o the "-mms-bitfields" additional parameters. What should those do?

That one doesn't prevent the build from completing but it stopped the
app from running on my system; a message popped up saying "can't do
something or other, if you're running on windows you might have
forgotten to add that option" or words to that effect.

>Build seems to work consistently now but nothing happens when I run except for a message at the top of the console window that starts with <terminated>..

>Very close, but not quite there..
Re: GTK+ from the ground up? [message #637440 is a reply to message #637285] Fri, 05 November 2010 13:43 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Thu, 04 Nov 2010 16:29:26 -0400, Joe <1010eclipse@austinlakes.com>
wrote:

>Apparently I did not look close enough. I still have a console error on build.
>
>**** Build of configuration Debug for project test8 ****
>
>**** Internal Builder is used for build ****
>gcc -Ic:\gtk\include\gtk-2.0 -Ic:\gtk\include\glib-2.0 -Ic:\gtk\lib\glib-2.0\include -Ic:\gtk\include\cairo -Ic:\gtk\include\pango-1.0 -Ic:\gtk\lib\gtk-2.0\include -Ic:\gtk\include\gdk-pixbuf-2.0 -Ic:\gtk\include\atk-1.0 -O0 -g3 -Wall -c -fmessage-length=0 -mms-bitfields -obase.o ..\base.c
>gcc: no input files
>Build error occurred, build is stopped
>Time consumed: 93 ms.
>
>
>Searching on "gcc: no input files" is a wild goose chase so far. Any suggestions?

That's intriguing. Here's my output:

**** Rebuild of configuration Debug for project TestGTK ****

**** Internal Builder is used for build ****
gcc -IC:\gtk\include\gtk-2.0 -IC:\gtk\include\glib-2.0
-IC:\gtk\lib\glib-2.0\include -IC:\gtk\include\cairo
-Ic:\gtk\include\pango-1.0 -IC:\gtk\lib\gtk-2.0\include
-IC:\gtk\include\gdk-pixbuf-2.0 -IC:\gtk\include\atk-1.0 -O0 -g3 -Wall
-c -fmessage-length=0 -mms-bitfields -obase.o ..\base.c
gcc -LC:\gtk\lib -oTestGTK.exe base.o -lgtk-win32-2.0.dll
Build complete for project TestGTK
Time consumed: 1747 ms.

So the actual compile command is identical (give or take a couple of
case differences). If base.o is actually produced (check this please)
then I guess it's to do with the linker command.

Oh - by the way - the bit you pointed out about findin it in "C/C++
Build" -> "Settings" "MinGW C Linker" is also in Helios so I guess the
"Libraries" and "Library Paths" tabs are just for convenience or
something!

So if you go in to that "Tool Settings" place for the linker, I have:

In the "MinGW C Linker" main thing:
Command: gcc
All Options: -L"C:\gtk\lib"
(which will be from the "Library Paths" bit)
Expert Settings:
Command line pattern: ${COMMAND} ${FLAGS}
${OUTPUT_FLAG}${OUTPUT_PREFIX}$OUTPUT ${INPUTS}

On the "General" thing:
There are 5 options, none of which are checked.

On "Libraries":
"Libraries (-l)" has gtk-win32-2.0.dll
"Library search path (-L)" has "C:\gtk\lib"

On "Miscellaneous" I haven't anything filled in

On "Shared Library Settings" nothing checked or filled in.
Re: GTK+ from the ground up? [message #638071 is a reply to message #637440] Tue, 09 November 2010 20:33 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member

Well I have not tried to figure out the difference between the two versions of Eclipse but it seems our settings are the same otherwise. All of my settings match yours, or the ones you mentioned.

I do not have a "base.o" file.

My Environment "CWD" and "PWD" are both point to the correct debug directory for this project if that matters. I am not sure where else to look.

Re: GTK+ from the ground up? [message #638181 is a reply to message #638071] Wed, 10 November 2010 09:50 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Tue, 09 Nov 2010 15:33:10 -0500, Joe <1010eclipse@austinlakes.com>
wrote:

>
>Well I have not tried to figure out the difference between the two versions of Eclipse but it seems our settings are the same otherwise. All of my settings match yours, or the ones you mentioned.
>
>I do not have a "base.o" file.
>
>My Environment "CWD" and "PWD" are both point to the correct debug directory for this project if that matters. I am not sure where else to look.
>

That's odd. What happens if you go to where base.c the base.c file is
and type the command in by hand (well, cut and paste it in to a
Command Prompt). Do you get a base.o then?

John
Re: GTK+ from the ground up? [message #638285 is a reply to message #638181] Wed, 10 November 2010 17:17 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
That info told me a lot. The command line did not work at first. I had to add a path to gcc.exe

Then it will work from the debug directory. If I try it from anywhere else, it fails with the same error I see in Eclipse. It's as if Eclipse is running gcc from the wrong directory because it looks as if it does not find "..\base.c". That is relative to the debug dir. But all of the path settings I see in Eclipse point to the correct debug dir. Am I missing one somewhere?
Re: GTK+ from the ground up? [message #638293 is a reply to message #638285] Wed, 10 November 2010 17:52 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Wed, 10 Nov 2010 12:17:07 -0500, Joe <1010eclipse@austinlakes.com>
wrote:

>That info told me a lot. The command line did not work at first. I had to add a path to gcc.exe

Do you mean you had to add c:\mingw\bin or something to your PATH
environment variable or run the command as c:\mingw\bin\gcc?

Either way I don't think that's particularly important as the builder
in Eclipse seemed to find gcc ok.

>Then it will work from the debug directory. If I try it from anywhere
>else, it fails with the same error I see in Eclipse. It's as if
>Eclipse is running gcc from the wrong directory because it looks as if
>it does not find "..\base.c". That is relative to the debug dir. But
>all of the path settings I see in Eclipse point to the correct debug
>dir. Am I missing one somewhere?

Just to make it clear we've got the same structure; I have a folder
called C:\EclipseWorkspace which is (funnily enough!) my workspace
that I use with Eclipse. In that there is a folder called TestGTK
which is my little test program (that we've been discussing).

I currently have (Hope this comes out ok - should be monospaced font!)

c:\EclipseWorkspace\TestGTK
|
+ .settings
| |
| + org.eclipse.cdt.codan.core.prefs
| + org.eclipse.cdt.managedbuilder.core.prefs
|
+ Debug
| |
| + base.o
| + TestGTK.exe
|
+ .cproject
+ .project
+ base.c

And that's it. I'm presuming from your message that you have the same
structure (although the files in Debug would possibly be missing due
to Eclipse not getting it to compile).

You will probably not have the codan stuff either; I think that's new
in Helios.

In your .project, is there a section that says:

<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/TestGTK/Debug}</value>
</dictionary>

And, in .cproject, something like:

<builder
buildPath="${workspace_loc:/TestGTK/Debug}"
id="cdt.managedbuild.tool.gnu.builder.mingw.base.624397809"
keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT
Internal Builder"
superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/ >

Those locations seem to be set (and not changeable) on my system in
the Project Properties -> C/C++ Build, "Builder Settings" page. In the
"Environment" page under "C/C++ Build"there is an "Environment
variables to set" box that has CWD and PWD set to
C:\EclipseWorkspace\TestGTK\Debug.

Hope some of this is of use; if you can see anything different.
Re: GTK+ from the ground up? [message #638542 is a reply to message #638293] Thu, 11 November 2010 15:30 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
Mine looks much the same as yours but of course my actual path is different.

In .cproject I see....

<builder buildPath="${workspace_loc:/test8/Debug}"

In .project I see.....

<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/test8/Debug}</value>
</dictionary>

I tried changing the forward slashes to back slashes but it made no difference.


My actual path is "C:\Documents and Settings\jburbano\eclipse\workspace\test8" Could it be the spaces in my path? I hope not, this is the default install path! Going to try a new project (arrgh) with a no space path next.
Re: GTK+ from the ground up? [message #638586 is a reply to message #638542] Thu, 11 November 2010 16:59 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Thu, 11 Nov 2010 10:30:36 -0500, Joe <1010eclipse@austinlakes.com>
wrote:

>Mine looks much the same as yours but of course my actual path is different.
>
>In .cproject I see....
>
><builder buildPath="${workspace_loc:/test8/Debug}"
>
>In .project I see.....
>
><dictionary>
><key>org.eclipse.cdt.make.core.buildLocation</key>
><value>${workspace_loc:/test8/Debug}</value>
></dictionary>
>
>I tried changing the forward slashes to back slashes but it made no difference.
>
>
>My actual path is "C:\Documents and Settings\jburbano\eclipse\workspace\test8" Could it be the spaces in my path? I hope not, this is the default install path! Going to try a new project (arrgh) with a no space path next.

Well - it's always a possibility. I've tried to avoid any paths with
spaces in them since hitting what appeared to be problem with that
back in the early Eclipse 3.x series.
Re: GTK+ from the ground up? [message #638619 is a reply to message #638586] Thu, 11 November 2010 19:29 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
Starting again was apparently the right answer. Not sure how I screwed up the last one, but my new projects build fine (using your instructions) with or w/o spaces in the path.

Unfortunately, I have run into a new issue. I can't "run". I get an error in the console that starts with <terminated>....

Not much info in the GUI so I tried it from the cmd window. That results in an error saying that "libgtk-win32-2.0-0.dll" is not found.

Stumped again! Using windows search, I see that the dll exists in many places including "bin", not "c:\bin", or a path that I would recognize mind you, just "bin". I do see it in other places with a normal path starting with c:\... like I expected. Where the heck is "bin"!? I also see that the required dll exists in the path of some of my older (failed) projects although I am not sure how it got there.

So close...yet so far.....



Re: GTK+ from the ground up? [message #638642 is a reply to message #638619] Thu, 11 November 2010 22:23 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
A bit more progress on the cmd line. Adding "c:\gtk\bin" to my path in the command window takes me to my next error.

"The procedure entry point deflateSetHeader could not be located in the dynamic link library zlib.dll."

Huh?

I cant help but feel like I have made a basic mistake at the core of the Eclipse setup. Why do all of the GTK "getting started" posts make this sound so easy?
Re: GTK+ from the ground up? [message #638712 is a reply to message #638642] Fri, 12 November 2010 09:51 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Thu, 11 Nov 2010 17:23:13 -0500, Joe <1010eclipse@austinlakes.com>
wrote:

>A bit more progress on the cmd line. Adding "c:\gtk\bin" to my path in the command window

Yip - that's necessary.

> takes me to my next error.

>"The procedure entry point deflateSetHeader could not be located in the dynamic link library zlib.dll."

>Huh?

Which version of zlib.dll have you got? Is it definitely zlib.dll and
not zlib1.dll? The reason I ask is that there is a bug report here
about zlib1.dll version 1.2.3 not exporting deflateSetHeader.

https://sourceforge.net/tracker/index.php?func=detail&ai d=3085301&group_id=23617&atid=379173

This may go back to the version of gtk you installed but both 2.22 and
2.16 have 1.2.5 bundled with them. Check for more than 1 version of
zlib1.dll being available in your path and see if you've got 1.2.3 or
something somewhere. Actually - if you make sure c:\gtk\bin is first
in your path then that should help to narrow that problem down.

>I cant help but feel like I have made a basic mistake at the core of the Eclipse setup. Why do all of the GTK "getting started" posts make this sound so easy?

LOL - because it normally is, unless you're running on a slightly
unusual system :-)
Re: GTK+ from the ground up? [message #638829 is a reply to message #638712] Fri, 12 November 2010 17:00 Go to previous messageGo to next message
Joe Mising name is currently offline Joe Mising nameFriend
Messages: 15
Registered: October 2010
Junior Member
Once again you nailed it! Moving c:\gtk\bin to the front of my path (instead of the end) solved that issue. I checked the old path and compared it to a search for zlib1.dll (yes it was zlib1, not zlib) and could not find the match that would point to the older version but I am moving on anyway!

On to the next error!

"GTK-ERROR **: Incompatible build! The code using GTK+ thinks the GtkBox is of different size than it actually is in this build of GTK+. On windows, this probably means that you have probably compiled your code with gcc w/o the -mms-bitfields switch, or that you are using an unspuuroted compiler. aborting..."

Finally an error I can read!!! I may not know what those params do, but it certainly needs them. Yes, I forgot to add those parameters in the new project. Add the parameters, rebuild and then.........wait for it.............SUCCESS!!! Sweet success! So where do I send the case of beer?

Now if I can figure out how to "run" out of Eclipse, I will be in good shape. Is that not supported for GTK? Is it normal to have to drop to a cmd window to test your build?
Re: GTK+ from the ground up? [message #639125 is a reply to message #638829] Mon, 15 November 2010 11:40 Go to previous message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Fri, 12 Nov 2010 12:00:46 -0500, Joe <1010eclipse@austinlakes.com>
wrote:

>Once again you nailed it! Moving c:\gtk\bin to the front of my path (instead of the end) solved that issue. I checked the old path and compared it to a search for zlib1.dll (yes it was zlib1, not zlib) and could not find the match that would point to the older version but I am moving on anyway!

Interesting though. What did you use to look for other zlib1.dll? If
it was Windows built-in search, I've always found that completely
useless. I use Agent Ransack or drop to a command prompt in c:\ and do
dir/s zlib1.dll.

>On to the next error!

> "GTK-ERROR **: Incompatible build! The code using GTK+ thinks the GtkBox is of different size than it actually is in this build of GTK+. On windows, this probably means that you have probably compiled your code with gcc w/o the -mms-bitfields switch, or that you are using an unspuuroted compiler. aborting..."

>Finally an error I can read!!! I may not know what those params do, but it certainly needs them. Yes, I forgot to add those parameters in the new project.

Yes - that's the one I mentioned a while back about mms-bitfields. As
I said, it builds fine but doesn't run _but_ at least it's an
excellent message because you just do what it says and hey presto...

> Add the parameters, rebuild and then.........wait for it.............SUCCESS!!! Sweet success!

Great. Still... there's more to do once you start putting your
functionality in but at least it's a start and the rest of it should
hopefully just be adding whatever libraries you need for the extra
stuff you add.

> So where do I send the case of beer?

You can help me out online sometime instead :-)

>Now if I can figure out how to "run" out of Eclipse, I will be in good shape. Is that not supported for GTK? Is it normal to have to drop to a cmd window to test your build?

Well I can run it from Eclipse. I just right clicked on it and did
"Run As" "Local C/C++ Application" and it popped up.

Have a look at your Run Configurations ("Run As" "Run
configurations...").

I have a "C/C++ Application" group with "TestGTK.exe" as a
configuration in there. If I click on that I have a "Main" tab that
has:

C/C++ Application: Debug/TestGTK.exe
Project: TestGTK
Build configuration: Debug
Use workspace settings: selected
Connect process input & output to a terminal: checked (and greyed)

On to the Arguments tab...

Nothing in the Program arguments: box
Working directory: ${workspace_loc:TestGTK} (greyed) with "Use
default" checked

On to the Environment tab...

Nothing in the "Environment variables to set" box
"Append environment to native environment" selected (and greyed)

Finally the Common tab:

Save as "Local file" selected
Encoding - Default
Nothing selected in Display in favourites menu
"Allocate Console (necessary for input" checked
"File" not checked
"Launch in background" selected.

And that's it. Things may be different for you as you're not using
Helios but there shoudl be something like that.

What happens when you try to run from Eclipse?
Previous Topic:blank lines at end of code
Next Topic:Missing library: libintl for CxxTest Eclipse plug-in
Goto Forum:
  


Current Time: Thu Apr 18 14:49:05 GMT 2024

Powered by FUDForum. Page generated in 0.02712 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top