为 Windows Mobile 设备编译 SQLite 合并

发布于 2024-08-20 06:22:40 字数 229 浏览 2 评论 0原文

如何为 Windows Mobile 设备编译 SQLite 合并?

然后我想在控制台中使用来运行一些命令。

我已经在 C/C++ 中为智能设备创建了一个空的 VS 项目,然后将现有文件包含到源和标头中。

当我尝试编译时,我得到: 错误1错误LNK2019:函数mainWCRTStartup corelibc.lib sqlite3中引用了无法解析的外部符号wmain

How can I compile the SQLite amalgamation for Windows Mobile device?

Then I want to use in a console to run some commands.

I've created an empty VS project in C/C++ for Smart Device, then included the existing files into Sources and Headers.

When I try to compile I get:
Error 1 error LNK2019: unresolved external symbol wmain referenced in function mainWCRTStartup corelibc.lib sqlite3

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

尤怨 2024-08-27 06:22:40

合并文件包含main函数,因为它实际上只是sqlite库,而不是命令行界面程序。

您必须自己实现这些命令并链接到 sqlite 库。

The amalgamation file does not contain a main function because it's really just the sqlite library, and not a command-line interface program.

You will have to implement the commands yourself and link against the sqlite library.

云淡月浅 2024-08-27 06:22:40

wmain函数是程序执行入口函数,意味着由应用程序定义,而不是由库定义。

您很可能已经为应用程序创建了一个项目,但 SQLite 是一个库,因此它没有定义(w)main 函数。因此,您应该选择静态库动态链接库项目类型。

您最好参考有关为 Windows Mobile 应用程序创建和设置项目的 MSDN 文档,并决定 选择哪种项目类型

智能设备开发

The wmain function is a program execution entry function, means is defined by an application, but not a library.

You most likely have crated a project for Application but SQLite is a library, so it does not define (w)main function. So, you should select project type of Static Library or Dynamic-Linked Library.

You'd be better to refer to the MSDN documentation about creating and setting projects for Windows Mobile applications and decide which project type to choose

Smart Device Development

用心笑 2024-08-27 06:22:40

您可以将 SQLite Amalgamation 构建为库并链接到它...但是,如果您正在编写本机 C++ 应用程序,那么将 SQLite 直接编译到您的项目中会容易容易得多。

首先,按照项目向导设置并创建一个“Windows应用程序”并选择“Emply Project”。选择“无 ATL”、“无 MFC”和“无预编译头”。

成功构建空/骨架项目后,将 SQLite Amalagamation 中的 sqlite3.csqlite3.h 添加到项目中。

在包含 wmain() 的 .CPP 文件中添加 #include "sqlite3.h"

最后,在您的 wmain() 函数中的某处 <在初始化代码之后但在主消息循环之前添加以下内容:

sqlite3 *db;
sqlite3_open(":memory:", &db);

这是创建空内存 SQLite 数据库的最低限度必要代码。

如果上面的项目编译并链接 - 你应该可以开始了!

You could build the SQLite Amalgamation as a library and link against it... But if you're writing a native C++ application it's much easier to just compile SQLite directly into your project.

First, follow the project wizard settings and create a "Windows Application" and choose "Emply Project". Choose No ATL, no MFC and no Precompiled-Headers.

Once you have the empty/skeleton project building successfully, add sqlite3.c and sqlite3.h from the SQLite Amalagamation to the project.

In the .CPP file that contains wmain() add #include "sqlite3.h"

Finally, in your wmain() function, somewhere after the initialization code but before the main message loop add the following:

sqlite3 *db;
sqlite3_open(":memory:", &db);

This is the bare-minimum necessary code to create an empty in-memory SQLite database.

If the above project compiles and links - you should be good to go!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文