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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:45:17+00:00 2026-05-14T18:45:17+00:00

I have started initially with VC++ 2008 Express. I’ve noticed that GCC becomes kind

  • 0

I have started initially with VC++ 2008 Express. I’ve noticed that GCC becomes kind of standard, so I am trying to make the right steps event from the beginning.

I have written a piece of code that connects to a SQL Server server via ADO. On VC++, it’s working like a charm by importing MSADO15.dll:

#import "msado15.dll" no_namespace rename("EOF", "EndOfFile")

Because I am going to move from VC++ I was looking for an alternative (eventually multi-platform) IDE, so I stick (for this time) with Code::Blocks (I’m using the last nightly build, SVN 6181).

As the compiler, I choose to use GCC 3.4.5 (ported via MinGW 5.1.6), under Windows Vista.

I was trying to compile a simple "Hello, World!" application with GCC that use/import the same msado15.dll (#import "c:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile")) and I was surprised to see a lot of compile-time errors.

I was expected that the #import compiler’s directive will generate a library from "msado15.dll", so it can link to it later (link-edit time or whatever). Instead it was trying to read it as a normal file (like a header file, if you like), because it was trying to interpret each line in the DLL (which has a MZ signature):

Example:

Compiling: main.cpp
E:\MyPath\main.cpp:2:64: warning: extra tokens at end of #import directive
In file included from E:\MyPath\main.cpp:2:
c:\Program Files\Common Files\System\ADO\msado15.dll:1: error: stray ‘\144’ in program
In file included from E:\MyPath\main.cpp:2:
c:\Program Files\Common Files\System\ADO\msado15.dll:1:4: warning: null character(s) ignored
c:\Program Files\Common Files\System\ADO\msado15.dll:1: error: stray ‘\3’ in program
c:\Program Files\Common Files\System\ADO\msado15.dll:1:6: warning: null character(s) ignored
c:\Program Files\Common Files\System\ADO\msado15.dll:1: error: stray ‘\4’ in program
…
and so on.

Well, it is obvious that under this version of GCC the #import directive does not do the expected job (perhaps #import is not supported anymore by GCC), so how can I use the ADO to access SQL Server database on a C++ program compiled with GCC (v3.4.5)?

  • 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-14T18:45:17+00:00Added an answer on May 14, 2026 at 6:45 pm

    GCC and MSVC use #import for different things.
    In GCC, #import is an objective-c variant of #include that only includes the header file once.
    In MSVC, #import triggers a Microsoft extension that builds a smart pointer implementation and header files from a COM type library.

    In GCC you are going to have to import the COM object the old fashioned way. Find the existing interface definitions or use a tool like OleSpy to generate the definitions from the tlb.

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

Sidebar

Related Questions

No related questions found

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.