Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6992345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:37:20+00:00 2026-05-27T19:37:20+00:00

In sqlite’s source code, you can see following define: /* ** Add the ability

  • 0

In sqlite’s source code, you can see following define:

/*
** Add the ability to override 'extern'
*/
#ifndef SQLITE_EXTERN
# define SQLITE_EXTERN extern
#endif

I am not quite sure in what case we might want to override “extern”, do you have any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:37:21+00:00Added an answer on May 27, 2026 at 7:37 pm

    We are telling the compiler to replace all instances of SQLITE_EXTERN with the “extern” keyword, when it preprocesses files. Hence if you includes a sql header which contains a declaration as below

    SQLITE_EXTERN datatype sql_variable;

    the compiler treats it as an “extern” variable and doesn’t allocate memory for the variable.

    EDIT:

    To add to that, it is a convention to declare variables with “extern” in the header files and defining the variable in the cpp file. Defining variables in the header files without “extern” qualifier would allocate space for the variable wherever the header file is included!

    Overriding the extern:

    The #define above provides an ability for you to initialize sql variables as you like. See the link http://msdn.microsoft.com/en-us/library/w7wd1177(v=vs.71).aspx for more details about initializers. There is a statement in the article ->

    Declarations of automatic, register, static, and external variables can contain initializers. However, declarations of external variables can contain initializers only if the variables are not declared as extern.

    If you somehow want to override the external declaration of an sql variable, and want to initialize it by yourself, you could just define

    #define SQLITE_EXTERN 
    

    One reason to override this is because Sqlite is cross platform (really widely), some of the platform may not support extern keywords well, thus we need to flexibility to disable this.

    and init the variables as you want them. Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can SQLite sort naturally? For example, CREATE TABLE animals ( id INTEGER NOT NULL
I like how SQLite library can be included into an application and the application
In sqlite I was able to create a table with the following command: create
With SQLite, user defined SQL functions can easily be added using the C api
Since SQLite does not support RIGHT OUTER JOINS I pose the following challenge (read:
Can Sqlite NHibernate id generator be made compatible with Postgresql? I'm planning to unit
Using SQLite-manager (in its XUL form) on a Mac. How can I diff a
SQLite insert statement does not insert the new data i am using this code
The following SQLite query is accepted by the SQLite shell (version 3.7.5, which is
SQLite behaves differently when dealing with aggregation than many other RDBMS's. Consider the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.