Microsoft KB Archive/249263

From BetaArchive Wiki
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


  • Microsoft Windows CE Platform Builder 2.12

This article was previously published under Q249263


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.


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...
LINK : fatal error LNK1104: cannot open file
Error executing link.exe.


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.


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.


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


    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