Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.3k stars 4.15k forks source link

windows ncnn::create_gpu_instance”: dll 链接不一致 #5580

Open Roger8 opened 3 months ago

Roger8 commented 3 months ago

detail | 详细描述

windows10 引用 shared lib 出现下面警告, 请问各位是动态库的编译问题吗?

include\ncnn\blob.h(32,17): warning C4251: “ncnn::Blob::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“ncnn::Blob”的客户端使用 \Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明 include\ncnn\gpu.h(319,60): warning C4273: “ncnn::create_gpu_instance”: dll 链接不一致 include\ncnn\gpu.h(32,17): message : 参见“create_gpu_instance”的前一个定义 include\ncnn\layer.h(148,17): warning C4251: “ncnn::Layer::type”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“ncnn::Layer”的客户端使用 2\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明 include\ncnn\layer.h(150,17): warning C4251: “ncnn::Layer::name”: class“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”需要有 dll 接口由 class“ncnn::Layer”的客户端使用 2\Community\VC\Tools\MSVC\14.29.30133\include\xstring(4871): message : 参见“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”的声明 include\ncnn\layer.h(153,22): warning C4251: “ncnn::Layer::bottoms”: class“std::vector<int,std::allocator<int>>”需要有 dll 接口由 class“ncnn::Layer”的客户端使用 v2\core\types.hpp(782): message : 参见“std::vector<int,std::allocator<int>>”的声明 include\ncnn\layer.h(155,22): warning C4251: “ncnn::Layer::tops”: class“std::vector<int,std::allocator<int>>”需要有 dll 接口由 class“ncnn::Layer”的客户端使用 v2\core\types.hpp(782): message : 参见“std::vector<int,std::allocator<int>>”的声明 include\ncnn\layer.h(157,22): warning C4251: “ncnn::Layer::bottom_shapes”: class“std::vector<ncnn::Mat,std::allocator<ncnn::Mat>>”需要有 dll 接口由 class“ncnn::Layer”的客户端使用 include\ncnn\layer.h(102): message : 参见“std::vector<ncnn::Mat,std::allocator<ncnn::Mat>>”的声明 include\ncnn\layer.h(158,22): warning C4251: “ncnn::Layer::top_shapes”: class“std::vector<ncnn::Mat,std::allocator<ncnn::Mat>>”需要有 dll 接口由 class“ncnn::Layer”的客户端使用 include\ncnn\layer.h(102): message : 参见“std::vector<ncnn::Mat,std::allocator<ncnn::Mat>>”的声明

wzyforgit commented 3 months ago

https://learn.microsoft.com/zh-cn/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4251?view=msvc-170 看看这个?