Cross compiling sqlite for windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Cross compiling sqlite for windows

Uwe Steinmann
Hi,

I'm trying to cross compile sqlite 2.8.4 for windows on linux ppc
system. Compiling the sources works but linking results in many
unresolved symbols errors.

/usr/libexec/gcc/i586-mingw32msvc/3.4.2/collect2 --dll -Bdynamic -e _DllMainCRTStartup@12 -o sqlite.dll /usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/lib/dllcrt2.o /usr/lib/gcc/i586-mingw32msvc/3.4.2/crtbegin.o -L/usr/lib/gcc/i586-mingw32msvc/3.4.2 -L/usr/lib/gcc/i586-mingw32msvc/3.4.2 -L/usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/lib --base-file /tmp/cc5dzKms.base -e _DllMainCRTStartup@12 --image-base 0x673C0000 -lmsvcrt attach.o auth.o btree.o btree_rb.o build.o copy.o date.o delete.o encode.o expr.o hash.o insert.o os.o pager.o parse.o pragma.o printf.o select.o table.o trigger.o update.o util.o where.o -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt /usr/lib/gcc/i586-mingw32msvc/3.4.2/crtend.o
attach.o:attach.c:(.text+0x1d): undefined reference to `_sqliteVdbeAddOp'
attach.o:attach.c:(.text+0x1f8): undefined reference to `_sqliteBtreeFactory'
attach.o:attach.c:(.text+0x2e6): undefined reference to `_sqliteInit'
attach.o:attach.c:(.text+0x343): undefined reference to `_sqliteVdbeAddOp'
build.o:build.c:(.text+0x77): undefined reference to `_sqliteInit'

The problem is in any case the leading underscore.
Has anybody an idea where that underscore comes from?

 Uwe

--
  MMK GmbH, Universitaetsstr. 11, 58097 Hagen
  [hidden email]
  Tel: +2331 840446    Fax: +2331 843920

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cross compiling sqlite for windows

Ulrik Sandborg-Petersen
Hi,

the _ is probably added as part of the compiler's name mangling (google
it if you wish), and is a quite standard way of dealing with object
names.  However, I note that you are not including vdbe.o in the link
stage, nor are you including main.o, which may be why it is
complaining.  I don't know if these existed in 2.8.4, so I may be wrong.

HTH

Ulrik Petersen


Uwe Steinmann wrote:

>Hi,
>
>I'm trying to cross compile sqlite 2.8.4 for windows on linux ppc
>system. Compiling the sources works but linking results in many
>unresolved symbols errors.
>
>/usr/libexec/gcc/i586-mingw32msvc/3.4.2/collect2 --dll -Bdynamic -e _DllMainCRTStartup@12 -o sqlite.dll /usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/lib/dllcrt2.o /usr/lib/gcc/i586-mingw32msvc/3.4.2/crtbegin.o -L/usr/lib/gcc/i586-mingw32msvc/3.4.2 -L/usr/lib/gcc/i586-mingw32msvc/3.4.2 -L/usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/lib --base-file /tmp/cc5dzKms.base -e _DllMainCRTStartup@12 --image-base 0x673C0000 -lmsvcrt attach.o auth.o btree.o btree_rb.o build.o copy.o date.o delete.o encode.o expr.o hash.o insert.o os.o pager.o parse.o pragma.o printf.o select.o table.o trigger.o update.o util.o where.o -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt /usr/lib/gcc/i586-mingw32msvc/3.4.2/crtend.o
>attach.o:attach.c:(.text+0x1d): undefined reference to `_sqliteVdbeAddOp'
>attach.o:attach.c:(.text+0x1f8): undefined reference to `_sqliteBtreeFactory'
>attach.o:attach.c:(.text+0x2e6): undefined reference to `_sqliteInit'
>attach.o:attach.c:(.text+0x343): undefined reference to `_sqliteVdbeAddOp'
>build.o:build.c:(.text+0x77): undefined reference to `_sqliteInit'
>
>The problem is in any case the leading underscore.
>Has anybody an idea where that underscore comes from?
>
> Uwe
>
>  
>

Reply | Threaded
Open this post in threaded view
|

Re: Cross compiling sqlite for windows

Christian Smith
On Tue, 24 May 2005, Ulrik Petersen wrote:

>Hi,
>
>the _ is probably added as part of the compiler's name mangling (google
>it if you wish), and is a quite standard way of dealing with object
>names.  However, I note that you are not including vdbe.o in the link
>stage, nor are you including main.o, which may be why it is
>complaining.  I don't know if these existed in 2.8.4, so I may be wrong.


The other issue is why use 2.8.4? 2.8.4 should be upward compatible with
later 2.8.x releases, so use the latest source as it probably has critical
fixes. In which case, why not just use the precompiled binary:
http://www.sqlite.org/sqlitedll-2_8_16.zip


>
>HTH
>
>Ulrik Petersen
>
>
>Uwe Steinmann wrote:
>
>>Hi,
>>
>>I'm trying to cross compile sqlite 2.8.4 for windows on linux ppc
>>system. Compiling the sources works but linking results in many
>>unresolved symbols errors.
>>
>>/usr/libexec/gcc/i586-mingw32msvc/3.4.2/collect2 --dll -Bdynamic -e _DllMainCRTStartup@12 -o sqlite.dll /usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/lib/dllcrt2.o /usr/lib/gcc/i586-mingw32msvc/3.4.2/crtbegin.o -L/usr/lib/gcc/i586-mingw32msvc/3.4.2 -L/usr/lib/gcc/i586-mingw32msvc/3.4.2 -L/usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/lib --base-file /tmp/cc5dzKms.base -e _DllMainCRTStartup@12 --image-base 0x673C0000 -lmsvcrt attach.o auth.o btree.o btree_rb.o build.o copy.o date.o delete.o encode.o expr.o hash.o insert.o os.o pager.o parse.o pragma.o printf.o select.o table.o trigger.o update.o util.o where.o -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt /usr/lib/gcc/i586-mingw32msvc/3.4.2/crtend.o
>>attach.o:attach.c:(.text+0x1d): undefined reference to `_sqliteVdbeAddOp'
>>attach.o:attach.c:(.text+0x1f8): undefined reference to `_sqliteBtreeFactory'
>>attach.o:attach.c:(.text+0x2e6): undefined reference to `_sqliteInit'
>>attach.o:attach.c:(.text+0x343): undefined reference to `_sqliteVdbeAddOp'
>>build.o:build.c:(.text+0x77): undefined reference to `_sqliteInit'
>>
>>The problem is in any case the leading underscore.
>>Has anybody an idea where that underscore comes from?
>>
>> Uwe
>>
>>
>>
>

--
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \
Reply | Threaded
Open this post in threaded view
|

Re: Cross compiling sqlite for windows

Uwe Steinmann
In reply to this post by Ulrik Sandborg-Petersen
On Tue, May 24, 2005 at 05:05:02PM +0200, Ulrik Petersen wrote:
> Hi,
>
> the _ is probably added as part of the compiler's name mangling (google
> it if you wish), and is a quite standard way of dealing with object
> names.  However, I note that you are not including vdbe.o in the link
> stage, nor are you including main.o, which may be why it is
> complaining.  I don't know if these existed in 2.8.4, so I may be wrong.
You are right. I overlooked an error while compiling. Consequently
both vdbe.o and main.o were missing, because my shell script didn't
stop despite of the error. Thanks for the hint.

  Uwe


--
  MMK GmbH, Universitaetsstr. 11, 58097 Hagen
  [hidden email]
  Tel: +2331 840446    Fax: +2331 843920

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cross compiling sqlite for windows

Uwe Steinmann
In reply to this post by Christian Smith
On Tue, May 24, 2005 at 04:38:31PM +0100, Christian Smith wrote:

> On Tue, 24 May 2005, Ulrik Petersen wrote:
>
> >Hi,
> >
> >the _ is probably added as part of the compiler's name mangling (google
> >it if you wish), and is a quite standard way of dealing with object
> >names.  However, I note that you are not including vdbe.o in the link
> >stage, nor are you including main.o, which may be why it is
> >complaining.  I don't know if these existed in 2.8.4, so I may be wrong.
>
>
> The other issue is why use 2.8.4? 2.8.4 should be upward compatible with
> later 2.8.x releases, so use the latest source as it probably has critical
> fixes. In which case, why not just use the precompiled binary:
> http://www.sqlite.org/sqlitedll-2_8_16.zip
I just happen to have 2.8.4 and for the beginning it was enough for
testing the cross compiler. I will take 2.8.16 the next time.
The reason I do not use the precompiled binary is the missing soundex
function, which doesn't seems to be included by default.

  Uwe
--
  MMK GmbH, Universitaetsstr. 11, 58097 Hagen
  [hidden email]
  Tel: +2331 840446    Fax: +2331 843920

signature.asc (196 bytes) Download Attachment