Microsoft KB Archive/249263: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 44: Line 44:
== SYMPTOMS ==
== SYMPTOMS ==


Within a new Windows CE platform you can have multiple projects, for which you have to declare dependencies. For example, if you have two projects, then you declare the first project, such as &quot;Project1.dll&quot;, to be dependent upon the second project, which you might call &quot;Project2.dll&quot;. If the dependencies are not specified properly, then a linker error occurs.<br />
Within a new Windows CE platform you can have multiple projects, for which you have to declare dependencies. For example, if you have two projects, then you declare the first project, such as "Project1.dll", to be dependent upon the second project, which you might call "Project2.dll". If the dependencies are not specified properly, then a linker error occurs.<br />
<br />
<br />
'''Problem:'''<br />
'''Problem:'''<br />
Line 58: Line 58:
Linking...<br />
Linking...<br />
LINK : fatal error LNK1104: cannot open file<br />
LINK : fatal error LNK1104: cannot open file<br />
&quot;..\Hardware\WCEX86Dbg\project2.lib&quot;<br />
"..\Hardware\WCEX86Dbg\project2.lib"<br />
Error executing link.exe.
Error executing link.exe.


Line 83: Line 83:


For example, the following lists Project2 before Project1. Project1 depends on project Project2 and therefore this is the correct way to list them.
For example, the following lists Project2 before Project1. Project1 depends on project Project2 and therefore this is the correct way to list them.
<pre class="codesample">Platform: &quot;Platform&quot;=.\platform.wce - Package Owner=4
<pre class="codesample">Platform: "Platform"=.\platform.wce - Package Owner=4


Package=5
Package=5

Latest revision as of 13:52, 21 July 2020

Knowledge Base


PRB: Project Dependency Doesn't Work as Expected: Fatal Error LNK1104: Cannot Open File

Article ID: 249263

Article Last Modified on 12/27/2003



APPLIES TO

  • Microsoft Windows CE Platform Builder 2.12



This article was previously published under Q249263

SYMPTOMS

Within a new Windows CE platform you can have multiple projects, for which you have to declare dependencies. For example, if you have two projects, then you declare the first project, such as "Project1.dll", to be dependent upon the second project, which you might call "Project2.dll". If the dependencies are not specified properly, then a linker error occurs.

Problem:

When you build the platform, Project2 should be built first, and because of the dependency setting, Project1 should be built after this.

But if the dependency settings are not correct, then the build process may stop and the following error message appears:

Compiling resources...
Compiling...
Project1.cpp
Linking...
LINK : fatal error LNK1104: cannot open file
"..\Hardware\WCEX86Dbg\project2.lib"
Error executing link.exe.

CAUSE

This error depends on the order you added the projects relative to the dependency settings. You must first add the projects on which other projects are dependent.

RESOLUTION

You can find the dependency settings for each project and the platform in the Platform.pbw file. Make sure that the project that appears first in the Platform section is built first.

MORE INFORMATION

For example, the following lists Project2 before Project1. Project1 depends on project Project2 and therefore this is the correct way to list them.

Platform: "Platform"=.\platform.wce - Package Owner=4

Package=5
{{{
}}}

Package=4
{{{
    Begin Project Dependency
    Project_Dep_Name Project2
    End Project Dependency
    Begin Project Dependency
    Project_Dep_Name Project1
    End Project Dependency
}}}
                


Additional query words: Build, Platform, Project, Dependency, Linker error, Project Settings

Keywords: kbprb KB249263