[wix-users] error LGHT0091: Duplicate symbol

Farrukh Waheed farrukh1 at gmail.com
Mon Apr 25 23:03:48 PDT 2016


As mentioned by Phill, you are actually missing with File at Id attribute.
Here is your same code but with File at Id attributes, now building fine.
BTW, I suggest, you should learn using Heat.exe, i.e Wix Harvest tool. This
way, you would not face such issues.


<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <Product Id="*"
           Version="1.0.0.0"
           Name="WixInstaller"
           Language="1033"
           Manufacturer="My Company Name"
           UpgradeCode="{288B0815-CABF-40E4-9DBB-08DEAFB2D36D}">

    <Package InstallerVersion="301"
             Compressed="yes"
             InstallScope="perMachine"
             InstallPrivileges="elevated"
             Description="Installs the [ProductName] program"
             Manufacturer="My Company Name"
             Comments="My comment"/>

    <Condition Message="This application is only supported on Windows Vista
or higher.">

      <![CDATA[Installed OR (VersionNT >= 601)]]>

    </Condition>



    <MediaTemplate EmbedCab="yes" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName]
is already installed." />



    <Directory Id="TARGETDIR"
               Name="SourceDir">

      <Directory Id="ProgramFilesFolder">

        <Directory Id="MyCompanyNameDirectoryId"
                   Name="MyCompanyName" >

          <Directory Id="MyProjADirectoryId"
                     Name="ProjA"/>

          <Directory Id="MyProjBDirectoryId"
                     Name="ProjB"/>

        </Directory>

      </Directory>

    </Directory>



    <!--

                                                Project A files

                                -->

    <ComponentGroup Id="ProjAComponentGroupId"
                    Directory="MyProjADirectoryId">



      <Component Id="ProjAComponentId_File01"
                 Guid="{BAB628EF-196D-4944-9140-4C4EE206C139}">

        <File Id="mainA.cpp" Source="$(var.ProjA.ProjectDir)main.cpp"
              Name="main.cpp" />

      </Component>



      <Component Id="ProjAComponentId_File02"
                 Guid="{AB59F389-1177-43AE-955F-C5DF538AD3AC}">

        <File Id ="mainA.h" Source="$(var.ProjA.ProjectDir)main.h"
              Name="main.h" />

      </Component>



      <Component Id="ProjAComponentId_File03"
                 Guid="{3CB35750-A5DD-4373-9656-37A7651B962E}">

        <File Id="ResourceA.h" Source="$(var.ProjA.ProjectDir)Resource.h" />

      </Component>



      <Component Id="ProjAComponentId_File04"
                 Guid="{D3A11428-2B04-4F0C-B68D-B4E8E086A930}">

        <File Id="stdafxA.cpp" Source="$(var.ProjA.ProjectDir)stdafx.cpp" />

      </Component>



      <Component Id="ProjAComponentId_File05"
                 Guid="{DDB7DE16-70BA-4FE0-8F5A-9071291917E3}">

        <File Id="stdafxA.h" Source="$(var.ProjA.ProjectDir)stdafx.h" />

      </Component>

    </ComponentGroup>



    <!--

                                                Project B files

                                -->

    <ComponentGroup Id="ProjBComponentGroupId"
                    Directory="MyProjBDirectoryId">



      <Component Id="ProjBComponentId_File01"
                 Guid="{293D2C62-4A6A-496C-9C82-63BBE934343F}">

        <File Id="mainB.cpp" Source="$(var.ProjB.ProjectDir)main.cpp"
              Name="main.cpp"/>

      </Component>



      <Component Id="ProjBComponentId_File02"
                 Guid="{ED878B60-EB95-4D62-AAB2-3BDDC641D43B}">

        <File Id="mainB.h" Source="$(var.ProjB.ProjectDir)main.h"
              Name="main.h"/>

      </Component>



      <Component Id="ProjBComponentId_File03"
                 Guid="{015D7916-53C3-4BE9-86F6-6617F77E1E49}">

        <File Id="ResourceB.h" Source="$(var.ProjB.ProjectDir)Resource.h" />

      </Component>



      <Component Id="ProjBComponentId_File04"
                 Guid="{3526D1CC-FDF2-46A7-9F67-EE12BAA2657A}">

        <File Id="stdafxB.cpp" Source="$(var.ProjB.ProjectDir)stdafx.cpp" />

      </Component>



      <Component Id="ProjBComponentId_File05"
                 Guid="{44BFC964-9806-450B-83DB-C2153C3E69B6}">

        <File Id="stdafxB.h" Source="$(var.ProjB.ProjectDir)stdafx.h" />

      </Component>

    </ComponentGroup>



    <Feature Id="ProductFeatureId"
             Title="My Feature Title">

      <ComponentGroupRef Id="ProjAComponentGroupId"/>

      <ComponentGroupRef Id="ProjBComponentGroupId"/>

    </Feature>

  </Product>

</Wix>

On 25 April 2016 at 22:13, Phill Hogland <phill.hogland at rimage.com> wrote:

> >>So my question is has anyone encountered the problem before and found a
>  solution?
>
> I had a similar problem where I was creating a msi to install our
> product's sdk which had a number of VS samples etc, each containing similar
> filenames such as readme.txt
>
> The solution that I settled on (after trying a different approach which
> worked but were less desirable) is:
> 1) A build script, external to the wix build process in my case, is used
> to copy the files to a source tree which mimics how I want the files to
> layout on the target system.  (And I generally use 'named bindpaths' and
> avoid using VS Properties because I prefer to build with MSBuild directly
> without having the VS Solution loaded.)
> 2) I use HarvestDirectory to harvest a parent of the folder tree that
> contains the duplicate file names.  Heat manages the duplicates assigning
> different IDs.
>
> An earlier approach when I was harvesting/authoring the subfolder trees
> which might have a duplicate file name as another harvest/authoring section
> was to make sure that the File/@Id (and related Ids) were each authored
> differently using transforms, but that was impractical to maintain over
> time.
>
>
> ________________________________________
> From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Ian
> Bell <ib at ianbellsoftware.com>
> Sent: Monday, April 25, 2016 11:48:56 AM
> To: 'WiX Toolset Users Mailing List'
> Subject: Re: [wix-users] error LGHT0091: Duplicate symbol
>
> Hello Farrukh,
>
>
>
> Thanks for letting me know the attached was not included.    The WIX
> markup is included below.   The error is generated for duplicate source
> code filenames, even though the directory paths are different.
>
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
>
>                 <Product Id="*"
>
>
>        Version="1.0.0.0"
>
>
>        Name="WixInstaller"
>
>
>        Language="1033"
>
>
>        Manufacturer="My Company Name"
>
>
>        UpgradeCode="{288B0815-CABF-40E4-9DBB-08DEAFB2D36D}">
>
>
>
>                                 <Package InstallerVersion="301"
>
>
>                        Compressed="yes"
>
>
>                       InstallScope="perMachine"
>
>
>                       InstallPrivileges="elevated"
>
>
>                       Description="Installs the [ProductName] program"
>
>
>                       Manufacturer="My Company Name"
>
>
>                       Comments="My comment"/>
>
>
>
>
>
>                                 <Condition Message="This application is
> only supported on Windows Vista or higher.">
>
>                                                 <![CDATA[Installed OR
> (VersionNT >= 601)]]>
>
>                                 </Condition>
>
>
>
>                                 <MediaTemplate EmbedCab="yes" />
>
>                                 <MajorUpgrade DowngradeErrorMessage="A
> newer version of [ProductName] is already installed." />
>
>
>
>                                 <Directory Id="TARGETDIR" Name="SourceDir">
>
>                                                 <Directory
> Id="ProgramFilesFolder">
>
>                                                                 <Directory
> Id="MyCompanyNameDirectoryId" Name="MyCompanyName" >
>
>
>       <Directory Id="MyProjADirectoryId"  Name="ProjA"/>
>
>
>       <Directory Id="MyProjBDirectoryId"  Name="ProjB"/>
>
>
> </Directory>
>
>                                                 </Directory>
>
>                                 </Directory>
>
>
>
>                                 <!--
>
>                                                 Project A files
>
>                                 -->
>
>                                 <ComponentGroup Id="ProjAComponentGroupId"
> Directory="MyProjADirectoryId">
>
>
>
>                                                 <Component
> Id="ProjAComponentId_File01" Guid="{BAB628EF-196D-4944-9140-4C4EE206C139}">
>
>                                                                 <File
> Source="$(var.ProjA.ProjectDir)main.cpp" Name="main.cpp" />
>
>                                                 </Component>
>
>
>
>                                                 <Component
> Id="ProjAComponentId_File02" Guid="{AB59F389-1177-43AE-955F-C5DF538AD3AC}">
>
>                                                                 <File
> Source="$(var.ProjA.ProjectDir)main.h" Name="main.h" />
>
>                                                 </Component>
>
>
>
>                                                 <Component
> Id="ProjAComponentId_File03" Guid="{3CB35750-A5DD-4373-9656-37A7651B962E}">
>
>                                                                 <File
> Source="$(var.ProjA.ProjectDir)Resource.h" />
>
>                                                 </Component>
>
>
>
>                                                 <Component
> Id="ProjAComponentId_File04" Guid="{D3A11428-2B04-4F0C-B68D-B4E8E086A930}">
>
>                                                                 <File
> Source="$(var.ProjA.ProjectDir)stdafx.cpp" />
>
>                                                 </Component>
>
>
>
>                                                 <Component
> Id="ProjAComponentId_File05" Guid="{DDB7DE16-70BA-4FE0-8F5A-9071291917E3}">
>
>                                                                 <File
> Source="$(var.ProjA.ProjectDir)stdafx.h" />
>
>                                                 </Component>
>
>                                 </ComponentGroup>
>
>
>
>                                 <!--
>
>                                                 Project B files
>
>                                 -->
>
>                                 <ComponentGroup Id="ProjBComponentGroupId"
> Directory="MyProjBDirectoryId">
>
>
>
>                                                 <Component
> Id="ProjBComponentId_File01" Guid="{293D2C62-4A6A-496C-9C82-63BBE934343F}">
>
>                                                                 <File
> Source="$(var.ProjB.ProjectDir)main.cpp" Name="main.cpp"/>
>
>                                                 </Component>
>
>
>
>                                                 <Component
> Id="ProjBComponentId_File02" Guid="{ED878B60-EB95-4D62-AAB2-3BDDC641D43B}">
>
>                                                                 <File
> Source="$(var.ProjB.ProjectDir)main.h" Name="main.h"/>
>
>                                                 </Component>
>
>
>
>                                                 <Component
> Id="ProjBComponentId_File03" Guid="{015D7916-53C3-4BE9-86F6-6617F77E1E49}">
>
>                                                                 <File
> Source="$(var.ProjB.ProjectDir)Resource.h" />
>
>                                                 </Component>
>
>
>
>                                                 <Component
> Id="ProjBComponentId_File04" Guid="{3526D1CC-FDF2-46A7-9F67-EE12BAA2657A}">
>
>                                                                 <File
> Source="$(var.ProjB.ProjectDir)stdafx.cpp" />
>
>                                                 </Component>
>
>
>
>                                                 <Component
> Id="ProjBComponentId_File05" Guid="{44BFC964-9806-450B-83DB-C2153C3E69B6}">
>
>                                                                 <File
> Source="$(var.ProjB.ProjectDir)stdafx.h" />
>
>                                                 </Component>
>
>                                 </ComponentGroup>
>
>
>
>                                 <Feature Id="ProductFeatureId" Title="My
> Feature Title">
>
>                                                 <ComponentGroupRef
> Id="ProjAComponentGroupId"/>
>
>                                                 <ComponentGroupRef
> Id="ProjBComponentGroupId"/>
>
>                                 </Feature>
>
>                 </Product>
>
> </Wix>
>
>
>
> From: Farrukh Waheed [mailto:farrukh1 at gmail.com]
> Sent: April 25, 2016 01:33
> To: ib at ianbellsoftware.com; WiX Toolset Users Mailing List
> Subject: Re: [wix-users] error LGHT0091: Duplicate symbol
>
>
>
> I didn't find the zip file. However from log, it seems that you have added
> some files more than one times using same Component IDs (or may be File
> Ids). For example, main.cpp's Component at line 41 is also present at line
> 61. Please check Component definition where it says "Location of symbol
> related to previous error.".
>
> Can you please share only Product.wxs?
>
>
>
> On 25 April 2016 at 09:50, Ian Bell <ib at ianbellsoftware.com> wrote:
>
> I have not been able to resolve a "error LGHT0091: Duplicate symbol" error
> message that has been plaguing me for 2 days and I am hoping to find some
> help here.
>
>
>
> The attached ZIP file contains a small Visual Studio 2010 solution which
> can
> be used to replicate the problem.   The sample VS2010 solution includes two
> C++ projects and a WIX installer.    The two C++ projects contain
> identically named source files (e.g. main.cpp, main.h, stdafx.cpp,
> stdafx.h).   Attempting to build a WIX project with non-unique source code
> filenames (i.e. their filepaths differ but the filenames are the same)
> generates error messages similar to 'error LGHT0091: Duplicate symbol
> found'.   The complete error message generated for the sample solution is
> included at the end of this email message.   Google lists only handful of
> posts which cite the LGHT0091 and LGHT0092 error numbers and these refer to
> GUI related problems - something my WIX installer avoids.
>
>
>
> One solution is to provide unique source code filenames between projects -
> but this is a very impractical, particularly for files with common Visual
> Studio generated filenames names such as 'stdafx.cpp', 'stdafx.h',
> 'resource.h', etc.
>
>
>
> So my question is has anyone encountered the problem before and found a
> solution?   I would appreciate any suggestions you might have.
>
>
>
> ThanX
>
>
>
> Ian
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 1>------ Build started: Project: WixInstaller, Configuration: Debug x86
> ------
>
> 1>            C:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe
> -dDebug -d"DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio
> 10.0\Common7\IDE\\" -d"SolutionDir=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\\" -dSolutionExt=.sln
> -dSolutionFileName=testWixError.sln -dSolutionName=testWixError
> -d"SolutionPath=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\testWixError.sln" -dConfiguration=Debug
> -dOutDir=bin\Debug\ -dPlatform=x86
> -d"ProjectDir=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\\" -dProjectExt=.wixproj
> -dProjectFileName=WixInstaller.wixproj -dProjectName=WixInstaller
> -d"ProjectPath=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\WixInstaller.wixproj"
> -d"TargetDir=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\bin\Debug\\" -dTargetExt=.msi
> -dTargetFileName=WixInstaller.msi -dTargetName=WixInstaller
> -d"TargetPath=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\bin\Debug\WixInstaller.msi"
> -dProjA.Configuration=Debug -d"ProjA.FullConfiguration=Debug|Win32"
> -dProjA.Platform=Win32 -d"ProjA.ProjectDir=e:\Users\admin\Documents\Visual
> Studio 2010\Projects\testWixError\ProjA\\" -dProjA.ProjectExt=.vcxproj
> -dProjA.ProjectFileName=ProjA.vcxproj -dProjA.ProjectName=ProjA
> -d"ProjA.ProjectPath=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\ProjA\ProjA.vcxproj"
> -d"ProjA.TargetDir=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\Debug\\" -dProjA.TargetExt=.exe
> -dProjA.TargetFileName=ProjA.exe -dProjA.TargetName=ProjA
> -d"ProjA.TargetPath=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\Debug\ProjA.exe" -dProjB.Configuration=Debug
> -d"ProjB.FullConfiguration=Debug|Win32" -dProjB.Platform=Win32
> -d"ProjB.ProjectDir=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\ProjB\\" -dProjB.ProjectExt=.vcxproj
> -dProjB.ProjectFileName=ProjB.vcxproj -dProjB.ProjectName=ProjB
> -d"ProjB.ProjectPath=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\ProjB\ProjB.vcxproj"
> -d"ProjB.TargetDir=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\Debug\\" -dProjB.TargetExt=.exe
> -dProjB.TargetFileName=ProjB.exe -dProjB.TargetName=ProjB
> -d"ProjB.TargetPath=e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\Debug\ProjB.exe" -out obj\Debug\ -arch x86
> Product.wxs
>
> 1>            C:\Program Files (x86)\WiX Toolset v3.10\bin\Light.exe -out
> "e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\bin\Debug\WixInstaller.msi" -pdbout
> "e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\bin\Debug\WixInstaller.wixpdb"
> -cultures:null -contentsfile
> obj\Debug\WixInstaller.wixproj.BindContentsFileListnull.txt -outputsfile
> obj\Debug\WixInstaller.wixproj.BindOutputsFileListnull.txt
> -builtoutputsfile
> obj\Debug\WixInstaller.wixproj.BindBuiltOutputsFileListnull.txt
> -wixprojectfile "e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\WixInstaller.wixproj"
> obj\Debug\Product.wixobj
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(41,0): error LGHT0091:
> Duplicate symbol 'File:main.cpp' found. This typically means that an Id is
> duplicated. Check to make sure all your identifiers of a given type (File,
> Component, Feature) are unique.
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(67,0): error LGHT0092:
> Location of symbol related to previous error.
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(45,0): error LGHT0091:
> Duplicate symbol 'File:main.h' found. This typically means that an Id is
> duplicated. Check to make sure all your identifiers of a given type (File,
> Component, Feature) are unique.
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(71,0): error LGHT0092:
> Location of symbol related to previous error.
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(49,0): error LGHT0091:
> Duplicate symbol 'File:Resource.h' found. This typically means that an Id
> is
> duplicated. Check to make sure all your identifiers of a given type (File,
> Component, Feature) are unique.
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(75,0): error LGHT0092:
> Location of symbol related to previous error.
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(53,0): error LGHT0091:
> Duplicate symbol 'File:stdafx.cpp' found. This typically means that an Id
> is
> duplicated. Check to make sure all your identifiers of a given type (File,
> Component, Feature) are unique.
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(79,0): error LGHT0092:
> Location of symbol related to previous error.
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(57,0): error LGHT0091:
> Duplicate symbol 'File:stdafx.h' found. This typically means that an Id is
> duplicated. Check to make sure all your identifiers of a given type (File,
> Component, Feature) are unique.
>
> 1>e:\Users\admin\Documents\Visual Studio
> 2010\Projects\testWixError\WixInstaller\Product.wxs(83,0): error LGHT0092:
> Location of symbol related to previous error.
>
> 1>Done building project "WixInstaller.wixproj" -- FAILED.
>
> 1>
>
> ========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
>
>
>
>
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
>
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>


More information about the wix-users mailing list