We help IT Professionals succeed at work.

linking library problem

serg111 asked
Medium Priority
Last Modified: 2013-11-17
I am using Borland C++ 5.02 and have problem to use uuid.lib
At link time it complains "Some invalid record in library 0x21?"
Any ideas?
Watch Question


Your uuid.lib must be a lib file for VisualC, you need to use the implib tool from Borland and create a correct one.


I know that I can use implib.exe to create uuid.lib from uuid.dll
but I cant find uuid.dll online.
Do you know where can I get one?

If you have c++builder too, you can use the uuid.lib from there.


I dont have it

> I know that I can use implib.exe to create uuid.lib from uuid.dll
> but I cant find uuid.dll online.

uuid.lib is a static library, not a import library, so there is no uuid.dll

You might use this to create your own uuid.lib: http://svn.dsource.org/projects/bindings/trunk/uuid_obj.d


This file include

** Batch file to create uuid.lib **
dmd -c uuid_obj.d
lib -c uuid.lib uuid_obj.obj

There is no dmd under Borland 5.02

How can I create library?

and the file is not c either. So you have to convert it.

For example the line
    const IID _DBBMKGUID = {0xB04B30F6, 0x88D1, 0xCD11, [0xAD, 0x48, 0x00, 0xAA, 0x00, 0x3C, 0x9C, 0xB6]};
would be something like:
    DEFINE_GUID(_DBBMKGUID, 0xB04B30F6, 0x88D1, 0xCD11, 0xAD, 0x48, 0x00, 0xAA, 0x00, 0x3C, 0x9C, 0xB6);

Instead of linking the uuid.lib file, you can also include the converted c++ file in your project.


Ok, now I am using it like this:

DEFINE_GUID(IID_IHTMLDocument2, 0x25442C33, 0xCB26, 0xD011, 0xB4, 0x83, 0x00, 0xC0, 0x4F, 0xD9, 0x01, 0x19);
m_hResult = m_pDispatch->QueryInterface(IID_IHTMLDocument2, (void**)&m_pHtmlDoc);

It does not complains about wrong library but gives linker error:
"Unresolved external _IID_IHTMLDocument2..."

It looks like microsoft uuid.lib contains something also beside GUID definition...
see http://www.michaelmoser.org/tip12.htm and http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q130869

There are two versions of the DEFINE_GUID macro. You need the other version. You need to include initguid.h.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.