I'm writing a trivial windows console application that links to a bunch of static libraries via a

#pragma comment(lib, "SomeLibrary.lib");

(Amongst these libaries is SQLite3.lib)

When I start my program, the code in my main function doesn't seem to be executed, but instead the command line propt of the sqlite console application appears. Strange, isn't it? The only thing I can imagine causing this is that somehow another main function is defined somewhere else (supposedly in the static sqlite library) and that one is exectuted.

Is that possible? Is there some way to find out if there's a main function defined in a static library? And is there some way to give my main function precedence over the other one?

有帮助吗?

解决方案

The sqlite3.lib library has a main function because you compiled the source code of the SQLite command-line shell into it.

Compile that library without shell.c. It should contain nothing but sqlite3.c.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top