Author Topic: Compiling GTK+ code  (Read 5876 times)

Offline Gamegoofs2

  • Multiple posting newcomer
  • *
  • Posts: 11
Compiling GTK+ code
« on: October 28, 2009, 01:09:06 am »
How do I link the GTK+ libraries with Code blocks so that I can program with GTK?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Compiling GTK+ code
« Reply #1 on: October 28, 2009, 06:30:00 am »
How do I link the GTK+ libraries with Code blocks so that I can program with GTK?
Go to the project options, linker tab and add the needed libraries. There should also be a GTK project wizard available (under file -> new project) if you've installed the scripted wizard plugin.

More information is not possible as you forgot to state, platform, OS, (C::B/OS) version etc...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Gamegoofs2

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Compiling GTK+ code
« Reply #2 on: October 28, 2009, 03:10:15 pm »
Oops, sorry. I'm running on Vista and my version of Code blocks is 8.02.

Saturday night I compiled gtk code properly, but when I got on Monday and tried to compile the same code I got errors like the gtk header wasn't there. I used the wizard to set up gtk I thought.

I'll try what you said though. Thanks.
« Last Edit: October 28, 2009, 03:14:44 pm by Gamegoofs2 »

Offline Gamegoofs2

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Compiling GTK+ code
« Reply #3 on: October 28, 2009, 09:43:31 pm »
I tried the wizard and the project > build options > Linker neither of them worked.

When I compiled doing the wizard way it compiled but I got this error:
This application has failed to start because libglib-2.0-0.dll was not found. Re-installing the application may fix this problem.

Help please!
Thanks

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Compiling GTK+ code
« Reply #4 on: October 28, 2009, 10:52:56 pm »
Place the gtk dlls alongside (in the same directory) you executable or in a directory on your PATH (not sure about that this will work)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Gamegoofs2

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Compiling GTK+ code
« Reply #5 on: October 30, 2009, 11:48:34 pm »
How come it worked once then and stopped working? How do I get it to work with out placing the .DLLs in the same file?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: Compiling GTK+ code
« Reply #6 on: October 31, 2009, 12:37:54 am »
How come it worked once then and stopped working? How do I get it to work with out placing the .DLLs in the same file?

Long Answer: Learn how to program under windows.
Short Answer: Put DLLs in a folder that is in the PATH; NOTE, this method has drawbacks!!

Tim S.
« Last Edit: October 31, 2009, 12:41:09 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org