Author Topic: Problem linking  (Read 2948 times)

Offline VonZorch

  • Single posting newcomer
  • *
  • Posts: 4
Problem linking
« on: December 14, 2013, 06:23:16 am »
I have finally managed to get my project to compile but I get an error from linking.
I think it has to do with Code::Blocks linker settings.
Build log output,
-
Quote
------------- Build: Debug in GrUFFF (compiler: GNU GCC Compiler)---------------

g++ -L/usr/include/wx-2.8/  -o bin/Debug/GrUFFF obj/Debug/frmGrUFFF.o obj/Debug/main.o   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype    -pg  /usr/include/wx-2.8/
/usr/bin/ld: cannot find /usr/include/wx-2.8/: File format not recognized
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings (0 minutes, 0 seconds)

, the error is in bold,  /usr/include/wx-2.8/ does exist.

This is my first project in C++ and my first use of Code::Blocks, so assume that I do not know the simplest, most obvious things.  Experts tend to forget that what is obvious to them is completely unknown to beginners.

The project currently is just the user interface, it doesn't do any thing yet, might that be the problem?
If this is not the proper place for my post kindly point me in the right direction.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 6548
    • My Best Post
Re: Problem linking
« Reply #1 on: December 14, 2013, 07:17:44 am »
"/usr/include/wx-2.8"
Does this folder exist?

Did you install wxWidgets/wxGTK 2.8 development library?
If NOT, do so.

If yes, does wx-config work?

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11821
    • Travis build status
Re: Problem linking
« Reply #2 on: December 14, 2013, 10:11:14 am »
I think there is a problem with your project or global compiler options.
You've placed "/usr/include/wx-2.8" in a place where you should not have done so.
(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 VonZorch

  • Single posting newcomer
  • *
  • Posts: 4
Re: Problem linking
« Reply #3 on: December 16, 2013, 04:17:36 pm »
Tim S. yes on all accounts.

oBFusCATed, I haven't placed anything, everything is from a default install.  As for compiler options, note complete beginner here, I don't know enough about Code::Blocks or C++ to have an idea what I need to set.  The manual is written for someone with at least basic knowledge.  Where can I find that sort of information targeted for someone starting with no background knowledge?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6548
    • My Best Post
Re: Problem linking
« Reply #4 on: December 16, 2013, 04:59:56 pm »
oBFusCATed, I haven't placed anything, everything is from a default install.  As for compiler options, note complete beginner here, I don't know enough about Code::Blocks or C++ to have an idea what I need to set.  The manual is written for someone with at least basic knowledge.  Where can I find that sort of information targeted for someone starting with no background knowledge?

Read this link http://wiki.codeblocks.org/index.php?title=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

Please use the "For your project " setting till you know what you are doing.
NOTE: If you changed the "For global environment" you may NEED to undo the changes!

Check: The "Compiler Settings" -> "Other Options" and "Linker Settings" -> "Other Linker Options" for problems.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Problem linking
« Reply #5 on: December 16, 2013, 05:33:57 pm »
oBFusCATed, I haven't placed anything, everything is from a default install.

If that's the truth, you have a broken OS/install.
This is definitely not the output of a default install or a wizard created project, at least not from one of our wizards or from wx-config.