Author Topic: Build error - while testing GTK+ project  (Read 5733 times)

Offline jantma2

  • Single posting newcomer
  • *
  • Posts: 4
Build error - while testing GTK+ project
« on: March 17, 2016, 02:02:29 pm »
Hello,

first I'm complete noob in code::blocks as well as programming, so this question seems odd to some of you.
I've started a new GTK+ project - from project list. After that I see some lines of code and I assume this can be compiled, build and executed, just in order to see what it does.
So I've clicked "Build" and I receive this message:

Code
-------------- Build: Debug in Test (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\GTK\lib -L"C:\Program Files (x86)\CodeBlocks\MinGW\mingw32\bin" -o bin\Debug\Test.exe obj\Debug\main.o   -lgtk-win32-3.0 -lgobject-3.0 -lglib-2.0
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw32/bin/ld.exe: cannot find -lgobject-3.0
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

No idea what this tells me (except there is an error).
I'm looking forward to your help.
Thanks in advance.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Build error - while testing GTK+ project
« Reply #1 on: March 17, 2016, 02:14:38 pm »
Please read this FAQ http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Code::Blocks version ?
GTK library version and where did you get the GTK library from ?
Compiler name and version ?
Operating System information ?

Please also read the rules since you are a  first time poster http://forums.codeblocks.org/index.php/topic,9996.0.html
and the General FAQs http://wiki.codeblocks.org/index.php/FAQ#General

Tim S.
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

Offline jantma2

  • Single posting newcomer
  • *
  • Posts: 4
Re: Build error - while testing GTK+ project
« Reply #2 on: March 17, 2016, 02:37:03 pm »
Hello,

let's try a re-start of that post.

I am running Code::Blocks version 16.01 on Windows 7 64bit.
codeblocks-16.01mingw-setup.exe

The compiler I use is GNU GCC Compiler (no idea how to find the version number).

I got those GTK libraries (don't know which one is right)
gtk+-bundle_3.6.4-20130513_win64
gtk+-bundle_3.6.4-20130513_win32

This was my source:
http://www.tarnyko.net/dl/gtk.htm

From beginning of that week I'm running from error message to error message - beginning of folders not found - libraries not found - changing project script - changing toolchain.
Everything got me a step forward, but this error message blocked my way.

Code
-------------- Build: Debug in Test (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\GTK\lib -L"C:\Program Files (x86)\CodeBlocks\MinGW\mingw32\bin" -o bin\Debug\Test.exe obj\Debug\main.o   -lgtk-win32-3.0 -lgobject-3.0 -lglib-2.0
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw32/bin/ld.exe: cannot find -lgobject-3.0
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Build error - while testing GTK+ project
« Reply #3 on: March 17, 2016, 03:38:40 pm »
I think that codeblocks-16.01mingw-setup.exe has a 32 bit Mingw TDM GCC Compiler; but, I have no idea if you are using it or NOT.
Please post a full rebuild log And, I might have a chance at guessing from the output.

But, you could also post the Toolchain setting to know what Compiler you are using.
http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler#Compiler-neutral_setup_steps
I only need the "compiler's installation directory" to confirm you are using the 32 bit Mingw TDM GCC Compiler.
Edit2: In some unusual cases, another mingw GCC compiler  on the computer will interfere with the one set in the CB Toolchain.

Another FAQ that might help fix your issue is
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F
NOTE: Please use the Project setting (For your project) to fix the issue or in a few weeks; you will have another issue to fix!!

Tim S.
« Last Edit: March 17, 2016, 05:01:16 pm 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

Offline jantma2

  • Single posting newcomer
  • *
  • Posts: 4
Re: Build error - while testing GTK+ project
« Reply #4 on: March 17, 2016, 04:09:58 pm »

Please post a full rebuild log And, I might have a chance at guessing from the output.


Where do I find the full rebuild log - I've postet everything that I found in "Build log"-Tab.


you could also post the Toolchain setting to know what Compiler


I hope the attached picture is the information you'd like to have.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Build error - while testing GTK+ project
« Reply #5 on: March 17, 2016, 05:03:13 pm »
You appear to be using the mingw shipped with Code::Blocks.

Edit (changed library to path): To fix your issue, try adding the linker search path!!
Do you know what hyper links are? If yes, follow the ones I post!
If no, then there is NO way for me to help you!

If you want any more help from me POST the FULL rebuild log!
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.
« Last Edit: March 17, 2016, 09:04:56 pm 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

Offline jantma2

  • Single posting newcomer
  • *
  • Posts: 4
Re: Build error - while testing GTK+ project
« Reply #6 on: March 18, 2016, 01:03:52 pm »
Hello,

while checking all those hyperlinks in detail I decided to redo the complete set up process.
And now it works - I don't exactly know which step I forgot last time. But  :)

Thanks for helping me to get in touch with code blocks.