Re: [sqlite] Compiling libtclsqlite3.so on Cygwin

2013-05-14 Thread Keith Christian
OK Warren, you've helped greatly, thanks again for the assistance, will
check other forums if the shared object / dll problems continue.

Keith


On Tue, May 14, 2013 at 10:53 AM, Warren Young  wrote:

> On 5/14/2013 09:14, Keith Christian wrote:
>
>>
>> couldn't load file "./tclsqlite3.o": Exec format error
>>
>
> From the Tcl manual: 
> http://tmml.sourceforge.net/**doc/tcl/load.html
>
> "...such as a .so file under Solaris or a DLL under Windows."
>
> Not *.o!
>
> My Tcl is awfully rusty, but I managed to get it to load with:
>
> load libsqlite3.7.16.2.dll "SQLite3"
>
> I have no idea what to do with it having loaded it.  (Again, the rust.)
>
> You're rapidly getting off-topic here, though.  There's a good chance that
> if you have further questions that they belong on a Cygwin or Tcl forum.
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Compiling libtclsqlite3.so on Cygwin

2013-05-14 Thread Warren Young

On 5/14/2013 09:14, Keith Christian wrote:


couldn't load file "./tclsqlite3.o": Exec format error


From the Tcl manual: http://tmml.sourceforge.net/doc/tcl/load.html

"...such as a .so file under Solaris or a DLL under Windows."

Not *.o!

My Tcl is awfully rusty, but I managed to get it to load with:

load libsqlite3.7.16.2.dll "SQLite3"

I have no idea what to do with it having loaded it.  (Again, the rust.)

You're rapidly getting off-topic here, though.  There's a good chance 
that if you have further questions that they belong on a Cygwin or Tcl 
forum.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Compiling libtclsqlite3.so on Cygwin

2013-05-14 Thread Keith Christian
Warren, thanks, that built the tclsqlite3.o correctly, and a libsqlite3
file also:

-rw-r--r--  1 kchristian Domain Users  39279 May 14 08:47 tclsqlite3.o
-rwxr-xr-x  1 kchristian Domain Users 173214 May 14 08:47
libsqlite3.7.16.2.dll



Another question, with a small test script, this error is output script:

couldn't load file "./tclsqlite3.o": Exec format error
while executing
"load ./tclsqlite3.o"
(file "./test_tclsqlite3.tcl" line 2)


=TEST SCRIPT START==
#!/usr/bin/tclsh
load ./tclsqlite3.o

sqlite3 db1 ./tcl_interface.db

db1 eval {CREATE TABLE IF NOT EXISTS t1(a int, b text)}
db1 eval {INSERT INTO t1 VALUES('1','hello')}
db1 eval {INSERT INTO t1 VALUES('2','goodbye')}
db1 eval {INSERT INTO t1 VALUES('3','howdy!')}

set x [db1 eval {SELECT * FROM t1 ORDER BY a}]

db1 eval {SELECT * FROM t1 ORDER BY a} values {
parray values
puts ""
}
=TEST SCRIPT END


Any suggestions for this one?  (Had to chmod u+x tclsqlite3.o, otherwise
got: 'couldn't load file "./tclsqlite3.o": Permission denied' error.)

Thanks again.





On Mon, May 13, 2013 at 8:10 PM, Warren Young  wrote:

> On 5/13/2013 16:36, Keith Christian wrote:
>
>> gcc -o libtclsqlite3.so -shared tea/generic/tclsqlite3.c -lpthread -ldl
>> -ltcl
>>
>
> Don't build it that way.  It appears that the TEA build system sees Cygwin
> and thinks "oh, this is Windows, so it must be VC++ or MinGW". That
> prevents it from linking to the Cygwin SQLite library.
>
> This seems to do the right thing:
>
> ... at the top-level of the source tree:
> $ cd tea
> $ ./configure --with-system-sqlite
> $ make
>
> Do a "make clean" before the last step if you have any *.o files laying
> around.  The shipped build system isn't smart enough to rebuild everything
> when you reconfigure with a very different set of compile and link options.
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Compiling libtclsqlite3.so on Cygwin

2013-05-13 Thread Warren Young

On 5/13/2013 16:36, Keith Christian wrote:

gcc -o libtclsqlite3.so -shared tea/generic/tclsqlite3.c -lpthread -ldl
-ltcl


Don't build it that way.  It appears that the TEA build system sees 
Cygwin and thinks "oh, this is Windows, so it must be VC++ or MinGW". 
That prevents it from linking to the Cygwin SQLite library.


This seems to do the right thing:

... at the top-level of the source tree:
$ cd tea
$ ./configure --with-system-sqlite
$ make

Do a "make clean" before the last step if you have any *.o files laying 
around.  The shipped build system isn't smart enough to rebuild 
everything when you reconfigure with a very different set of compile and 
link options.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Compiling libtclsqlite3.so on Cygwin

2013-05-13 Thread Keith Christian
I have the latest version of Cygwin installed (CYGWIN_NT-6.1-WOW64
1.7.18(0.263/5/3) 2013-04-19 10:39 i686 Cygwin) and the latest autoconf
archive (sqlite-autoconf-3071602.tar.gz) because it had the required
tclsqlite3.c file in order to build the libtclsqlite3.so shared object.

I ran the configure / make commands from the top level subdirectory
(sqlite-autoconf-3071602.)

Configure / make were successful.



Here is the command line attempted for compiling tclsqlite3.c, and the
results:

gcc -o libtclsqlite3.so -shared tea/generic/tclsqlite3.c -lpthread -ldl
-ltcl

/tmp/ccnyhcg8.o:tclsqlite3.c:(.text+0x7fc2b): undefined reference to
`__imp__Sqlite3_Init'
/tmp/ccnyhcg8.o:tclsqlite3.c:(.text+0x7fc54): undefined reference to
`__imp__Sqlite3_Init'
/tmp/ccnyhcg8.o:tclsqlite3.c:(.text+0x7fc69): undefined reference to
`__imp__Sqlite3_Init'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
/tmp/ccnyhcg8.o: bad reloc address 0x100 in section `.data'
collect2: ld returned 1 exit status



I plan to use the libtclsqlite3.so object with the 3.7.16.2 version of
Sqlite3 that ships with Cygwin (same version as here.)

Any ideas of how to get tclsqlite3.c to compile and produce
libtclsqlite3.so?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users