|
|
|
|
Re: GTK+ from the ground up? [message #636641 is a reply to message #636479] |
Tue, 02 November 2010 10:13 |
John McCabe 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 #639125 is a reply to message #638829] |
Mon, 15 November 2010 11:40 |
John McCabe 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?
|
|
|
Powered by
FUDForum. Page generated in 0.08721 seconds