Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Talk:Compiling and using SQLite Encryption Extension (SEE) with Windows Phone 8

From Wiki
Jump to: navigation, search

Contents

Hamishwillee - Thanks Vinay!

Hi Vinay

Thank you for posting this excellent article. I have made minor adjustments for wiki style (please check). In essence adding a frame or thumb to images so that they can display a caption, and using indented bullets to make this render more attractively.

In terms of content I've added an explanation and links about what SEE offers in the introduction, and a note about the Licensing. This is important so that people know the cost of using the software up front. Please check you are still happy with it.

Great job!

Regards

Hamish

hamishwillee (talk) 05:20, 24 January 2014 (EET)

Vinayppatil - looks good

Hi Hamish,

Licensing info was important part, how did i miss that.! And your changes looks great. Thanks!

Regards,

Vinay

vinayppatil (talk) 08:49, 24 January 2014 (EET)

Raymondle - Have an error when build sqlite3.dll

When i come to final step "nmake -f Makefile.msc sqlite3.dll /I XCOMPILE=1 USE_NATIVE_LIBPATHS=1 FOR_WINRT=1 NO_TCL=1" , i had an error

sqlite3.lo : error LNK2019: unresolved external symbol sqlite3CodecGetKey referenced in function sqlite3RunVacuum sqlite3.lo : error LNK2019: unresolved external symbol sqlite3CodecAttach referenced in function attachFunc sqlite3.lo : error LNK2019: unresolved external symbol sqlite3_key_v2 referenced in function sqlite3Pragma sqlite3.lo : error LNK2019: unresolved external symbol sqlite3_rekey_v2 referenced in function sqlite3Pragma sqlite3.lo : error LNK2019: unresolved external symbol sqlite3_activate_see referenced in function sqlite3Pragma sqlite3.dll : fatal error LNK1120: 5 unresolved externals

So how can i fix that ? :(

raymondle (talk) 21:32, 23 February 2014 (EET)

Vinayppatil - Do you have SEE source code?

Hi Raymondle,

From the error log it seems like you are missing SEE source code. I have updated the article. Check step 5. Feel free to get back in case you get stuck.

Thanks and regards,

Vinay

vinayppatil (talk) 08:06, 25 February 2014 (EET)

Raymondle - Can we add more function and Compiling?

Hi Vinayppatil !

I was trying to add functions sin,cos,acos to sqlite3.dll but not success. So can you help me ?

Here my code of function. And i put it to sql_trig.c

[code] /* sql_trig.c */

  1. include "sqlite3ext.h"

SQLITE_EXTENSION_INIT1;

  1. include <stdlib.h>

/* this bit is required to get M_PI out of MS headers */

  1. if defined( _WIN32 )
  2. define _USE_MATH_DEFINES
  3. endif /* _WIN32 */
  1. include <math.h>
  1. define RADIANS(d) (( d / 180.0 ) * M_PI)

static void sql_trig_sin( sqlite3_context *ctx, int num_values, sqlite3_value **values ) {

   double a = RADIANS(sqlite3_value_double( values[0] ));
   sqlite3_result_double( ctx, sin( a ) );

}

static void sql_trig_cos( sqlite3_context *ctx, int num_values, sqlite3_value **values ) {

   double a = RADIANS(sqlite3_value_double( values[0] ));
   sqlite3_result_double( ctx, cos( a ) );

}

static void sql_trig_acos( sqlite3_context *ctx, int num_values, sqlite3_value **values ) {

   double a = sqlite3_value_double( values[0] );
   sqlite3_result_double( ctx, acos( a ) );

}

static void sql_trig_radians( sqlite3_context *ctx, int num_values, sqlite3_value **values ) {

   sqlite3_result_double( ctx, RADIANS(sqlite3_value_double( values[0] ) ));

}

int sqlite3_extension_init( sqlite3 *db, char **error, const sqlite3_api_routines *api ) {

   SQLITE_EXTENSION_INIT2(api);
   sqlite3_create_function( db, "sin",1,
       SQLITE_UTF8, NULL, &sql_trig_sin, NULL, NULL );
   sqlite3_create_function( db, "cos",1,
       SQLITE_UTF8, NULL, &sql_trig_cos, NULL, NULL );
   sqlite3_create_function( db, "acos",1,
       SQLITE_UTF8, NULL, &sql_trig_acos, NULL, NULL );
   return SQLITE_OK;

} [/code]

And at Step 6 i was edit below

[code] SET OPTS=-DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_WIN32_FILEMAPPING_API=1

nmake /F Makefile.msc sqlite3.c XCOMPILE=1 USE_NATIVE_LIBPATHS=1 FOR_WINRT=1 NO_TCL=1

COPY /B sqlite3.c + /B sql_trig.c sqlite3.c /B

ATTRIB +r sqlite3.c

ATTRIB +r sqlite3.h

nmake -f Makefile.msc sqlite3.dll /I XCOMPILE=1 USE_NATIVE_LIBPATHS=1 FOR_WINRT=1 NO_TCL=1 [/code]

It build success but when using this function in SQLite Query have error "No function".

raymondle (talk) 09:40, 2 March 2014 (EET)

 
×