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 8531769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:33:45+00:00 2026-06-11T09:33:45+00:00

I am getting GL function in my code using wglGetProcAddress. The author of the

  • 0

I am getting GL function in my code using wglGetProcAddress. The author of the guide (https://sites.google.com/site/opengltutorialsbyaks/introduction-to-opengl-3-2—tutorial-01) says that I need to define functions like this:

extern PFNGLCREATEPROGRAMPROC glCreateProgram;

Using extern keyword. But I tried without it and it works (compilation is successfully complete and the program successfully uses the function). Why do I need this keyword in general and in this case?

  • 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-06-11T09:33:46+00:00Added an answer on June 11, 2026 at 9:33 am

    extern tells the compiler that the name defined is in another compilation unit.
    A global function definition is extern by default. So that covers why it worked in your case.

    A place where you’d have to use it, is when defining and declaraing global variables.

    If there is a global variable that a compilation unit needs to be aware off (say a mutex), you need to make it available in said unit. But if you do this:

    int a; // in global scope
    

    The compiler will try to allocate memory for it in the programs static memory and will give a redifinition error. extern comes to our rescue here. By writing:

    extern int a;
    

    We are providing a declaration for the global, but not allocating memory for it.

    But since such use of globals is discouraged, you’d rarely see it in use.

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

Sidebar

Related Questions

I keep getting these 2 errors in my code In function 'int main()': error:
I keep getting 'warning: control reaches end of non-void function' with this code: -
I'm getting syntax error in firebug here is the code : $('#moderator-attention').live('toogle', function(){ function
Using the following code: Function GetSetting(Of T)(ByVal SettingName As String, ByRef DefaultVal As T)
I'm parsing a XML using jQuery with the following code: function appendNav(xml) { $(xml).find(Nav).each(function()
While compiling the c++ code using android NDK I am getting the following error:
I'm trying to add some Input Validation in Classic ASP by using the function/code
I'm getting full html code using WebClient. But i need to get specified div
I am not getting response while fetching result from my code using AJAX. while
I'm getting an uncaught referenceError whenever the 'countryDetail' function calls the 'country' variable using

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.