Author Topic: Fedora 7 and Code::Blocks  (Read 6407 times)

stefanos_

  • Guest
Fedora 7 and Code::Blocks
« on: November 14, 2007, 12:58:24 am »
Dear All,

After 4 years of FreeBSD usage I decided to migrate to Fedora x environment for reasons that FreeBSD team already knows [hardware support, a lot of troubleshooting and continuously messing with portupgrade and broken dependencies...oh the most important - Flash Player and USB headset].

A major reason was Code::Blocks. Under Windows I use a Portable Edition of Code::Blocks I have created myself and works amazing.

Now my problem is that I have installed Code::Blocks and at first, an error message appeared. Something about a missing file or directory...I immediately remembered the case where a setup.h file was supposed to be inside wx directory. I searched for it and found it TWICE under /usr/lib/wx/copy. One inside config and once within include. I tested both of them and the error message this time altered dramatically.


Here is my issue:


:: === wxMyGod, Debug ===
/usr/include/wx-2.8/wx/defs.h:42: error: #error "No Target! You should use wx-config program for compilation flags!"
/usr/include/assert.h:39: error: missing binary operator before token "("
/usr/include/assert.h:105: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:46: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:50: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:138: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:196: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:205: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:214: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:223: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:235: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:245: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:254: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:262: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:276: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:297: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:302: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:309: error: missing binary operator before token "("
/usr/include/sys/types.h:158: error: missing binary operator before token "("
/usr/include/assert.h:69: error: expected constructor, destructor, or type conversion before ‘extern’
/usr/include/assert.h:77: error: expected initializer before ‘__THROW’
/usr/include/assert.h:83: error: expected initializer before ‘__THROW’
/usr/include/assert.h:86: error: ‘__END_DECLS’ does not name a type
/usr/include/stdio.h:49: error: expected constructor, destructor, or type conversion before ‘typedef’
/usr/include/stdio.h:65: error: expected constructor, destructor, or type conversion before ‘typedef’
/usr/include/gconv.h:72: error: ‘size_t’ has not been declared
/usr/include/gconv.h:88: error: ‘size_t’ has not been declared
/usr/include/gconv.h:97: error: ‘size_t’ has not been declared
/usr/include/gconv.h:174: error: ‘size_t’ does not name a type
/usr/include/gconv.h:176: error: expected ‘;’ before ‘__flexarr’
/usr/include/libio.h:329: error: ‘size_t’ does not name a type
/usr/include/libio.h:333: error: ‘size_t’ was not declared in this scope
/usr/include/libio.h:361: error: ‘size_t’ has not been declared
/usr/include/libio.h:370: error: ‘size_t’ has not been declared
/usr/include/libio.h:486: error: ‘size_t’ does not name a type
/usr/include/stdio.h:174: error: expected initializer before ‘*’ token
/usr/include/stdio.h:216: error: ‘FILE’ was not declared in this scope
/usr/include/stdio.h:216: error: ‘__stream’ was not declared in this scope
/usr/include/stdio.h:221: error: ‘FILE’ was not declared in this scope
/usr/include/stdio.h:221: error: ‘__stream’ was not declared in this scope
/usr/include/stdio.h:251: error: expected initializer before ‘*’ token
/usr/include/stdio.h:257: error: expected initializer before ‘*’ token
/usr/include/stdio.h:309: error: variable or field ‘setbuf’ declared void
/usr/include/stdio.h:309: error: ‘FILE’ was not declared in this scope
/usr/include/stdio.h:309: error: expected primary-expression before ‘__restrict__’
/usr/include/stdio.h:309: error: expected primary-expression before ‘char’
/usr/include/stdio.h:309: error: initializer expression list treated as compound expression
/usr/include/stdio.h:313: error: ‘FILE’ was not declared in this scope
/usr/include/stdio.h:313: error: expected primary-expression before ‘__restrict__’
/usr/include/stdio.h:313: error: expected primary-expression before ‘char’
:: More errors follow but not being shown.
:: Edit the max errors limit in compiler options...
:: === Build finished: 50 errors, 0 warnings ===


I hope someone can help me to solve this issue...of course good advices is alway welcome too :D

Kindest Regards,

Stefanos
« Last Edit: November 14, 2007, 09:58:22 pm by stefanos_ »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Fedora 7 and Code::Blocks
« Reply #1 on: November 14, 2007, 07:16:48 am »
The first is you should use a recent version of codeblocks, but I think you do.
The second you need a wxWidgets development package, but that also seems to be installed.
I don't know in which Fedora package "wx-config" is included, but you need this one. You can test for the existance of "wx-config" by typing "wx-config" on the console. That should give you a short help if it's installed.

Than try to create a new (wxWidgets)-project with the wizard.

Right-click on your project in the Projects-tab of the manager.
Under "Build Options ..." you find a dialog with your project and the created targets (normally debug and release) on the left.
Highlight your project and have a look on "Compiler Settings -> Other options" and "Linker Settings -> Other Linker options:".
There you can see the simplest example how to use "wx-config" (the backticks are important at this place).
"wx-config" knows the place of the includes and libs needed by wxWidgets and for simple project without special dependencies to other packages you will not need to think about include- and linker-paths.

Offline PsYhLo

  • Almost regular
  • **
  • Posts: 157
Re: Fedora 7 and Code::Blocks
« Reply #2 on: November 14, 2007, 07:35:14 am »
the "wx-config" is in devel package  8)

stefanos_

  • Guest
Re: Fedora 7 and Code::Blocks
« Reply #3 on: November 14, 2007, 05:49:21 pm »
Guys, thank you both for your replies. I must say that I have already tried that before I came here and the issue remains the same. I don't know what I'm doing wrong but I must say it's an annoying issue.

If someone could help me with the configuration procedure would be extremely appreciated.

Bear in mind though that I installed Code::Blocks with / from YUM > RPM files and not from source. Therefore I need this extra help :)

Let me clarify what I did and I am sure the answer is somewhere here.

Running the wx-config script with -cppflags and --libs would give me something like this:

# /usr/bin/wx-config --cppflags --libs
-I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__
-pthread   -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8


Also I went to Code::Blocks and added `wx-config --cppflags --libs` in "Projects > Build in Options > Linker Settings > Link Libraries". I have tried to rebuild my project, still the same issue. I am sure is something that has to do with my setup.h

I must saved it with a wrong way, or my paths are wrong. I don't know what else to do.

Please advice...again :D

Regards,

Stefanos


P.S: Mr. Yanni how are you? Long time to talk :)

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Fedora 7 and Code::Blocks
« Reply #4 on: November 14, 2007, 06:38:47 pm »
Also I went to Code::Blocks and added `wx-config --cppflags --libs` in "Projects > Build in Options > Linker Settings > Link Libraries". I have tried to rebuild my project, still the same issue. I am sure is something that has to do with my setup.h

`wx-config --cppflags` belongs to "Projects -> Build Options ... -> Compiler Settings -> Other options" and `wx-config --libs` belongs to Projects -> Build Options ... -> Linker Settings -> Other Linker options:" .

stefanos_

  • Guest
Re: Fedora 7 and Code::Blocks
« Reply #5 on: November 14, 2007, 07:20:30 pm »
Quote
I had that already and still the issue is the same :/ I will try something else...I will try to delete setup.h and tell you the result. noooop...:( the issue is the same!

18/11/2007 05.31 Cyprus time. After a long investigation I have manually tested my code from terminal and my code works just fine!

Something is wrong with the link methods and I don't know what exactly I'm doing wrong...here is my procedure:

Go to your project directory. You must have your standard files, wxblabla.h wxblabla.cpp among others. Here you will have a directory that has the same name of a file: wx_pch.h.gch.

Please delete THE DIRECTORY and not the file!

Then, type this command: g++ <header-name>.h <cpp-name>.cpp `wx-config --cxxflags --libs` -o test

IT WORKS!!!!!!!! type ./test from your terminal or go to project directory and double click it. Works just fine...

Please bear in mind that the ( ` ) character exists right under escape button as long as you use the US keyboard key.

Now can please someone help me to detect my issue so I may fix it? It's a real pain in the ....you know the word!

As far as I can see paths do not work properly.


JENS YOU ARE THE MAN!!! I was so tired to see the proper way man that I was putting everything in the same directory...I'm such a moron!!! GOD!!!
Finally I HAVE CODEBLOCKS UNDER FEDORA 7!!! YEEEEEEEEEEEAH BABY YEAAAAAAAAAAAAAAH!

Another one day has gone with few hours of sleep.

Good Morning People...
« Last Edit: November 18, 2007, 05:02:01 am by stefanos_ »