* Building SQLite3 CLI without
@ 2022-12-02 20:37 Jose Isaias Cabrera
2022-12-02 21:37 ` Oskar Skog
2022-12-03 16:23 ` Andrey Repin
0 siblings, 2 replies; 8+ messages in thread
From: Jose Isaias Cabrera @ 2022-12-02 20:37 UTC (permalink / raw)
To: cygwin List
Greetings and salutations!
I can build SQLite DLL and use it under Windows without any problem using this command:
i686-w64-mingw32-gcc -shared -static-libgcc sqlite3.c -o sqlite3.dll
And I can use that DLL outside cygwin without any problem. I can also build the SQLite3.exe tool using this command:
i686-w64-mingw32-gcc -shared -static-libgcc shell.c -o sqlite3.exe
The problem is that when I run this sqlite3.exe outside the cygwin environment, it gives me the error:
"The code execution cannot proceed because cygwin1.dll was
not found. Reinstalling the program may fix this problem."
Is there an option that I can do to build the tool without the need of the cygwin1.dll? I know that I can move the file in the same spot, but I want to create it without the need of it. Thanks for your support.
josé
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Building SQLite3 CLI without
2022-12-02 20:37 Building SQLite3 CLI without Jose Isaias Cabrera
@ 2022-12-02 21:37 ` Oskar Skog
2022-12-02 21:53 ` Jose Isaias Cabrera
2022-12-03 21:14 ` Jose Isaias Cabrera
2022-12-03 16:23 ` Andrey Repin
1 sibling, 2 replies; 8+ messages in thread
From: Oskar Skog @ 2022-12-02 21:37 UTC (permalink / raw)
To: cygwin
On 2022-12-02 22:37, Jose Isaias Cabrera via Cygwin wrote:
>
> Greetings and salutations!
>
> I can build SQLite DLL and use it under Windows without any problem using this command:
>
> i686-w64-mingw32-gcc -shared -static-libgcc sqlite3.c -o sqlite3.dll
>
> And I can use that DLL outside cygwin without any problem. I can also build the SQLite3.exe tool using this command:
>
> i686-w64-mingw32-gcc -shared -static-libgcc shell.c -o sqlite3.exe
>
> The problem is that when I run this sqlite3.exe outside the cygwin environment, it gives me the error:
>
> "The code execution cannot proceed because cygwin1.dll was
> not found. Reinstalling the program may fix this problem."
>
> Is there an option that I can do to build the tool without the need of the cygwin1.dll? I know that I can move the file in the same spot, but I want to create it without the need of it. Thanks for your support.
>
> josé
>
https://cygwin.com/faq/faq.html#faq.programming.static-linking
"No. If your program uses the Cygwin API, then your executable cannot
run without cygwin1.dll. In particular, it is not possible to statically
link with a Cygwin library to obtain an independent, self-contained
executable."
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Building SQLite3 CLI without
2022-12-02 21:37 ` Oskar Skog
@ 2022-12-02 21:53 ` Jose Isaias Cabrera
2022-12-03 21:14 ` Jose Isaias Cabrera
1 sibling, 0 replies; 8+ messages in thread
From: Jose Isaias Cabrera @ 2022-12-02 21:53 UTC (permalink / raw)
To: Oskar Skog, cygwin
Oskar Skog via Cygwin, on December 2, 2022 4:37 PM said,
>> On 2022-12-02 22:37, Jose Isaias Cabrera via Cygwin wrote:
> > Is there an option that I can do to build the tool without the need of
>> the cygwin1.dll? I know that I can move the file in the same spot, but I
>> want to create it without the need of it. Thanks for your support.
> "No. If your program uses the Cygwin API, then your executable cannot run
> without cygwin1.dll. In particular, it is not possible to statically link
> with a Cygwin library to obtain an independent, self-contained
> executable."
Ok, thanks. I guess I can copy the DLL on the executable directory. Thanks.
josé
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Building SQLite3 CLI without
2022-12-02 20:37 Building SQLite3 CLI without Jose Isaias Cabrera
2022-12-02 21:37 ` Oskar Skog
@ 2022-12-03 16:23 ` Andrey Repin
2022-12-03 18:34 ` Jose Isaias Cabrera
1 sibling, 1 reply; 8+ messages in thread
From: Andrey Repin @ 2022-12-03 16:23 UTC (permalink / raw)
To: Jose Isaias Cabrera, cygwin
Greetings, Jose Isaias Cabrera!
> I can build SQLite DLL and use it under Windows without any problem using
> this command:
> i686-w64-mingw32-gcc -shared -static-libgcc sqlite3.c -o sqlite3.dll
To the best of my knowledge, you should not use cross-compilers directly.
> And I can use that DLL outside cygwin without any problem.
> I can also build the SQLite3.exe tool using this command:
> i686-w64-mingw32-gcc -shared -static-libgcc shell.c -o sqlite3.exe
> The problem is that when I run this sqlite3.exe outside the cygwin environment, it gives me the error:
> "The code execution cannot proceed because cygwin1.dll was
> not found. Reinstalling the program may fix this problem."
> Is there an option that I can do to build the tool without the need of the
> cygwin1.dll? I know that I can move the file in the same spot, but I want to
> create it without the need of it. Thanks for your support.
Yes, you should use a cross-compiler and specifically set the target to be
windows native executable.
--
With best regards,
Andrey Repin
Saturday, December 3, 2022 19:21:13
Sorry for my terrible english...
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Building SQLite3 CLI without
2022-12-03 16:23 ` Andrey Repin
@ 2022-12-03 18:34 ` Jose Isaias Cabrera
0 siblings, 0 replies; 8+ messages in thread
From: Jose Isaias Cabrera @ 2022-12-03 18:34 UTC (permalink / raw)
To: cygwin
On December 3, 2022 11:23 AM, Andrey Repin expressed:
>
> Greetings, Jose Isaias Cabrera!
Salutations Andrey.
>
> > I can build SQLite DLL and use it under Windows without any problem
> > using this command:
>
> > i686-w64-mingw32-gcc -shared -static-libgcc sqlite3.c -o sqlite3.dll
>
> To the best of my knowledge, you should not use cross-compilers directly.
What do you mean?
> > Is there an option that I can do to build the tool without the need of
> > the cygwin1.dll? I know that I can move the file in the same spot, but
> > I want to create it without the need of it. Thanks for your support.
>
> Yes, you should use a cross-compiler and specifically set the target to be windows native executable.
How do I do that? Or, what option do I enter?
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Building SQLite3 CLI without
2022-12-02 21:37 ` Oskar Skog
2022-12-02 21:53 ` Jose Isaias Cabrera
@ 2022-12-03 21:14 ` Jose Isaias Cabrera
2022-12-03 22:20 ` Ken Brown
1 sibling, 1 reply; 8+ messages in thread
From: Jose Isaias Cabrera @ 2022-12-03 21:14 UTC (permalink / raw)
To: Oskar Skog, cygwin
On December 2, 2022 4:37 PM, Oskar Skog expressed:
>
> On 2022-12-02 22:37, Jose Isaias Cabrera via Cygwin wrote:
> >
> > Is there an option that I can do to build the tool without the need of
> > the cygwin1.dll? I know that I can move the file in the same spot, but I
> > want to create it without the need of it. Thanks for your support.
> "No. If your program uses the Cygwin API, then your executable cannot run
> without cygwin1.dll. In particular, it is not possible to statically link
> with a Cygwin library to obtain an independent, self-contained executable."
Not true. To do this, use the mingw32 or 64 compiler, as this,
CC=i686-w64-mingw32-gcc ./configure
and the SQLite3 tool will work without the cygwin1.dll. If you want to try it let me know and I will post the steps to follow.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Building SQLite3 CLI without
2022-12-03 21:14 ` Jose Isaias Cabrera
@ 2022-12-03 22:20 ` Ken Brown
2022-12-03 23:15 ` Jose Isaias Cabrera
0 siblings, 1 reply; 8+ messages in thread
From: Ken Brown @ 2022-12-03 22:20 UTC (permalink / raw)
To: Jose Isaias Cabrera, Oskar Skog, cygwin
On 12/3/2022 4:14 PM, Jose Isaias Cabrera via Cygwin wrote:
> To do this, use the mingw32 or 64 compiler, as this,
>
> CC=i686-w64-mingw32-gcc ./configure
>
> and the SQLite3 tool will work without the cygwin1.dll.
I think the preferred way to do this is
./configure --host=i686-w64-mingw32 ,
although it might not matter in this case. See
https://www.gnu.org/software/autoconf/manual/autoconf-2.70/html_node/Specifying-Target-Triplets.html
Ken
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Building SQLite3 CLI without
2022-12-03 22:20 ` Ken Brown
@ 2022-12-03 23:15 ` Jose Isaias Cabrera
0 siblings, 0 replies; 8+ messages in thread
From: Jose Isaias Cabrera @ 2022-12-03 23:15 UTC (permalink / raw)
To: Ken Brown, Oskar Skog, cygwin
On December 3, 2022 5:21 PM, Ken Brown expressed:
>
> On 12/3/2022 4:14 PM, Jose Isaias Cabrera via Cygwin wrote:
> > To do this, use the mingw32 or 64 compiler, as this,
> >
> > CC=i686-w64-mingw32-gcc ./configure
> >
> > and the SQLite3 tool will work without the cygwin1.dll.
>
> I think the preferred way to do this is
>
> ./configure --host=i686-w64-mingw32 ,
>
> although it might not matter in this case. See
>
Thanks, Ken. I will add this one to my cheat sheet also. However, they both work the same.
josé
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-12-03 23:15 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02 20:37 Building SQLite3 CLI without Jose Isaias Cabrera
2022-12-02 21:37 ` Oskar Skog
2022-12-02 21:53 ` Jose Isaias Cabrera
2022-12-03 21:14 ` Jose Isaias Cabrera
2022-12-03 22:20 ` Ken Brown
2022-12-03 23:15 ` Jose Isaias Cabrera
2022-12-03 16:23 ` Andrey Repin
2022-12-03 18:34 ` Jose Isaias Cabrera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).