This is a discussion on aCC compiler failing due to static storage class within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> Hi, I am trying to compile some source code in aCC 3.39 and in various places I am getting ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I am trying to compile some source code in aCC 3.39 and in various places I am getting Error 566: "tmcxaps.cxx", line 1812 # Static class member "const int ApsConstants::OLD_PORT" m ay not have this storage class. 04:52:50.142 [250] static const int ApsConstants::OLD_PORT(FALSE); I did not get this with version 3.25. Can anyone identify the problem? Thanks Wil |
| |||
| Sn0tters@yahoo.co.uk writes: > I am trying to compile some source code in aCC 3.39 and in various > places I am getting > > Error 566: "tmcxaps.cxx", line 1812 # Static class member "const int > ApsConstants::OLD_PORT" may not have this storage class. > 04:52:50.142 [250] static const int ApsConstants::OLD_PORT(FALSE); You are not asking a smart question. Try reading this: http://catb.org/%7Eesr/faqs/smart-questions.html and ask again. > Can anyone identify the problem? I can *guess* that the minimal test case is: struct ApsConstants { static const int OLD_PORT; }; static const int ApsConstants::OLD_PORT = 0; If that's the case, your code is bogus. Drop the second 'static' from it, and it will compile fine. Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. |
| ||||
| Well, I was trying not to give a flood of irrelevant information but you are correct in retrospect it was a bit minimalist! Anyway your minimal test cae was pretty much correct and the removal of static has solved the problem. Thanks! Wil |