Bug #60029 LNK1104: cannot open file 'wcautil.lib' with Wix 3.5
Submitted: 9 Feb 2011 1:01 Modified: 2 Dec 2012 17:48
Reporter: Vladislav Vaintroub Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.5-bzr, 5.6.2 OS:Windows
Assigned to: CPU Architecture:Any

[9 Feb 2011 1:01] Vladislav Vaintroub
Description:
Wix 3.5 was released recently. If I install it, the build fails with the error above. I'm not trying to build MSI btw, just normal compilation.

How to repeat:
Install Wix 3.5 
Compile

Suggested fix:
Something like below in 
packaging\WiX\ca\CMakeLists.txt
It should work with both Wix3.0 and Wix3.5

IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
  SET(WIX_ARCH_SUFFIX "_x64")
ELSE()
  SET(WIX_ARCH_SUFFIX)
ENDIF()

IF(MSVC_VERSION EQUAL 1400)
  SET(WIX35_MSVC_SUFFIX "_2005")
ELSEIF(MSVC_VERSION EQUAL 1500)
  SET(WIX35_MSVC_SUFFIX "_2008")
ELSEIF(MSVC_VERSION EQUAL 1600)
  SET(WIX35_MSVC_SUFFIX "_2010")
ELSE()
  # When next VS is out, add the correct version here
  MESSAGE(FATAL_ERROR "Unknown VS version")
ENDIF()

FIND_LIBRARY(WIX_WCAUTIL_LIBRARY 
  NAMES wcautil${WIX_ARCH_SUFFIX}  wcautil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
  HINTS ${WIX_DIR}/../SDK/lib)

FIND_LIBRARY(WIX_DUTIL_LIBRARY 
  NAMES dutil${WIX_ARCH_SUFFIX}  dutil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
  PATHS ${WIX_DIR}/../SDK/lib)

ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES)
ADD_LIBRARY(wixca SHARED EXCLUDE_FROM_ALL ${WIXCA_SOURCES})
TARGET_LINK_LIBRARIES(wixca ${WIX_WCAUTIL_LIBRARY} ${WIX_DUTIL_LIBRARY} 
  msi version )
[21 Feb 2011 17:47] Santo Leto
Thank you for a bug report.

The following are the results of some tests I've performed.

* Preliminary info:

 - I've used MySQL versions: 5.5-bzr, 5.6-bzr
 - I've used Wix version: 3.5.2519.0
 - I've used the following compilation commands: 
   
   cmake ..\..\mysql-source\mysql-5.5 -G "Visual Studio 10" -DWITH_DEBUG=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1
   or
   cmake ..\..\mysql-source\mysql-trunk -G "Visual Studio 10" -DWITH_DEBUG=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1
   
   vcexpress MySql.sln /build Debug RelWithDebInfo /project package /out compilation_output-server-version.txt
   and
   vcexpress MySql.sln /build Debug RelWithDebInfo /project msi /out compilation_output-server-version.txt

* Results of the test:
	
	- 5.5-bzr, verified as described
	- 5.6-bzr, can't repeat as described (i.e. compilation of archive is fine)
	- 5.6-bzr, verified when trying to build msi

* Test Details 
 
1) Wix 3.5.2519.0 

1.1) 5.5-bzr

1.1.1) CMake

D:\Santo_Local\mysql-builds\mysql-5.5-ofs-bug60029>cmake ..\..\mysql-source\mysql-5.5 -G "Visual Studio 10" -DWITH_DEBUG=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- MySQL 5.5.11
-- Check size of void *
-- Check size of void * - done
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - not found.
-- Found Threads: TRUE
-- Check size of time_t
-- Check size of time_t - done
-- Performing Test TIME_T_UNSIGNED
-- Performing Test TIME_T_UNSIGNED - Failed
-- C warning options:
-- C++ warning options:
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Santo_Local/mysql-builds/mysql-5.5-ofs-bug60029

1.1.2) Archive compilation

D:\Santo_Local\mysql-builds\mysql-5.5-ofs-bug60029>vcexpress MySql.sln /build Debug RelWithDebInfo /project package /out compilation_output-5.5.txt

Fails, with errors:

[...]
79>------ Build started: Project: wixca, Configuration: Debug Win32 ------
78>     Creating library D:/Santo_Local/mysql-builds/mysql-5.5-ofs-bug60029/sql/Debug/udf_example.lib and object D:/Santo_Local/mysql-builds/mysql-5.5-ofs-bug60029/sql/Debug/udf_example.exp
79>  Building Custom Rule D:/Santo_Local/mysql-source/mysql-5.5/packaging/WiX/ca/CMakeLists.txt
79>  CMake does not need to re-run because D:\Santo_Local\mysql-builds\mysql-5.5-ofs-bug60029\packaging\WiX\ca\CMakeFiles\generate.stamp is up-to-date.
79>  CustomAction.cpp
78>     Creating library D:/Santo_Local/mysql-builds/mysql-5.5-ofs-bug60029/sql/Debug/udf_example.lib and object D:/Santo_Local/mysql-builds/mysql-5.5-ofs-bug60029/sql/Debug/udf_example.exp
78>  udf_example.vcxproj -> D:\Santo_Local\mysql-builds\mysql-5.5-ofs-bug60029\sql\Debug\udf_example.dll
79>LINK : fatal error LNK1104: cannot open file 'wcautil.lib'
[...]
========== Build: 87 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

1.1.3) MSI compilation

D:\Santo_Local\mysql-builds\mysql-5.5-ofs-bug60029>vcexpress MySql.sln /build Debug RelWithDebInfo /project msi /out compilation_output-5.5.txt

Of course it fails too, with output:

The following files were specified on the command line:

	RelWithDebInfo

These files could not be found and will not be loaded.1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
2>------ Build started: Project: wixca, Configuration: Debug Win32 ------
2>LINK : fatal error LNK1104: cannot open file 'wcautil.lib'
3>------ Build started: Project: MSI, Configuration: Debug Win32 ------
3>  -- MySQL 5.5.11
3>  Microsoft (R) Windows Installer Xml Compiler version 3.5.2519.0
3>  
3>  Copyright (C) Microsoft Corporation. All rights reserved.
3>  
3>  
3>  
3>  mysql_server.wxs
3>  
3>  Microsoft (R) Windows Installer Xml Linker version 3.5.2519.0
3>  
3>  Copyright (C) Microsoft Corporation. All rights reserved.
3>  
3>  
3>  
3>C:\delivery\Dev\wix35_public\src\ext\UIExtension\wixlib\Common.wxs(21): error LGHT0195: The Windows Installer XML variable 'WixUICostingPopupOptOut' is declared in more than one location.  Please remove one of the declarations.
3>  
3>  -- MySQL 5.5.11
3>  Building Custom Rule D:/Santo_Local/mysql-source/mysql-5.5/packaging/WiX/CMakeLists.txt
3>  CMake does not need to re-run because D:\Santo_Local\mysql-builds\mysql-5.5-ofs-bug60029\packaging\WiX\CMakeFiles\generate.stamp is up-to-date.
========== Build: 1 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

1.2) 5.6-bzr

1.2.1) CMake

D:\Santo_Local\mysql-builds\mysql-5.6-ofs-bug60029>cmake ..\..\mysql-source\mysql-trunk -G "Visual Studio 10" -DWITH_DEBUG=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- MySQL 5.6.2-m5
-- Check size of void *
-- Check size of void * - done
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - not found.
-- Found Threads: TRUE
-- Check size of time_t
-- Check size of time_t - done
-- Performing Test TIME_T_UNSIGNED
-- Performing Test TIME_T_UNSIGNED - Failed
-- C warning options:
-- C++ warning options:
-- Googletest was not found. gtest-based unit tests will be disabled. You can ru
n cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required comp
onents from source.
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Santo_Local/mysql-builds/mysql-5.6-ofs-bug60029

1.2.2) Archive compilation

vcexpress MySql.sln /build Debug RelWithDebInfo /project package /out compilation_output-5.6.txt

It does not fail:

========== Build: 101 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

1.2.3) MSI compilation

D:\Santo_Local\mysql-builds\mysql-5.6-ofs-bug60029>vcexpress MySql.sln /build Debug RelWithDebInfo /project msi /out compilation_output-5.6.txt

It fails, with output:

The following files were specified on the command line:

	RelWithDebInfo

These files could not be found and will not be loaded.1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
2>------ Build started: Project: wixca, Configuration: Debug Win32 ------
2>  Building Custom Rule D:/Santo_Local/mysql-source/mysql-trunk/packaging/WiX/ca/CMakeLists.txt
2>  CMake does not need to re-run because D:\Santo_Local\mysql-builds\mysql-5.6-ofs-bug60029\packaging\WiX\ca\CMakeFiles\generate.stamp is up-to-date.
2>  CustomAction.cpp
2>LINK : fatal error LNK1104: cannot open file 'wcautil.lib'
3>------ Build started: Project: MSI, Configuration: Debug Win32 ------
========== Build: 1 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
[2 Dec 2012 17:48] Vladislav Vaintroub
.