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

编译报错了。 #3

Open
mrpanwei opened this issue Nov 8, 2022 · 4 comments
Open

编译报错了。 #3

mrpanwei opened this issue Nov 8, 2022 · 4 comments

Comments

@mrpanwei
Copy link

mrpanwei commented Nov 8, 2022

error: there are no arguments to ‘get_database_configs’ that depend on a template parameter, so a declaration of ‘get_database_configs’ must be available [-fpermissive]

@xmh0511
Copy link
Owner

xmh0511 commented Nov 8, 2022

用的哪个版本的编译器,具体是哪个文件?

@mrpanwei
Copy link
Author

mrpanwei commented Nov 9, 2022

-编译器及系统信息(g++ --version / uname -a):

  • g++ (Ubuntu 11.2.0-16ubuntu1) 11.2.0
    -Linux ubuntu 5.4.0-110-generic #124~18.04.1-Ubuntu x86_64 x86_64 x86_64 GNU/Linux
  • err终端信息:
  • xorm/dao.hpp:63:17: error: ‘unordered_map’ in namespace ‘std’ does not name a template type inline std::unordered_map<std::string,std::shared_ptr<data_base>>& get_database_configs()
  • xorm/dao.hpp:76:42: error: there are no arguments to ‘get_database_configs’ that depend on a template parameter, so a declaration of ‘get_database_configs’ must be available [-fpermissive]

@xmh0511
Copy link
Owner

xmh0511 commented Nov 9, 2022

xorm/dao.hpp:63:17: error: ‘unordered_map’ in namespace ‘std’ does not name a template type inline std::unordered_map<std::string,std::shared_ptr<data_base>>& get_database_configs()

这个错误有点奇怪,你先尝试在dao.hpp引入头文件 #include <unordered_map>看是否能解决。 get_database_configs的声明在 class dao的定义之前,不存在找不到,应该是其他问题导致的。

@mrpanwei
Copy link
Author

就是这个问题呢,引入头文件 #include <unordered_map> 就解决。谢谢大佬!

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

2 participants