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

  • Home
  • SEARCH
  • 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 947621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:06:33+00:00 2026-05-15T23:06:33+00:00

I have been working on getting a basic ATL project to compile in Visual

  • 0

I have been working on getting a basic ATL project to compile in Visual Studio 2008 and I keep running into errors. Ultimately I have gotten stuck with the following build errors:

1>Linking...
1>   Creating library Debug\SomeProject.lib and object Debug\SomeProject.exp
1>dllmain.obj : error LNK2001: unresolved external symbol _LIBID_SomeProjectLib
1>SomeObject.obj : error LNK2001: unresolved external symbol _LIBID_SomeProjectLib
1>SomeObject.obj : error LNK2001: unresolved external symbol _IID_ISomeObject
1>Debug\SomeProject.dll : fatal error LNK1120: 2 unresolved externals

What am I overlooking or doing wrong? Here are the steps to reproduce.

  1. Create a new ATL Project named SomeProject. Accept all defaults.
  2. Right-click the project in the Solution Explorer and select Add > Class.
  3. Select ATL Simple Object and enter SomeObject as its Short Name. Accept all other defaults.

At this points the project builds fine. However I want to split my IDL among multiple files for better organization (my IDL would be thousands of lines long).

  1. Right-click the project and select Add > New Item.
  2. Select Midl File and enter ISomeObject as its filename.
  3. Open SomeProject.idl and cut the ISomeObject interface declaration. Replace it with import "ISomeObject.idl";.
  4. Paste the interface declaration in ISomeObject.idl.

In order to satisfy Microsoft’s IDL compiler we need to change some options:

  1. Right-click the project and open its Properties. Go to the MIDL > Output section and enter the following values:
    • Header File: $(InputName).h
    • IID File: $(InputName)_i.cpp
    • Proxy File: $(InputName)_p.cpp
    • Generate Type Library: No
  2. Go to the C/C++ > Precompiled Headers section and set Create/Use Precompiled Header to Not using Precompiled Header. There are errors later if precompiled headers are used.
  3. Select the SomeProject.idl file so that its properties are displayed. Go to the MIDL > Output section and set Generate Type Library to Yes.
  4. Remove SomeProject_i.h and SomeProject_i.c from the Generated Files filter.
  5. Add the following Existing Items to the Generated Files filter. You may need to attempt to compile the project first.
    • SomeProject.h
    • SomeProject_i.cpp
    • ISomeObject.h
    • ISomeObject_i.cpp

Now, at this point I would expect the project to compile. But it doesn’t. You should get the LNK1120 errors that I listed at the top of this question.

Any ideas? Am I overlooking something simple?

  • 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-15T23:06:33+00:00Added an answer on May 15, 2026 at 11:06 pm

    Not sure what you are doing, or why you are doing this, but somewhere along the way you lost the blah_i.c source code file that midl.exe generates. It contains the GUIDs of the interfaces, coclasses and type library, the ones that the linker is complaining about. If you can’t find it back, search for MIDL_DEFINE_GUID in the *.c files.

    Edit: I see the problem now, you renamed the blah_i.c to blah_i.cpp. That’s wrong, the file contains C declarations. The compiler mangles the identifiers differently when it is compiled as C++ code. Rename it back to .c. Or use the /Tc compile option.

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

Sidebar

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.