admin管理员组文章数量:1302979
Following their template, I have:
conan new cmake_lib -d name=mlpackmsvc -d requires=mlpack/4.4.0
followed by conan build .
This ends up with error:
C:\test\src\mlpackmsvc.cpp(3,10): error C1083: Cannot open include file: 'mlpack.h': No such file or directory [C:\test\build\mlpackmsvc.vcxproj]
ERROR: conanfile.py (mlpackmsvc/0.1): Error in build() method, line 48
cmake.build()
ConanException: Error 1 while executing
My default profile is
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.version=194
os=Windows
How can this error be fixed?
Following their template, I have:
conan new cmake_lib -d name=mlpackmsvc -d requires=mlpack/4.4.0
followed by conan build .
This ends up with error:
C:\test\src\mlpackmsvc.cpp(3,10): error C1083: Cannot open include file: 'mlpack.h': No such file or directory [C:\test\build\mlpackmsvc.vcxproj]
ERROR: conanfile.py (mlpackmsvc/0.1): Error in build() method, line 48
cmake.build()
ConanException: Error 1 while executing
My default profile is
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.version=194
os=Windows
How can this error be fixed?
Share asked Feb 11 at 4:59 One_Cable5781One_Cable5781 655 bronze badges 3 |1 Answer
Reset to default 1The conan new
templates doesn't generate the correct #include
or function calls for any arbitrary dependency. I t just takes the -d requires=pkg/version
argument and generates a placeholder #include "pkg.h"
and a function call pkg();
.
This works if the other package called pkg
was also generated with another conan new cmake_lib -d name=pkg
command , but it won't work for any random third party library.
So you need to change the placeholders header name and function call to something that really exists in mlpack
.
本文标签: cmakeconan new template project build fails with header file not foundStack Overflow
版权声明:本文标题:cmake - conan new template project build fails with header file not found - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741678041a2392001.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
mlpack.h
a file that actually exist in that package? With that path? Theconan new template
doesn't generate the correct#include
or function call, it just takes the-d requires=pkg/version
and generates a placeholder#include "pkg.h"
and a function callpkg();
. This works if the otherpkg
was also generated with anotherconan new cmake_lib -d name=pkg
, but it won't work for any random third party library. So you need to change the header name to something that really exists in mlpack, and same for function call. – drodri Commented Feb 11 at 8:30mlpack.hpp
mlpack./doc/quickstart/cpp.html I will fix that and hopefully the error goes away. Thank you for your help! – One_Cable5781 Commented Feb 11 at 8:59