#### === LMVM的報錯 === #### ###### 在iOS上使用cmake編譯時產生的 ###### ##### 以下是報錯內容: ##### **/LMVM/vm/main.cpp:21:20: error: no matching constructor for initialization of 'VirtualMachine'** ``` VirtualMachine vm(code,argv); ^ ~~~~~~~~~ ``` **/LMVM/vm/vm.h:29:5: note: candidate constructor not viable: no known conversion from 'std::vector' to 'const char *' for 1st argument** ``` VirtualMachine(const char* argc, char* argv[]); ^ ``` **/LMVM/vm/vm.h:28:5: note: candidate constructor not viable: requires single argument 'program', but 2 arguments were provided** ``` VirtualMachine(std::vector& program); ^ ``` **/LMVM/vm/vm.h:11:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided** ``` class VirtualMachine { ^ ``` **/LMVM/vm/main.cpp:30:31: error: invalid operands to binary expression ('basic_ostream>' and 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>'))** ``` std::cout << "Finish in " << dur_ms << std::endl; ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~ ``` **/var/jb/usr/bin/../include/c++/v1/cstddef:125:3: note: candidate function template not viable: no known conversion from 'basic_ostream>' to 'byte' for 1st argument** ``` operator<< (byte __lhs, _Integer __shift) noexcept ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:791:1: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'char' for 2nd argument** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:824:1: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'char' for 2nd argument** ``` operator<<(basic_ostream& __os, char __c) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:831:1: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'signed char' for 2nd argument** ``` operator<<(basic_ostream& __os, signed char __c) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:838:1: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'unsigned char' for 2nd argument** ``` operator<<(basic_ostream& __os, unsigned char __c) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:852:1: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const char *' for 2nd argument** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:898:1: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const char *' for 2nd argument** ``` operator<<(basic_ostream& __os, const char* __str) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:905:1: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const signed char *' for 2nd argument** ``` operator<<(basic_ostream& __os, const signed char* __str) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:913:1: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const unsigned char *' for 2nd argument** ``` operator<<(basic_ostream& __os, const unsigned char* __str) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1098:1: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const error_code' for 2nd argument** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1136:31: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'wchar_t' for 2nd argument** ``` basic_ostream& operator<<(basic_ostream&, wchar_t) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1139:31: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const wchar_t *' for 2nd argument** ``` basic_ostream& operator<<(basic_ostream&, const wchar_t*) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1157:31: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'char8_t' for 2nd argument** ``` basic_ostream& operator<<(basic_ostream&, char8_t) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1163:31: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const char8_t *' for 2nd argument** ``` basic_ostream& operator<<(basic_ostream&, const char8_t*) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1170:31: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'char16_t' for 2nd argument** ``` basic_ostream& operator<<(basic_ostream&, char16_t) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1173:31: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'char32_t' for 2nd argument** ``` basic_ostream& operator<<(basic_ostream&, char32_t) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1176:31: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const char16_t *' for 2nd argument** ``` basic_ostream& operator<<(basic_ostream&, const char16_t*) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1179:31: note: candidate function template not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const char32_t *' for 2nd argument** ``` basic_ostream& operator<<(basic_ostream&, const char32_t*) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:784:1: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('char' vs. 'typename enable_if<__is_duration>>::value, duration>>::type' (aka 'std::chrono::duration>'))** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c) ^ ``` **/var/jb/usr/bin/../include/c++/v1/__random/uniform_int_distribution.h:259:1: note: candidate template ignored: could not match 'uniform_int_distribution' against 'duration'** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:845:1: note: candidate template ignored: could not match 'const _CharT *' against 'typename enable_if<__is_duration>>::value, duration>>::type' (aka 'std::chrono::duration>')** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1081:1: note: candidate template ignored: could not match 'basic_string' against 'duration'** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1089:1: note: candidate template ignored: could not match 'basic_string_view' against 'duration'** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1106:1: note: candidate template ignored: could not match 'shared_ptr' against 'duration'** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1125:1: note: candidate template ignored: could not match 'bitset' against 'duration'** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1073:11: note: candidate template ignored: requirement 'integral_constant::value' was not satisfied [with _Stream = std::ostream &, _Tp = std::chrono::duration>]** ``` _Stream&& operator<<(_Stream&& __os, const _Tp& __x) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1118:1: note: candidate template ignored: could not match 'unique_ptr' against 'duration'** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1142:34: note: candidate template ignored: could not match 'wchar_t' against 'char'** ``` basic_ostream& operator<<(basic_ostream&, char16_t) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1145:34: note: candidate template ignored: could not match 'wchar_t' against 'char'** ``` basic_ostream& operator<<(basic_ostream&, char32_t) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1148:34: note: candidate template ignored: could not match 'wchar_t' against 'char'** ``` basic_ostream& operator<<(basic_ostream&, const char16_t*) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1151:34: note: candidate template ignored: could not match 'wchar_t' against 'char'** ``` basic_ostream& operator<<(basic_ostream&, const char32_t*) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1160:34: note: candidate template ignored: could not match 'wchar_t' against 'char'** ``` basic_ostream& operator<<(basic_ostream&, char8_t) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:1166:34: note: candidate template ignored: could not match 'wchar_t' against 'char'** ``` basic_ostream& operator<<(basic_ostream&, const char8_t*) = delete; ^ ``` **/var/jb/usr/bin/../include/c++/v1/iomanip:362:1: note: candidate template ignored: could not match '__iom_t8' against 'duration'** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x) ^ ``` **/var/jb/usr/bin/../include/c++/v1/iomanip:482:1: note: candidate template ignored: could not match '__iom_t10' against 'duration'** ``` operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:220:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'ostream &(*)(ostream &)' for 1st argument** ``` basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&)) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:224:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'basic_ios &(*)(basic_ios &)' (aka 'basic_ios> &(*)(basic_ios> &)') for 1st argument** ``` basic_ostream& operator<<(basic_ios& ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:229:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'ios_base &(*)(ios_base &)' for 1st argument** ``` basic_ostream& operator<<(ios_base& (*__pf)(ios_base&)) ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:232:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'bool' for 1st argument** ``` basic_ostream& operator<<(bool __n); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:233:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'short' for 1st argument** ``` basic_ostream& operator<<(short __n); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:234:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'unsigned short' for 1st argument** ``` basic_ostream& operator<<(unsigned short __n); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:235:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'int' for 1st argument** ``` basic_ostream& operator<<(int __n); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:236:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'unsigned int' for 1st argument** ``` basic_ostream& operator<<(unsigned int __n); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:237:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'long' for 1st argument** ``` basic_ostream& operator<<(long __n); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:238:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'unsigned long' for 1st argument** ``` basic_ostream& operator<<(unsigned long __n); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:239:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'long long' for 1st argument** ``` basic_ostream& operator<<(long long __n); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:240:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'unsigned long long' for 1st argument** ``` basic_ostream& operator<<(unsigned long long __n); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:241:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'float' for 1st argument** ``` basic_ostream& operator<<(float __f); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:242:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'double' for 1st argument** ``` basic_ostream& operator<<(double __f); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:243:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'long double' for 1st argument** ``` basic_ostream& operator<<(long double __f); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:244:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'const void *' for 1st argument; take the address of the argument with &** ``` basic_ostream& operator<<(const void* __p); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:253:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'basic_streambuf *' (aka 'basic_streambuf> *') for 1st argument** ``` basic_ostream& operator<<(basic_streambuf* __sb); ^ ``` **/var/jb/usr/bin/../include/c++/v1/ostream:259:20: note: candidate function not viable: no known conversion from 'const typename enable_if<__is_duration>>::value, duration>>::type' (aka 'const std::chrono::duration>') to 'nullptr_t' (aka 'std::nullptr_t') for 1st argument** ``` basic_ostream& operator<<(nullptr_t) ^ ``` **2 errors generated.** **make[2]: *** [CMakeFiles/lmvm.dir/build.make:76: CMakeFiles/lmvm.dir/vm/main.cpp.o] Error 1** **make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/lmvm.dir/all] Error 2** **make: *** [Makefile:91: all] Error 2**