jiixyj / loudness-scanner

A tool that scans your music files and tags them with loudness information.
MIT License
133 stars 23 forks source link

Needed CXX_STANDARD 11 for target scanner-tag to compile #33

Open heuchi opened 6 years ago

heuchi commented 6 years ago

Hi, thanks for this nice tool.

I just wanted to report that on my Ubuntu 16.04.5 LTS it did not compile until I added this line to scanner/CMakeLists.txt

set_property(TARGET scanner-tag PROPERTY CXX_STANDARD 11)
creechy commented 6 years ago

Where do you put this in the CMakeLists.txt file? Were you getting errors similar to these?

[ 73%] Building CXX object scanner/scanner-tag/CMakeFiles/scanner-tag.dir/rgtag.cpp.o /home/ec2-user/loudness-scanner/scanner/scanner-tag/rgtag.cpp: In function ‘bool tag_vorbis_comment(const char*, const char*, gain_data*, gain_data_strings*, bool)’: /home/ec2-user/loudness-scanner/scanner/scanner-tag/rgtag.cpp:310:39: error: expected type-specifier before ‘uint16_t’ static_cast<char>(static_cast<uint16_t>(opus_header_gain_int) & 0xff);

heuchi commented 6 years ago

I've just added it at the very end of file scanner/CMakeLists.txt This is what I get without it:

[ 25%] Building CXX object scanner/scanner-tag/CMakeFiles/scanner-tag.dir/rgtag.cpp.o
/home/joern/src/loudness-scanner/scanner/scanner-tag/rgtag.cpp: In function ‘bool tag_vorbis_comment(const char*, const char*, gain_data*, gain_data_strings*, bool)’:
/home/joern/src/loudness-scanner/scanner/scanner-tag/rgtag.cpp:310:39: error: ‘uint16_t’ does not name a type
         static_cast(static_cast(opus_header_gain_int) & 0xff);
                                       ^
/home/joern/src/loudness-scanner/scanner/scanner-tag/rgtag.cpp:312:39: error: ‘uint16_t’ does not name a type
         static_cast(static_cast(opus_header_gain_int) >> 8);
                                       ^
/home/joern/src/loudness-scanner/scanner/scanner-tag/rgtag.cpp:317:24: error: ‘to_string’ is not a member of ‘std’
                        std::to_string(opus_r128_track_gain_int));
                        ^
/home/joern/src/loudness-scanner/scanner/scanner-tag/rgtag.cpp:320:26: error: ‘to_string’ is not a member of ‘std’
                          std::to_string(opus_r128_album_gain_int));
                          ^
creechy commented 6 years ago

Thanks... I was using an older version of CMAKE (2.8.12.2) that was ignoring the directive. Its working for me now with CMAKE 3.6.1. Thanks for the tip.

CartoonFan commented 5 years ago

Is this still an issue? Compilation seems to work fine for me.

schdro commented 1 year ago

Same failure happens for me with gcc 13. Not seen with older gcc versions.

Issue obviously is that uint16_t is officially provided only by header file <cstdint>.

May have compiled with older compiler versions if indirectly some other std header files still pulled in type definitions.

Obvious fix is that any cpp file (like rgtag.cpp) referring to such sized integer types on its own must include .