C - make - error: extra qualification ‘ctrace::’ on member ‘ctrace’
1 Attachment(s)
Hi --My C was never that great but at one time I was able to hack through issues like this. That was many years ago and today I'm feeling fairly clueless about what to do with this. My questions:
1) Is there an option to tell make to ignore this sort of error? 2) If you look at trace.h (attached) there's a comment about two ctraces but only one is used. Could this be a matter of enabling/disabling one? There's no comment about how that might be done. This code is from: http://snarfed.org/synchronizing_mp3_playback Code:
#p4sync-0.1> make |
The warning on line 36 of player.h is a somewhat bogus warning. There is little correlation between the situation the compiler is complaining about and the run time bug that the compiler writers think they are helping you avoid.
The error on line 101 of trace.h is more serious, but easy to fix. Part of the code on that line says ctrace::ctrace when it is supposed to say just ctrace I haven't tried to find the source code. I am going entirely by the error message you quoted. If you are confused or you think I might be guessing incorrectly (which I think is unlikely) please post several lines of code from trace.h around line 101 and highlight which line exactly is line 101. Then someone could verify what I said you should change on that line. The actual error in the code is an incorrect C++ syntax that used to be very common in C++ source code. GCC has gradually gotten stricter from version to version, old gcc just ignored the syntax error because the compiler knows what the code is supposed to mean, later gcc versions warned about that error and went on to compile the code anyway. Now (at least with the settings you used) it insists you fix that syntax error. Quote:
Quote:
So I can't guess your meaning regarding "comment about two ctraces". I'm pretty sure line 101 has ctrace::ctrace where the correct C++ syntax is just ctrace Edit: There seems to have been some lag between when you edited to add the attached file and when I got to see it. Anyway, now I see it. There is a line that looks like Code:
ctrace::ctrace() : out(cerr) {} Code:
ctrace() : out(cerr) {} The syntax of the original line is required/correct only if the line appears outside of the class definition and is defining a constructor that, inside the class definition, was declared but not defined. The syntax without the extra ctrace:: is required/correct when declaring (or both declaring and defining) the constructor inside the class definition. |
1 Attachment(s)
Hey thanks --this was really helpful. I managed to make the change which allowed the compilation to proceed a bit further. This is maybe a different question but what I'm looking at now is:
Code:
# p4sync-0.1> make Thank you! |
"p4sync" : The code was edited 2 hours ago ?
https://github.com/snarfed/p4sync 1) $ git clone https://github.com/snarfed/p4sync.git 2) $ cd p4sync/ && make : No errors, no warnings. May be you got an old version ? "p4sync-0.1" ? |
It is not make giving you a warning, it is gnu c++
It is usually better to fix the warning rather than take the bulb out, but you can turn them off, If you do man g++ and search for 'Warn' you will find a load of warnings you can tailor. I often do -Wno-parentheses If you do a 'no' warning it needs to come after a -Wall otherwise obviously it will be toggled back on. |
you can check if assert.h included somewhere, probably it is missing. Otherwise you can comment out both lines in player.cpp
|
pan64 gave the answer I would have given if I saw your question earlier (the assert lines can be left out without damaging the program, or the proper #include could be added near the top of the .cpp file to declare assert).
But I think knudfl's answer might be better. If I understand correctly, knudfl is telling you how to get a newer version of the source code that doesn't have these problems. |
All times are GMT -5. The time now is 09:02 PM. |