How do I enable XCode stl debug mode?

I want to enable C ++ stl debug mode in XCode. I am using Clang version 9.1.0. I added _LIBCPP_DEBUG = 1 to XCode preprocessor macros. And after that I got several errors like this:

Error:(767, 20) no matching function for call to object of type '(lambda at /Users/semyon/Projects/VocalTrainer/PitchDetection/CppUtils/Algorithms.h:58:31)'
Included from:
(2) /Users/semyon/Projects/VocalTrainer/VocalTrainer/VxPlayer/VxFile.cpp
(9) /Users/semyon/Projects/VocalTrainer/VocalTrainer/VxPlayer/VxFile.h
(163) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/istream
(138) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ostream
(216) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios
(15) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale
(470) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string
(169) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view
(56) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string
Note:(4015, 17) in instantiation of function template specialization 'std::__1::__debug_less<(lambda at /Users/semyon/Projects/VocalTrainer/PitchDetection/CppUtils/Algorithms.h:58:31) &>::operator()<VxPitch, VxPitch>' requested here
Note:(4198, 5) in instantiation of function template specialization 'std::__1::__sort<std::__1::__debug_less<(lambda at /Users/semyon/Projects/VocalTrainer/PitchDetection/CppUtils/Algorithms.h:58:31) &> &, VxPitch *>' requested here
Note:(4235, 12) in instantiation of function template specialization 'std::__1::sort<VxPitch *, (lambda at /Users/semyon/Projects/VocalTrainer/PitchDetection/CppUtils/Algorithms.h:58:31) &>' requested here
Note:(58, 14) in instantiation of function template specialization 'std::__1::sort<VxPitch, (lambda at /Users/semyon/Projects/VocalTrainer/PitchDetection/CppUtils/Algorithms.h:58:31)>' requested here
Note:(65, 9) in instantiation of function template specialization 'CppUtils::SortByKey<std::__1::__wrap_iter<VxPitch *>, int (const VxPitch &)>' requested here
Note:(141, 5) in instantiation of function template specialization 'CppUtils::SortByKey<std::__1::vector<VxPitch, std::__1::allocator<VxPitch> >, int (const VxPitch &)>' requested here
Note:(58, 31) candidate function not viable: 1st argument ('const VxPitch') would lose const qualifier

      

But when I remove _LIBCPP_DEBUG = 1 everything compiles fine.

0
c ++ debugging stl xcode


source to share


No one has answered this question yet

See similar questions:

1
Is it possible to enable libc ++ debug checks?

or similar:

1517
How do I debug Node.js applications?
1348
How to "add existing frames" in Xcode 4?
3
No match constructor to initialize 'type'
1
Xcode error while compiling application
1
Multiple overloads of the __compressed_pair error implementing unordered_set
0
How to assign starting address to map observator <pair <long long int, long long int>, long long int>
0
ObjC structure overloading for C ++ unordered containers hash support
0
Error: "Attempting to use a remote function" when transferring a promise
-1
std :: thread in OpenCV function generates "Attempting to use remote function" error
-five
Vector return error



All Articles
Loading...
X
Show
Funny
Dev
Pics