Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make error on windows #1

Open
943fansi opened this issue May 22, 2023 · 5 comments
Open

make error on windows #1

943fansi opened this issue May 22, 2023 · 5 comments

Comments

@943fansi
Copy link

after enter mingw32-make , got following:

[  1%] Building CXX object CMakeFiles/asr_test.dir/src/am/am.cpp.obj
[  3%] Building CXX object CMakeFiles/asr_test.dir/src/asr/asr.cpp.obj
[  5%] Building CXX object CMakeFiles/asr_test.dir/src/decoder/ctc_beam_search_decoder.cpp.obj
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:12:32: error: 'numeric_limits' is not a member of 'std'
   12 | const float NUM_FLT_INF = std::numeric_limits<float>::max();
      |                                ^~~~~~~~~~~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:12:47: error: expected primary-expression before 'float'
   12 | const float NUM_FLT_INF = std::numeric_limits<float>::max();
      |                                               ^~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:13:32: error: 'numeric_limits' is not a member of 'std'
   13 | const float NUM_FLT_MIN = std::numeric_limits<float>::min();
      |                                ^~~~~~~~~~~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:13:47: error: expected primary-expression before 'float'
   13 | const float NUM_FLT_MIN = std::numeric_limits<float>::min();
      |                                               ^~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp: In function 'T log_sum_exp(const T&, const T&)':
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:19:34: error: 'numeric_limits' is not a member of 'std'
   19 |         static T num_min = -std::numeric_limits<T>::max();
      |                                  ^~~~~~~~~~~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:19:50: error: expected primary-expression before '>' token
   19 |         static T num_min = -std::numeric_limits<T>::max();
      |                                                  ^
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:19:53: error: '::max' has not been declared; did you mean 'std::max'?
   19 |         static T num_min = -std::numeric_limits<T>::max();
      |                                                     ^~~
      |                                                     std::max
In file included from D:/TODO/mingw-w64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c  /algorithm:61,
                 from E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:4:
D:/TODO/mingw-w64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c  /bits/stl_algo.h:5756:5: note: 'std::max' declared here
 5756 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
mingw32-make[2]: *** [CMakeFiles\asr_test.dir\build.make:111: CMakeFiles/asr_test.dir/src/decoder/ctc_beam_search_decoder.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:95: CMakeFiles/asr_test.dir/all] Error 2
mingw32-make: *** [Makefile:103: all] Error 2
@943fansi
Copy link
Author

when I use C 17, got following error:

Scanning dependencies of target asr_test
[  1%] Building CXX object CMakeFiles/asr_test.dir/src/am/am.cpp.obj
[  3%] Building CXX object CMakeFiles/asr_test.dir/src/asr/asr.cpp.obj
[  5%] Building CXX object CMakeFiles/asr_test.dir/src/decoder/ctc_beam_search_decoder.cpp.obj
[  7%] Building CXX object CMakeFiles/asr_test.dir/src/feat/extract_feat.cpp.obj
[  8%] Building CXX object CMakeFiles/asr_test.dir/src/feat/hanning.cpp.obj
[ 10%] Building CXX object CMakeFiles/asr_test.dir/src/nn/nn.cpp.obj
[ 12%] Building CXX object CMakeFiles/asr_test.dir/src/decoder/scorer.cpp.obj
In file included from E:/SummerAsr-master/src/lm/model.hh:13,
                 from E:\SummerAsr-master\src\decoder\scorer.cpp:4:
E:/SummerAsr-master/src/lm/vocab.hh:210:43: error: ISO C  17 does not allow dynamic exception specifications
  210 | void MissingUnknown(const Config &config) throw(SpecialWordMissingException);
      |                                           ^~~~~
E:/SummerAsr-master/src/lm/vocab.hh:211:67: error: ISO C  17 does not allow dynamic exception specifications
  211 | void MissingSentenceMarker(const Config &config, const char *str) throw(SpecialWordMissingException);
      |                                                                   ^~~~~
E:/SummerAsr-master/src/lm/vocab.hh:213:85: error: ISO C  17 does not allow dynamic exception specifications
  213 | template <class Vocab> void CheckSpecials(const Config &config, const Vocab &vocab) throw(SpecialWordMissingException) {
      |                                                                                     ^~~~~
mingw32-make[2]: *** [CMakeFiles\asr_test.dir\build.make:167: CMakeFiles/asr_test.dir/src/decoder/scorer.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:95: CMakeFiles/asr_test.dir/all] Error 2
mingw32-make: *** [Makefile:103: all] Error 2

@huakunyang
Copy link
Owner

when I use C 17, got following error:

Scanning dependencies of target asr_test
[  1%] Building CXX object CMakeFiles/asr_test.dir/src/am/am.cpp.obj
[  3%] Building CXX object CMakeFiles/asr_test.dir/src/asr/asr.cpp.obj
[  5%] Building CXX object CMakeFiles/asr_test.dir/src/decoder/ctc_beam_search_decoder.cpp.obj
[  7%] Building CXX object CMakeFiles/asr_test.dir/src/feat/extract_feat.cpp.obj
[  8%] Building CXX object CMakeFiles/asr_test.dir/src/feat/hanning.cpp.obj
[ 10%] Building CXX object CMakeFiles/asr_test.dir/src/nn/nn.cpp.obj
[ 12%] Building CXX object CMakeFiles/asr_test.dir/src/decoder/scorer.cpp.obj
In file included from E:/SummerAsr-master/src/lm/model.hh:13,
                 from E:\SummerAsr-master\src\decoder\scorer.cpp:4:
E:/SummerAsr-master/src/lm/vocab.hh:210:43: error: ISO C  17 does not allow dynamic exception specifications
  210 | void MissingUnknown(const Config &config) throw(SpecialWordMissingException);
      |                                           ^~~~~
E:/SummerAsr-master/src/lm/vocab.hh:211:67: error: ISO C  17 does not allow dynamic exception specifications
  211 | void MissingSentenceMarker(const Config &config, const char *str) throw(SpecialWordMissingException);
      |                                                                   ^~~~~
E:/SummerAsr-master/src/lm/vocab.hh:213:85: error: ISO C  17 does not allow dynamic exception specifications
  213 | template <class Vocab> void CheckSpecials(const Config &config, const Vocab &vocab) throw(SpecialWordMissingException) {
      |                                                                                     ^~~~~
mingw32-make[2]: *** [CMakeFiles\asr_test.dir\build.make:167: CMakeFiles/asr_test.dir/src/decoder/scorer.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:95: CMakeFiles/asr_test.dir/all] Error 2
mingw32-make: *** [Makefile:103: all] Error 2

Window上编译可能需要修改,我空了来改改看,谢谢你的尝试。

@Caviar2023
Copy link

Windows 下编译ok

@niuli2024
Copy link

Windows 下编译ok

请教一下,windows下使用什么指令编译?

@1456214718
Copy link

[ 50%] Building CXX object CMakeFiles/asr_test.dir/src/util/file.cc.obj
D:/c /SummerAsr-master/src/util/file.cc: 在函数‘void util::ResizeOrThrow(int, uint64_t)’中:
D:/c /SummerAsr-master/src/util/file.cc:163:12: 错误:‘ftruncate’在此作用域中尚未声明
(fd, to);
^
D:/c /SummerAsr-master/src/util/file.cc: 在函数‘FILE* util::FDOpenOrThrow(util::scoped_fd&)’中:
D:/c /SummerAsr-master/src/util/file.cc:395:20: 错误:‘fdopen’不是‘std’的成员
std::FILE ret = std::fdopen(file.get(), "r b");
^~~
D:/c /SummerAsr-master/src/util/file.cc: 在函数‘FILE
util::FDOpenReadOrThrow(util::scoped_fd&)’中:
D:/c /SummerAsr-master/src/util/file.cc:402:20: 错误:‘fdopen’不是‘std’的成员
^~~
CMakeFiles/asr_test.dir/build.make:481: recipe for target 'CMakeFiles/asr_test.dir/src/util/file.cc.obj' failed
make[2]: *** [CMakeFiles/asr_test.dir/src/util/file.cc.obj] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/asr_test.dir/all' failed
make[1]: *** [CMakeFiles/asr_test.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
这个错误怎么解决?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants