News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

No support for inline in Linux Codeblocks

Started by Aslund, September 10, 2009, 10:12:21 AM

Previous topic - Next topic

Aslund

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

#1
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.

Aslund

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

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.