ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
This is the error that I now suddenly get in this line to a class of mine (and it's the ONLY error):
Code:
librgbamap.c:11: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘=’ token
First of all what does this error mean? Secondly, this is the line that triggered it (and didn't before):
Code:
unsigned long rgbCube = Red * Green * Blue;
There should be nothing wrong with this line. I in fact had no errors in other similar lines.
Edit: Fixed by making the class a function and changing other errors within my code as an update to my customizable GTK RGBA module. Here is the full code:
I assume you're talking about the code you posted in this thread? It would be better if you posted it here, so that other members won't have to keep referring to that thread to see your code...
Are you still using those nonsensical "<=" variable assignments? I really don't see the logic in that...why are you trying to compare something before it even has a value assigned to it? I would tend to guess that's the cause of your problem.
EDIT: Thanks for posting your code.
Quote:
Reason: Fixed the error
So, GCC isn't complaining anymore? Problem solved?
Until he decides to write some scaffolding to test his code like any sane programmer does, I suspect we're going to continue to see a torrent of stupid and pointless posts flooding this sub-forum.
Until he decides to write some scaffolding to test his code like any sane programmer does, I suspect we're going to continue to see a torrent of stupid and pointless posts flooding this sub-forum.
I tried testing the function in the Linux Mint default gtkrc, and for some reason it didn't work (looked like a classic theme).
It didn't work because you completely miss fundamental concepts of programming. As a result you are writing senseless code with which you spam this forum.
for some reason it didn't work (looked like a classic theme).
Uhm -- lol. "Some reason" could be that your code does a handful of computations, only to throw the results completely away. Really, learn some structured/imperative programming first, start with "hello world¨...
Note the GTK-specific guint16 and guint32 declarations and the use of the 'pixel' declaration. Now GTK-related files are included for a purpose. And the computations are formulas taken from Wikipedia for alpha blending.
Don't want to be laughed at? Don't be the clown. You had more than enough hints!
Right, hints are good and were totally appropriate in this post, because the OP seems to be missing some fundamental programming concepts.
@Kenny_Strawn: you should generally not be offended if someone tells you that you need a bit better understanding of some fundamentals. That should just help you to avoid such errors in the future.
BUT, I totally agree with Kenny_Strawn, that there are different ways to tell someone to dig further into the details. And just laughing at someone is definitely NOT the correct way. I think MOST of us were beginners at some time ;-)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.