English 中文(简体)
由于未解决的符号,使用izar子创建的TL项目没有汇编成册。
原标题:ATL project created using wizard does not compile due to unresolved symbols

我一直在努力在视力演播室2008年编辑一个基本的ATL项目,我仍然有错误。 最后,我ten着以下建筑错误:

1>Linking...
1>   Creating library DebugSomeProject.lib and object DebugSomeProject.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>DebugSomeProject.dll : fatal error LNK1120: 2 unresolved externals

我对什么视而不见或做什么错误? 这里是复制步骤。

  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.

在这一点上,该项目建了罚款。 然而,我想把我的身份证分成多个档案,以便更好地组织起来(我的IDL是数千条线长)。

  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.

为了满足微软的IDL编辑,我们需要改变一些选择:

  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

现在,我现在期待该项目汇编成册。 但它没有。 您应获得我在此问题顶端列出的<代码>LNK1120错误。

任何想法? 我只想看什么简单?

最佳回答

不知道你正在做些什么,或者你为什么这样做,但是,在你失去真主党——即来源代码时,有些地方则说是中。 外部产生。 该图书馆包括连接器所抱怨的接口、表象和类型图书馆的古董。 如果你找回,请在*.c档案中查询IDL_DEFINE_GUID。

Edit:我现在看问题,你更名为blah_i.c to blah_i.cpp。 这是错误的,档案中载有C项声明。 汇编者将识别资料汇编成C++代码时,对识别资料进行了不同分析。 页: 1 或者使用/Tc汇编备选办法。

问题回答

开放2008年甚小口径终端指挥部,进入中间/产出目录,看看一些项目——i.obj。 类似情况:

dumpbin someproject_i.obj /symbols | find "LIBID"

如果在物体档案中没有界定“同上”,那就会产生问题。 也许它有错的名称? 如果有一个名字正确,那么问题就是联系人没有使用。





相关问题
How to let idlj compile idl files in ant

I ve no idea how to compile my idl files with the sun-idl compiler (idlj) with the help of ant? Does anyone have an idea?

Struct inheritance in MIDL

I am trying to inherit from and extend a structure defined in MIDL. I used the same syntax as for interface inheritance i.e typedef struct stDBIBinVarDataEx { float x; } MYSTRUCT ; struct ...

multiple Thrift services on one transport

Just seeking confirmation here : apache Thrift protocol does not seem to support running multiple services on one transport endpoint ? ( a socket, file, whatever ) I cant seem to figure out how to do ...

ctags generator for CORBA IDL?

I work in a multi-language environment and use Vim + ctags for navigating the code. However we also use CORBA and exuberant ctags does not parse IDL files. Does anyone know of a ctags compatible ...

Properly extending a COM interface (IDL)

I am working with some legacy c++ code and I need to extend an interface. The current interfaces are for example: [ object, uuid(guid), version(1.0), dual, nonextensible, oleautomation ] ...

Notepad++ IDL Syntax Highlighting? [closed]

I was about to create a user-defined language file for Notepad++ to syntax-highlight IDL (Interactive Data Language). But before I went and spent the time creating one, I wanted to check with the &...

热门标签