Author Topic: No support for inline in Linux Codeblocks  (Read 2473 times)

Offline Aslund

  • Single posting newcomer
  • *
  • Posts: 4
No support for inline in Linux Codeblocks
« on: September 10, 2009, 10:12:21 am »
Hey everyone

I have started a project where I need matrix, last year I used a header file supplied from my education book in Code::Blocks under windows and Visual Studio. Now I wish to use it in my Code::Blocks under Linux, but it seems to complain about the inline function. The header file have never before given any errors, so I am a bit confused why it wont compile.
I supply a sample of the code where the error are shown and the error message produced by Code::Blocks.

Thanks for the help.

Regards
Sebastian Aslund

[attachment deleted by admin]

zabzonk

  • Guest
Re: No support for inline in Linux Codeblocks
« Reply #1 on: September 10, 2009, 10:58:46 am »
The code you supplied is perfectly valid C++, and compiles without errors under the Comeau compiler at http://www.comeaucomputing.com/tryitout/, which is generally seen as being the most standards compliant. I suspect that you are using a very old version of GCC, in which case you need to upgrade. Also, this isn't really a Code::Blocks issue - CB is the IDE, and your problem seems to be with the compiler.
« Last Edit: September 10, 2009, 11:44:53 am by zabzonk »

Offline Aslund

  • Single posting newcomer
  • *
  • Posts: 4
Re: No support for inline in Linux Codeblocks
« Reply #2 on: September 10, 2009, 02:26:17 pm »
I see, but still, in both platforms Code::Blocks uses the GCC compiler. In my linux I gave the GCC 4.2, is it really that outdated?

zabzonk

  • Guest
Re: No support for inline in Linux Codeblocks
« Reply #3 on: September 10, 2009, 05:22:01 pm »
No, 4.2 should be OK, and the code compiles with GCC 4.4. I just took another look at the error message file you posted and noticed that it has strange characters in it around the const keyword:

/home/aslund/Dropbox/SDU/6.semester/Numeriske Metoder/Source-Code/tbe/NR_C301/code/nr3.h|32|error: expected unqualified-id before ‘const’

So another possibility is that the file you are compiling (though not the the one you posted) has been wrongly encoded, or edited with a non-plain text editor of some kind.