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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:11:16+00:00 2026-06-12T16:11:16+00:00

I come from a Delphi world where importing a DLL function statically is pretty

  • 0

I come from a Delphi world where importing a DLL function statically is pretty easy. All you need to do is specify the function name and the module like this:

function GetTickCount : DWORD; stdcall; external 'Kernel32.dll';

Why in C++ must I use kernel32.lib in order to import the function? Why can’t I simply tell the linker to import that function just like in Delphi?

I know it may sound noobish for manny of you, but coming in the C++ world from Delphi can really get confusing.

  • 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-12T16:11:17+00:00Added an answer on June 12, 2026 at 4:11 pm

    The C++ toolchain takes a couple of steps to do what Delphi can do in one step. When declaring an external DLL function in C++, there is no (standard) way to indicate which named DLL the function can actually be found in. As far as the compiler is concerned, the declared function is simply extern and there must be a definition that can be found somewhere by the linker.

    To connect the named function to the DLL in which it can be found, the C++ toolchain requires an “import library” that contains import stubs that the linker knows what to do with. When finding a function defined by an import stub, the linker creates a DLL function reference for the specific function name in the corresponding DLL (as indicated by the import stub).

    In Delphi, the language designers allowed the programmer to specify the associated DLL directly in the source code. The Delphi compiler can then directly generate the reference to the external DLL without the use of the import stub step.

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

Sidebar

Related Questions

I come from the Java world, so to me it's all object.foo() , but
I am using Delphi XE2 and importing SHGetFolderPath from Shell32.dll. I am running windows
I have to use an encoding function from an external C++ DLL in Delphi
I have some colors that seem to come from a Delphi TColor variable (e.g
I come from the asp.net world where we'd use an objectdatasource, hooked up to
I come from a php background and in php, there is an array_size() function
I come from a .NET background and need to do a web project in
I come from the web forms world, and I'm learning MVC4 and Entity Framework
I come from Windows world and used Visual Studio for years. When I click
I come from a procedural world so bear with me on this. I am

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.