C++;可执行文件继续查找顺序入口点 我有一个C++应用程序,下面的源代码是: #include <cstdint> #include <iostream> #include <vector> #include <bsoncxx/json.hpp> #include <mongocxx/client.hpp> #include <mongocxx/stdx.hpp> #include <mongocxx/uri.hpp> #include <mongocxx/client.hpp> #include <mongocxx/instance.hpp> using bsoncxx::builder::stream::close_array; using bsoncxx::builder::stream::close_document; using bsoncxx::builder::stream::document; using bsoncxx::builder::stream::finalize; using bsoncxx::builder::stream::open_array; using bsoncxx::builder::stream::open_document; int main(int argc, char** argv) { std::cout << "\nJust to be sure!" << std::endl; // Making a connection to Mongo mongocxx::instance instance{}; mongocxx::client client{mongocxx::uri{}}; // Access a database mongocxx::database db = client["results"]; std::cout << "\ndone." << std::endl; return 0; }

C++;可执行文件继续查找顺序入口点 我有一个C++应用程序,下面的源代码是: #include <cstdint> #include <iostream> #include <vector> #include <bsoncxx/json.hpp> #include <mongocxx/client.hpp> #include <mongocxx/stdx.hpp> #include <mongocxx/uri.hpp> #include <mongocxx/client.hpp> #include <mongocxx/instance.hpp> using bsoncxx::builder::stream::close_array; using bsoncxx::builder::stream::close_document; using bsoncxx::builder::stream::document; using bsoncxx::builder::stream::finalize; using bsoncxx::builder::stream::open_array; using bsoncxx::builder::stream::open_document; int main(int argc, char** argv) { std::cout << "\nJust to be sure!" << std::endl; // Making a connection to Mongo mongocxx::instance instance{}; mongocxx::client client{mongocxx::uri{}}; // Access a database mongocxx::database db = client["results"]; std::cout << "\ndone." << std::endl; return 0; },c++,mongodb,c++11,msbuild,mongo-cxx-driver,C++,Mongodb,C++11,Msbuild,Mongo Cxx Driver,我在Windows 10 64位上使用MSBuild编译程序,没有错误,运行时会出现此错误 The ordinal 4694 could not be located in the dynamic library libmongoc-1.0.dll 是否有错误的C++代码或CMAKLISTS.TXT可以解释错误? < P>这是不可能的。问题是您正在使用哪个.LIB文件链接DLL。构建DLL时,也会创建一个小的.LIB文件。这基本上只是一个目录。如果将一个版本中的.LIB文件与另一个版本中的.D

我在Windows 10 64位上使用MSBuild编译程序,没有错误,运行时会出现此错误

The ordinal 4694 could not be located in the dynamic library libmongoc-1.0.dll

是否有错误的C++代码或CMAKLISTS.TXT可以解释错误?

< P>这是不可能的。问题是您正在使用哪个.LIB文件链接DLL。构建DLL时,也会创建一个小的.LIB文件。这基本上只是一个目录。如果将一个版本中的.LIB文件与另一个版本中的.DLL混合使用,则可能会遇到不兼容


在这种情况下,.LIB文件将取自
。/../installed\u mongocxx/LIB
,但.DLL可能不是。根据Windows规则,DLL将在运行时找到。

这不太可能。问题是您正在使用哪个.LIB文件链接DLL。构建DLL时,也会创建一个小的.LIB文件。这基本上只是一个目录。如果将一个版本中的.LIB文件与另一个版本中的.DLL混合使用,则可能会遇到不兼容


在这种情况下,.LIB文件将取自
。/../installed\u mongocxx/LIB
,但.DLL可能不是。根据Windows规则,DLL将在运行时找到。

我注意到您最近提出了许多与使用mongocxx开发相关的问题,这些问题似乎都是相关的。我鼓励您就我们的或我们的问题提问,这将使我们更容易帮助您回答任何后续问题,而无需在多个地方进行对话


(很抱歉将此作为回答而不是评论发布;StackOverflow似乎对评论有长度限制,我无法将此纳入其中)

我注意到您最近提出了许多与mongocxx开发相关的问题,这些问题似乎都是相关的。我鼓励您就我们的或我们的问题提问,这将使我们更容易帮助您回答任何后续问题,而无需在多个地方进行对话



(道歉把这个作为答案而不是评论;StAdvOfflook似乎有一个长度限制的评论,我不能把它放在一个)< /p>是否有什么错误的C++代码或CMAKELISTSXT可以解释错误?我说不,这是dll确认。一个例子是使用与导入库不同的dll。@drescherjm,我也同时编译库,因此我不认为有这种可能性。您的系统上是否有可能安装另一个

libmongoc-1.0.dll
副本?@drescherjm,不,这是唯一的一个。完整的错误消息指向库正在尝试使用的对象<代码>在动态库E:\Projects\mongocxx\trust\u vs\installed\u app\bin\libmongoc-1.0.dll中找不到序号4694。所以我确信它是使用刚才编译的那个。我会尝试一个干净的构建,对于DLL。C++代码或CMAKELIST.TXT有什么不对的地方,可以解释错误吗?我说不,这是dll确认。一个例子是使用与导入库不同的dll。@drescherjm,我也同时编译库,因此我不认为有这种可能性。您的系统上是否有可能安装另一个
libmongoc-1.0.dll
副本?@drescherjm,不,这是唯一的一个。完整的错误消息指向库正在尝试使用的对象<代码>在动态库E:\Projects\mongocxx\trust\u vs\installed\u app\bin\libmongoc-1.0.dll中找不到序号4694。所以我确信它使用的是刚刚编译过的dll。我会尝试一个干净的dll构建。明白了!我现在正在清理一切,重新开始。我把一切都清理干净了。从cmd运行可执行文件时,不会发生任何事情。从WinDbg(64x)打开可执行文件时,收到相同的错误消息。@Amani:这表明您在第二种情况下找到了不同的DLL。我不这么认为,因为错误消息清楚地指向DLL的路径,这是我创建的新DLL,在我的系统中没有任何其他DLL。20年来,它一直是调试DLL加载问题的主要工具。明白了!我现在正在清理一切,重新开始。我把一切都清理干净了。从cmd运行可执行文件时,不会发生任何事情。从WinDbg(64x)打开可执行文件时,收到相同的错误消息。@Amani:这表明您在第二种情况下找到了不同的DLL。我不这么认为,因为错误消息清楚地指向DLL的路径,这是我创建的新DLL,在我的系统中没有任何其他DLL。它是调试DLL加载问题的主要工具,2年。我非常希望在我的项目中使用蒙哥C++。非常感谢我在项目中真正希望使用蒙哥C++。
The ordinal 4694 could not be located in the dynamic library libmongoc-1.0.dll