CMakeHelpers
CMakeHelpers copied to clipboard
fatal error CVT1100: ressource en double. Type: VERSION, nom: 1, langage: 0x040C
Hello,
I use your cmake script to versionning my library with cmake. Everything worked until today when I have link errors like this :
Création de la bibliothÞque core.lib et de l'objet core.exp
CVTRES : fatal error CVT1100: ressource en double. Type: VERSION, nom: 1, langage: 0x040C
LINK : fatal error LNK1123: échec lors de la conversion en fichier COFF: fichier non valide ou endommagÚ
LINK Pass 1 failed. with 1123
NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake\bin\cmake.exe"' : code retour '0xffffffff'
I use this script in many of my CMakeLists.txt and I'm trying to solve this issue without result.
In each of my CMakeLists.txt I've add the following lines :
[...]
if(MSVC)
include(${COREALPI_DIR}/platform/cmake/common/generate_product_version.cmake)
generate_product_version(
VersionFilesOutputVariable
NAME ${PROJECT_NAME}
VERSION_MAJOR 0
VERSION_MINOR 0
VERSION_PATCH 0
VERSION_REVISION 1
COMPANY_NAME "ALPI"
FILE_DESCRIPTION "Librairie ${PROJECT_NAME}.dll"
)
endif(MSVC)
[...]
add_library(${PROJECT_NAME} SHARED
${SRC_FILES}
${VersionFilesOutputVariable}
)
[...]
Have you encounter similary problems ?
Thanks for help.
Hi! No, I didn't encounter similar problems before.
I googled for CVT1100 error and found this link useful. It stated that you have duplicated resource (type:type, name:name, language:language, flags:flags, size:size).
Please, try to log ${VersionFilesOutputVariable} to see what it contains?
Do you use generate_product_version once per one CMakeLists.txt or multiple times?
Yes I've already seen this link.
Here is how I use in each CMakeLists your script :
cmake_minimum_required(VERSION 2.8)
cmake_policy(VERSION 2.8)
# ------------------------- End of Generic CMake Variable Logging ------------------
############################### GRAPHS ###############################
#Configuration de graphs.dll
set(PROJECT_NAME graphs)
get_filename_component(COREALPI_DIR "../../../../.." ABSOLUTE)
set(SOURCE_BASE_DIR "${COREALPI_DIR}/core/plugins/graphs")
option(TEST_ENABLED
"###### Tests Unitaires Graphs ######"
OFF
)
option(BUILD_DEPENDS
"Construction des dépendances de Corealpi"
ON
)
message("graphs/CMAKE_BINARY_DIR = ${CMAKE_BINARY_DIR}")
project(${PROJECT_NAME} CXX)
add_definitions(
-DGRAPHS_EXPORTS
-DUNICODE
-D_UNICODE
)
if (NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-write-strings -Wno-parentheses -Wno-multichar")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
endif(NOT MSVC)
include_directories(BEFORE "${COREALPI_DIR}/external/lemon/latest/")
include_directories(AFTER "${CMAKE_BINARY_DIR}/lemon/latest")
# Fichiers de la librairie
file(GLOB SRC_FILES
${SOURCE_BASE_DIR}/src/*.cpp
${SOURCE_BASE_DIR}/src/*.h
)
# Versionnement et Description
if(MSVC)
include(${COREALPI_DIR}/platform/cmake/common/generate_product_version.cmake)
generate_product_version(
VersionFilesOutputVariable
NAME ${PROJECT_NAME}
VERSION_MAJOR 0
VERSION_MINOR 0
VERSION_PATCH 0
VERSION_REVISION 1
COMPANY_NAME "ALPI"
FILE_DESCRIPTION "Librairie ${PROJECT_NAME}.dll"
)
endif(MSVC)
# Flags
if (MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /D_UNICODE /D_CRT_NONSTDC_NO_DEPRECATE /D_USRDLL /DGRAPHS_EXPORTS /DUNICODE /sdl")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /GL /Oi /Gy /GR- /Gm-")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /GS /Zi /Gm /Od /WX- /GR- /Gd /Oy- /MDd /EHsc")
#set_source_files_properties(../core/src/stdafx.cpp PROPERTIES COMPILE_FLAGS "/Ycstdafx.h")
endif (MSVC)
# Dépendances
set(CORE_BASE_DIR "../../../core")
add_subdirectory(${COREALPI_DIR}/external/lemon/platform/cmake ${CMAKE_BINARY_DIR}/lemon)
if(BUILD_DEPENDS)
add_subdirectory(${CORE_BASE_DIR} ${CMAKE_BINARY_DIR}/core)
else()
link_directories(${COREALPI_DIR}/dependencies/core/build/${CMAKE_BUILD_TYPE})
endif()
message(WARNING "------- Version Output Variable = ${VersionFilesOutputVariable} -------------")
add_library(${PROJECT_NAME} SHARED
${SRC_FILES}
${VersionFilesOutputVariable}
)
target_link_libraries(graphs core lemon)
And here is output when I try to compile 2 dll with it :
[...]
CMake Warning at ../../CMakeLists.txt:60 (message):
------- Version Output Variable =
D:/Developpement/repos/corealpi/build/elec/VersionInfo.h;D:/Developpement/repos/corealpi/build/elec/VersionResource.rc;D:/Developpement/repos/corealpi/build/elec/core/VersionInfo.h;D:/Developpement/repos/corealpi/build/elec/core/VersionResource.rc
-------------
[...]
CMake Warning at CMakeLists.txt:79 (message):
------- Version Output Variable =
D:/Developpement/repos/corealpi/build/elec/VersionInfo.h;D:/Developpement/repos/corealpi/build/elec/VersionResource.rc
-------------
Effectively, I can see /Developpement/repos/corealpi/build/elec/VersionResource.rc two times...
Is the problem may be there?
How I can solve this ?
Shown CMakeLists.txt looks fine. But where is definition of second dll which you try to compile? What does "../../CMakeLists.txt" file contains ? Not enough information for me.
I suppose, it is most likely you call generate_product_version() macro twice in one CMakeLists file. This is not supported scenario for now. To solve you should call generate_product_version() once per one CMakeLists file.