Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Simon Slavin

On 15 Oct 2012, at 10:41pm, "Caleb A. Austin"  wrote:

> There is one odd part to all this
> 
> FILE *fp;
>  fp = fopen("/release/sql/MYFILE.txt", "a");
>  fprintf(fp, "%s\n ", "Hello World, Where there is will, there is a
> way.");
>  fclose(fp) ;
> 
> This works... but SQLite does not running the program multiple
> times, adds lines to the txt file. So the full path in SQLite does not
> work as I would expect

My guess is that you have amend privileges over the existing database file, but 
not enough privileges to create the journal file.  I'm glad to see that you 
have solved the problem.

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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Caleb A. Austin
Got IT!  The release directory is not a valid location to place the
file... this works:

/Storage_Card/sql/count.db works as I would expect.

Thanks guys!

Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
Sent: Monday, October 15, 2012 2:33 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


On 15 Oct 2012, at 9:50pm, "Caleb A. Austin" <caus...@climet.com> wrote:

> Hmm, I will try  a few other locations.  It seems that CE does not 
> have a local directory that windows does. So the 
> sqlite3_open(("count.db"), ); even when run from /release/sql/ it 
> thinks the root is the local directory.

Okay, I thought you knew this.  Sorry for not posting earlier.  Windows
CE does not have anything like a local directory, a current directory or
a default directory.  Every create and open command must specify a full
path.  If you do not specify a full path random things may happen,
including different things on different platforms and in different
versions.  You must learn how your device organises data files for each
application, and specify a path that your application is allowed to keep
its files in.

This is described in detail in several programming sources for WinCE,
but you can find confirmation here:

<http://msdn.microsoft.com/en-us/library/ms900336.aspx>

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Caleb A. Austin
Simon, 

There is one odd part to all this

FILE *fp;
  fp = fopen("/release/sql/MYFILE.txt", "a");
  fprintf(fp, "%s\n ", "Hello World, Where there is will, there is a
way.");
  fclose(fp) ;

This works... but SQLite does not running the program multiple
times, adds lines to the txt file. So the full path in SQLite does not
work as I would expect

Caleb Austin

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
Sent: Monday, October 15, 2012 2:33 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


On 15 Oct 2012, at 9:50pm, "Caleb A. Austin" <caus...@climet.com> wrote:

> Hmm, I will try  a few other locations.  It seems that CE does not 
> have a local directory that windows does. So the 
> sqlite3_open(("count.db"), ); even when run from /release/sql/ it 
> thinks the root is the local directory.

Okay, I thought you knew this.  Sorry for not posting earlier.  Windows
CE does not have anything like a local directory, a current directory or
a default directory.  Every create and open command must specify a full
path.  If you do not specify a full path random things may happen,
including different things on different platforms and in different
versions.  You must learn how your device organises data files for each
application, and specify a path that your application is allowed to keep
its files in.

This is described in detail in several programming sources for WinCE,
but you can find confirmation here:

<http://msdn.microsoft.com/en-us/library/ms900336.aspx>

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Caleb A. Austin
Simon, 

Thanks, no, I have not learned much about CE... it's a starting from the
ground up:(  I have been moving into a project that was going to be
handled by another engineer... So I am digging pretty deep to learn a
lot of stuff quickly.

Thanks for you link... that will likely answer the problem...

Caleb Austin

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
Sent: Monday, October 15, 2012 2:33 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


On 15 Oct 2012, at 9:50pm, "Caleb A. Austin" <caus...@climet.com> wrote:

> Hmm, I will try  a few other locations.  It seems that CE does not 
> have a local directory that windows does. So the 
> sqlite3_open(("count.db"), ); even when run from /release/sql/ it 
> thinks the root is the local directory.

Okay, I thought you knew this.  Sorry for not posting earlier.  Windows
CE does not have anything like a local directory, a current directory or
a default directory.  Every create and open command must specify a full
path.  If you do not specify a full path random things may happen,
including different things on different platforms and in different
versions.  You must learn how your device organises data files for each
application, and specify a path that your application is allowed to keep
its files in.

This is described in detail in several programming sources for WinCE,
but you can find confirmation here:

<http://msdn.microsoft.com/en-us/library/ms900336.aspx>

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Simon Slavin

On 15 Oct 2012, at 9:50pm, "Caleb A. Austin"  wrote:

> Hmm, I will try  a few other locations.  It seems that CE does not have
> a local directory that windows does. So the sqlite3_open(("count.db"),
> ); even when run from /release/sql/ it thinks the root is the local
> directory.

Okay, I thought you knew this.  Sorry for not posting earlier.  Windows CE does 
not have anything like a local directory, a current directory or a default 
directory.  Every create and open command must specify a full path.  If you do 
not specify a full path random things may happen, including different things on 
different platforms and in different versions.  You must learn how your device 
organises data files for each application, and specify a path that your 
application is allowed to keep its files in.

This is described in detail in several programming sources for WinCE, but you 
can find confirmation here:



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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Caleb A. Austin
Hmm, I will try  a few other locations.  It seems that CE does not have
a local directory that windows does. So the sqlite3_open(("count.db"),
); even when run from /release/sql/ it thinks the root is the local
directory.

Thanks for you help... it has helped me to see what to do at times.
SQLite is a fairly complex set of code to learn about and build into a
working database, yet it has been possible to get it functional(still
have to work on the CE file path) database project in a fairly short
time. 

Thanks!

Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin
Sent: Monday, October 15, 2012 10:55 AM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


Caleb A. Austin wrote:
> 
> What is odd, is that if I use the root folder then I don't get any 
> errors. Meaning if I use sqlite3_open(("count.db"), ); I get a 
> created db file with content.
> 

Perhaps the other directory is actually a mount point to another file
system with different capabilities (e.g. a storage card)?

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Joe Mistachkin

Caleb A. Austin wrote:
> 
> What is odd, is that if I use the root folder then I don't get any
> errors. Meaning if I use sqlite3_open(("count.db"), ); I get a
> created db file with content. 
> 

Perhaps the other directory is actually a mount point to another file
system with different capabilities (e.g. a storage card)?

--
Joe Mistachkin

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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Caleb A. Austin
We are using a Windows CE based on TI's AM3517 SDK. 

What is odd, is that if I use the root folder then I don't get any
errors. Meaning if I use sqlite3_open(("count.db"), ); I get a
created db file with content. 

I will  ask the people who are working on the SDK about the
FlushFileBuffers() and Win32 API details.

Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin
Sent: Monday, October 15, 2012 10:08 AM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


Caleb A. Austin wrote:
>
> sqlite3_open(("/release/sql/count.db"), );
> 
> 1034: os_win.c: 32125: (50) winSync(/release/sql/count.db-journal)
> -osError 0x32
> (50)  ...
>
> ... create table fails... disk IO error

That error code is ERROR_NOT_SUPPORTED, coming from winSync(), which
probably means that the FlushFileBuffers() Win32 API is not implemented
for the operating system version you are using.

Is this a custom version of Windows CE?  If so, do you have any control
over the customizations?
 
--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Joe Mistachkin

Caleb A. Austin wrote:
>
> sqlite3_open(("/release/sql/count.db"), );
> 
> 1034: os_win.c: 32125: (50) winSync(/release/sql/count.db-journal)
> -osError 0x32
> (50)  ...
>
> ... create table fails... disk IO error

That error code is ERROR_NOT_SUPPORTED, coming from winSync(), which
probably means that the FlushFileBuffers() Win32 API is not implemented
for the operating system version you are using.

Is this a custom version of Windows CE?  If so, do you have any control
over the customizations?
 
--
Joe Mistachkin

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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-15 Thread Caleb A. Austin

sqlite3_open(("/release/sql/count.db"), );

1034: os_win.c: 32125: (50) winSync(/release/sql/count.db-journal)
-osError 0x32
(50)  ...

 ... create table fails... disk IO error




Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin
Sent: Friday, October 12, 2012 9:41 PM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


Caleb A. Austin wrote:
> 
> The top file operation works, but the sqlite3_open does not... 
> 
> Wondering if I need to compile an option for SQLite to be using the 
> correct file io for WEC7
> 

What return code is coming back from sqlite3_open()?  Can you enable
logging via the SQLITE_CONFIG_LOG configuration option before calling
any other SQLite APIs?

http://www.sqlite.org/c3ref/c_config_getmalloc.html#sqliteconfiglog

Example:

void logging_callback(void *notUsed, int iCode, const char *zErrmsg){
  /* handle output here... */
  fprintf(stdout, "%d: %s\n", iCode, zErrmsg); }

sqlite3_config(SQLITE_CONFIG_LOG, logging_callback, 0);

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-12 Thread Joe Mistachkin

Caleb A. Austin wrote:
> 
> The top file operation works, but the sqlite3_open does not... 
> 
> Wondering if I need to compile an option for SQLite to be using the
> correct file io for WEC7
> 

What return code is coming back from sqlite3_open()?  Can you enable
logging via the SQLITE_CONFIG_LOG configuration option before calling
any other SQLite APIs?

http://www.sqlite.org/c3ref/c_config_getmalloc.html#sqliteconfiglog

Example:

void logging_callback(void *notUsed, int iCode, const char *zErrmsg){
  /* handle output here... */
  fprintf(stdout, "%d: %s\n", iCode, zErrmsg);
}

sqlite3_config(SQLITE_CONFIG_LOG, logging_callback, 0);

--
Joe Mistachkin

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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-12 Thread Caleb A. Austin
Here is what I  have come up with:

  FILE *fp;
  fp = fopen("\\release\\sql\\MYFILE.txt", "a");
  fprintf(fp, "%s\n ", "Hello World, Where there is will, there is a
way.");
  fclose(fp) ;

  sqlite3_open(("\\release\\sql\\count.db"), );

The top file operation works, but the sqlite3_open does not... 

Wondering if I need to compile an option for SQLite to be using the
correct file io for WEC7


Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin
Sent: Friday, October 12, 2012 10:39 AM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


Caleb A. Austin wrote:
>
> Any ideas on why the database is being placed in root and  not in
local?
>

My understanding is that Windows CE does not support the concept of a
current directory.  Therefore, in order for a file to be created in a
particular directory, the full path to the file must be specified (i.e.
in the call to sqlite3_open()).

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-12 Thread Joe Mistachkin

Caleb A. Austin wrote:
> 
> I have tried:
> 
> sqlite3_open("/release/sql/countries.db", );
> 

I'm not sure if it will make a difference; however, I think Windows CE
may need backslashes, not forward slashes.

--
Joe Mistachkin

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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-12 Thread Caleb A. Austin
Thanks Joe, 

I have tried:

sqlite3_open("/release/sql/countries.db", );

but I get a 0 bytes countries.db in the "/release/sql/" folder  and then
a long list of SQL errors about no access to the database.  I think this
is a Windows CE issue... but asking here if someone has used SQLite on
Windows CE to help fix the problem.

Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin
Sent: Friday, October 12, 2012 10:39 AM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


Caleb A. Austin wrote:
>
> Any ideas on why the database is being placed in root and  not in
local?
>

My understanding is that Windows CE does not support the concept of a
current directory.  Therefore, in order for a file to be created in a
particular directory, the full path to the file must be specified (i.e.
in the call to sqlite3_open()).

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-12 Thread Joe Mistachkin

Caleb A. Austin wrote:
>
> Any ideas on why the database is being placed in root and  not in local?
>

My understanding is that Windows CE does not support the concept of a
current directory.  Therefore, in order for a file to be created in a
particular directory, the full path to the file must be specified (i.e.
in the call to sqlite3_open()).

--
Joe Mistachkin

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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-12 Thread Caleb A. Austin
Thanks Joe,

Yes, I will look at keeping the source code clean of any edits. This was
just a way to prove that it worked.

I have been able to run SQLite on the WEC7 board and  create tables/
inserts/ etc. So it looks like things are working correctly. I do have a
few questions though.

In short: The database is created in the root directory, not in the
local directory. And as such it does not find the database after being
closed.

I have the following setup:

My working directory:
/release/sql/
I run the following code in a program running from my working directory:
Sqlite_test.exe

..
  sqlite3_open("main.db", );
..

but the data base shows up in the root directory.

Root:
/main.db

Any ideas on why the database is being placed in root and  not in local?

Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin
Sent: Thursday, October 11, 2012 12:35 AM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


Caleb A. Austin wrote:
> 
> Added near line 14092:
> #define HAVE_LOCALTIME_S 0 
> 

Since the SDK you are using does not appear to provide the localtime_s
function, even though it uses MSVC and its associated CRT, this makes
sense.  This could be defined in the Makefile and/or project properties
to avoid having to modify the source code.

> 
> Added near 14109:
> struct tm *__cdecl localtime(const time_t *t);
> 

Since  is included, this should not be required.  I'm not sure
exactly which SDK you are using; however, it appears that it may not be
fully ANSI compliant?

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-11 Thread Joe Mistachkin

Caleb A. Austin wrote:
> 
> Added near line 14092:
> #define HAVE_LOCALTIME_S 0 
> 

Since the SDK you are using does not appear to provide the localtime_s
function, even though it uses MSVC and its associated CRT, this makes
sense.  This could be defined in the Makefile and/or project properties
to avoid having to modify the source code.

> 
> Added near 14109:
> struct tm *__cdecl localtime(const time_t *t);
> 

Since  is included, this should not be required.  I'm not sure
exactly which SDK you are using; however, it appears that it may not be
fully ANSI compliant?

--
Joe Mistachkin

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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-10 Thread Caleb A. Austin
I may have found the fix to my first issue with compiling SQLite for
Windows CE. The following items are what I changed:

In the SQLite3.c file

Added near line 14092:
#define HAVE_LOCALTIME_S 0

Just above:

#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE_LOCALTIME_S) && \
 defined(_MSC_VER) && defined(_CRT_INSECURE_DEPRECATE)
#define HAVE_LOCALTIME_S 1
#endif

#ifndef SQLITE_OMIT_LOCALTIME
/*
** The following routine implements the rough equivalent of
localtime_r()
** using whatever operating-system specific localtime facility that
** is available.  This routine returns 0 on success and
** non-zero on any kind of error.
**
** If the sqlite3GlobalConfig.bLocaltimeFault variable is true then this
** routine will always fail.
*/



Added near 14109:
struct tm *__cdecl localtime(const time_t *t);

just above:

static int osLocaltime(time_t *t, struct tm *pTm){


The project now compiles... but I have not tested on a Window CE device
yet.

Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
Sent: Wednesday, October 10, 2012 8:52 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


On 10 Oct 2012, at 4:44pm, Caleb A. Austin <caus...@climet.com> wrote:

> Then I add the SQLite3.c and SQLite3.h to the project and include 
> SQLite3.h into the Hello World project. This is where I get the 
> errors.

Please make sure your compiler is set to compile '.c' files as C code,
and not anything else like C++.  This is a common source of compilation
problems.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-10 Thread Caleb A. Austin
To confirm if I have a good set of source code, I did a WIN32 build with
the shell.c. This works, I can build and run SQLite.

Is there a known Windows CE build that could be used as a reference to
set my project settings up with?

Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
Sent: Wednesday, October 10, 2012 8:52 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


On 10 Oct 2012, at 4:44pm, Caleb A. Austin <caus...@climet.com> wrote:

> Then I add the SQLite3.c and SQLite3.h to the project and include 
> SQLite3.h into the Hello World project. This is where I get the 
> errors.

Please make sure your compiler is set to compile '.c' files as C code,
and not anything else like C++.  This is a common source of compilation
problems.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-10 Thread Caleb A. Austin
It looks to be building it as a C file, this is from the build log:

BUILD: [00:000111:PROGC ] C++0 0
0
BUILD: [00:000112:PROGC ] C1 5
0


Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
Sent: Wednesday, October 10, 2012 8:52 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


On 10 Oct 2012, at 4:44pm, Caleb A. Austin <caus...@climet.com> wrote:

> Then I add the SQLite3.c and SQLite3.h to the project and include 
> SQLite3.h into the Hello World project. This is where I get the 
> errors.

Please make sure your compiler is set to compile '.c' files as C code,
and not anything else like C++.  This is a common source of compilation
problems.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-10 Thread Simon Slavin

On 10 Oct 2012, at 4:44pm, Caleb A. Austin  wrote:

> Then I add the SQLite3.c and SQLite3.h to the project and
> include SQLite3.h into the Hello World project. This is where I get the
> errors.

Please make sure your compiler is set to compile '.c' files as C code, and not 
anything else like C++.  This is a common source of compilation problems.

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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-10 Thread Caleb A. Austin
I have a VS2008 WEC7 project, that I then add a sub project to that is a
basic Hello World type program. Put another way, I have the WEC7 OS with
a WEC7 program that put's hello world on the WEC7 console. This works
correctly. Then I add the SQLite3.c and SQLite3.h to the project and
include SQLite3.h into the Hello World project. This is where I get the
errors.

I am using the "sqlite-amalgamation-3071400" and working with the files
directly. I have not modified the contents of the .c file other than the
"#define SQLITE_OS_WINCE 1" to force WINCE as the OS.

I have also unseccefully added a few other lines of code that I have
found on the web, but these are from a number of years ago, and the
following link 
http://www.sqlite.org/cvstrac/tktview?tn=2945

I don't see a make file in the zip file with the amalgamation. 

The SDK that is being used with WEC7 is the TI SDK for our processor,
AM3517.

Thanks!

Caleb Austin


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin
Sent: Tuesday, October 09, 2012 10:53 PM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] Building SQLite on Windows Embedded Compact
7(WEC7)


Caleb A. Austin wrote:
> 
> I am using SQLITE_OS_WINCE as defined:
> 
> #if defined(_WIN32_WCE)
> # define SQLITE_OS_WINCE 1
> #else
> # define SQLITE_OS_WINCE 0
> #endif
> 

Is a special SDK being used for Windows Embedded Compact 7?

What other defines are you using?  Are you using the Makefile.msc in the
source tree to build or some other mechanism?

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-09 Thread Joe Mistachkin

Caleb A. Austin wrote:
> 
> I am using SQLITE_OS_WINCE as defined:
> 
> #if defined(_WIN32_WCE)
> # define SQLITE_OS_WINCE 1
> #else
> # define SQLITE_OS_WINCE 0
> #endif
> 

Is a special SDK being used for Windows Embedded Compact 7?

What other defines are you using?  Are you using the Makefile.msc in the
source
tree to build or some other mechanism?

--
Joe Mistachkin

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


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-09 Thread Caleb A. Austin
I am using SQLITE_OS_WINCE as defined:

 #if defined(_WIN32_WCE)
# define SQLITE_OS_WINCE 1
#else
# define SQLITE_OS_WINCE 0
#endif

I have also forced #define SQLITE_OS_WINCE 1 at the top of the .c file. 

Would there be a basic set of define's that would build a Windows CE
SQLite?

I hope this is going back to the right place... As I have not replied to
a list like this before.

Caleb Austin
##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-09 Thread Joe Mistachkin

Caleb A. Austin wrote:
> 
> Warning   2  warning C4013: 'localtime_s'
> undefined; assuming extern returning int
> 

What defines are you using to compile the sqlite3.c file?

Are you using the defines SQLITE_OS_WIN and SQLITE_OS_WINCE?

--
Joe Mistachkin

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


[sqlite] Building SQLite on Windows Embedded Compact 7(WEC7)

2012-10-09 Thread Caleb A. Austin
Hi All,

 

I am working on  building SQLite and I am using(from header file): 

 

#define SQLITE_VERSION"3.7.14"

#define SQLITE_VERSION_NUMBER 3007014

#define SQLITE_SOURCE_ID  "2012-09-03 15:42:36
c0d89d4a9752922f9e367362366efde4f1b06f2a"

I am getting the following warning and then link error:

 

Warning   2  warning C4013: 'localtime_s'
undefined; assuming extern returning int
{log="C:\WINCE700\OSDesigns\Climet_test1\Climet_test1\sqlite_test\bldsys
log(32)"}
c:\wince700\osdesigns\climet_test1\climet_test1\sqlite_test\sqlite3.c
14129

 

Error  4  sqlite3.obj : error LNK2019: unresolved
external symbol localtime_s referenced in function osLocaltime
C:\WINCE700\OSDesigns\Climet_test1\Climet_test1\sqlite_test\bldsys.log
48

 

I have looked over Google and found a few examples of how this was
handled by others, but found this:

 

http://www.sqlite.org/cvstrac/tktview?tn=2945

 

This implies that the error regarding "localtime_s" is fixed in the main
trunk of SQLite and should compile... but I don't have something right. 

 

I am using  VS2008 and have a working CE build and hello world program
working.  When I add SQLite into the project I get the above
error/warning.

 

I would like some advice on how to build SQLite for WEC7. 

 

 

Caleb Austin

 


##
CONFIDENTIALITY NOTICE: This email and any files transmitted with it are 
confidential and intended
solely for the use of the individual or entity to whom they are addressed. It 
may contain confidential,
privileged, and/or proprietary information. Any review, dissemination, 
distribution, copying, printing,
or other use of this email by persons or entities other than the addressee and 
his/her authorized agent
is prohibited. 

If you have received this email in error please notify the originator of the 
message and delete the
material from your computer.
##
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users