Failed to build Boost.Build engine - c++

I was trying to build boost (1_65_0) engine by writing 'bootstrap' to visual studio command prompt 2010 and I go this error.. any suggestions?
here is a part of the bootstrap.log :
###
### Using 'vc10' toolset.
###
c:\boost_1_65_0\tools\build\src\engine>if exist bootstrap rd /S /Q bootstrap
c:\boost_1_65_0\tools\build\src\engine>md bootstrap
c:\boost_1_65_0\tools\build\src\engine>cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib /Febootstrap\jam0 command.c compile.c constants.c debug.c execcmd.c execnt.c filent.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathnt.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c class.c cwd.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c
command.c
compile.c
variable.c
modules.c
strings.c
strings.c(195) : error C2143: syntax error : missing ';' before 'type'
strings.c(196) : error C2065: 'p' : undeclared identifier
strings.c(196) : error C2065: 'p' : undeclared identifier
strings.c(196) : warning C4047: '>=' : 'int' differs in levels of indirection from 'char *'
strings.c(196) : error C2065: 'p' : undeclared identifier
strings.c(196) : error C2100: illegal indirection
strings.c(196) : error C2065: 'p' : undeclared identifier
strings.c(196) : error C2100: illegal indirection
strings.c(196) : error C2065: 'p' : undeclared identifier
strings.c(196) : error C2100: illegal indirection
strings.c(196) : error C2106: '=' :

Related

Flutter - problem with adding native dependency on Windows

I'm trying to build Flutter with native C++ dependency, but every time I try to add CMake subproject it fails due to a problem with creating a directory. It's probably something simple, but it's really hard to find any guide on how to add dependencies for the Windows platform, so I'm improvising (a lot).
Flutter Doctor summary:
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.22000.376], locale pl-PL)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.6)
[√] Android Studio (version 2020.3)
[√] IntelliJ IDEA Ultimate Edition (version 2021.2)
[√] VS Code (version 1.63.0)
[√] Connected device (3 available)
Steps to reproduce:
Create a new Flutter project with support for the Windows platform.
Copy library (e.g. DirectXText) into the project root folder.
Add the library in the [project]\windows\CMakeLists.txt by adding a subdirectory (add_subdirectory(../DirectXTex "${CMAKE_BINARY_DIR}/${PROJECT_NAME}_directxtex")):
cmake_minimum_required(VERSION 3.15)
project(stackoverflow_windows_question LANGUAGES CXX)
set(BINARY_NAME "stackoverflow_windows_question")
cmake_policy(SET CMP0063 NEW)
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
# Configure build options.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(IS_MULTICONFIG)
set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
CACHE STRING "" FORCE)
else()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug" CACHE
STRING "Flutter build mode" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Profile" "Release")
endif()
endif()
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
# Use Unicode for all projects.
add_definitions(-DUNICODE -D_UNICODE)
# Compilation settings that should be applied to most targets.
function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_features(${TARGET} PUBLIC cxx_std_17)
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
target_compile_options(${TARGET} PRIVATE /EHsc)
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
endfunction()
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
# Flutter library and tool build rules.
add_subdirectory(${FLUTTER_MANAGED_DIR})
# Application build
add_subdirectory("runner")
# Generated plugin build rules, which manage building the plugins and adding
# them to the application.
include(flutter/generated_plugins.cmake)
add_subdirectory(../DirectXTex "${CMAKE_BINARY_DIR}/${PROJECT_NAME}_directxtex") # NEW LINE
# === Installation ===
# Support files are copied into place next to the executable, so that it can
# run in place. This is done instead of making a separate bundle (as on Linux)
# so that building and running from within Visual Studio will work.
set(BUILD_BUNDLE_DIR "$<TARGET_FILE_DIR:${BINARY_NAME}>")
# Make the "install" step default, as it's required to run.
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
endif()
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime)
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
COMPONENT Runtime)
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
if(PLUGIN_BUNDLED_LIBRARIES)
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
endif()
# Fully re-copy the assets directory on each build to avoid having stale files
# from a previous install.
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
install(CODE "
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
" COMPONENT Runtime)
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
# Install the AOT library on non-Debug builds only.
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
CONFIGURATIONS Profile;Release
COMPONENT Runtime)
Try to build it in verbose mode:
flutter build windows -v
Wait for the build to fail:
[ +78 ms] PostBuildEvent:
[ ] setlocal
[ ] "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
[ ] if %errorlevel% neq 0 goto :cmEnd
[ ] :cmEnd
[ ] endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
[ ] :cmErrorLevel
[ ] exit /b %1
[ ] :cmDone
[ ] if %errorlevel% neq 0 goto :VCEnd
[ ] :VCEnd
[ +83 ms] -- Install configuration: "Release"
[ +1 ms] CMake Error at stackoverflow_windows_question_directxtex/cmake_install.cmake:41 (file):
[ ] file cannot create directory:
[ ] C:/Users/jbili/Documents/Flutter-Projects/stackoverflow_windows_question/build/windows/$<TARGET_FILE_DIR:stackoverflow_windows_question>/lib.
[ ] Maybe need administrative privileges.
[ ] Call Stack (most recent call first):
[ ] cmake_install.cmake:47 (include)
[ +7 ms] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: Polecenie „setlocal [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ +1 ms] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P
cmake_install.cmake [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmEnd [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmErrorLevel [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: exit /b %1 [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmDone [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :VCEnd” zostało zakończone przez kod 1. [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] Kompilowanie projektu „C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj” wykonane (domyślne elementy docelowe) — NIEPOWODZENIE.
[ ] Kompilacja NIE POWIODŁA SIĘ.
[ ] „C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj” (domyślny element docelowy) (1)->
[ ] (element docelowy PostBuildEvent) ->
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: Polecenie „setlocal [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P
cmake_install.cmake [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmEnd [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmErrorLevel [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: exit /b %1 [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmDone [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :VCEnd” zostało zakończone przez kod 1. [C:\Users\jbili\Documents\Flutter-Projects\stackoverflow_windows_question\build\windows\INSTALL.vcxproj]
[ ] Ostrzeżenia: 0
[ ] Liczba błędów: 1
[ ] Czas, który upłynął: 00:00:41.72
[ +12 ms] Building Windows application... (completed in 44,1s)
[ ] "flutter windows" took 44 278ms.
[ +2 ms] Build process failed.
[ ]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _runBuild (package:flutter_tools/src/windows/build_windows.dart:299:5)
<asynchronous suspension>
#2 buildWindows (package:flutter_tools/src/windows/build_windows.dart:78:5)
<asynchronous suspension>
#3 BuildWindowsCommand.runCommand (package:flutter_tools/src/commands/build_windows.dart:55:5)
<asynchronous suspension>
#4 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
<asynchronous suspension>
#5 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
<asynchronous suspension>
#8 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#9 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
<asynchronous suspension>
#10 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#11 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#12 main (package:flutter_tools/executable.dart:92:3)
<asynchronous suspension>
[ +69 ms] ensureAnalyticsSent: 68ms
[ ] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 1
As you can see it fails, because it can't create directory C:/Users/jbili/Documents/Flutter-Projects/stackoverflow_windows_question/build/windows/$<TARGET_FILE_DIR:stackoverflow_windows_question>/lib, because the directory path looks incorrectly. I think that $<TARGET_FILE_DIR:stackoverflow_windows_question> has not been converted at some point by CMake, but I don't know why.
Could you help me solve this problem?
I'm not sure, but Have you tried to run the script using Admin privileges, this may solve your problem because the error said "Maybe need administrative privileges."

CMake include external and own headers

I have a CMakelist.txt where i add external header files and lib. files for my build.
Now when I call custom headers ("myown.h") in my main function I get errors when running CMake linking.
So I found out that I have to add my own headers and .cpp to a library with add_library and then add them under target_link_libraries.
However I get a link error while building as long as I want to call the code from my own header.
Does anyone have an idea where the error is or how I can continue?
Here is my CMakelist:
cmake_minimum_required(VERSION 3.0.0)
project(MIELE_OCULUS VERSION 0.1.0)
#Hier weden die include files gefunden
INCLUDE_DIRECTORIES(
C:/Projekte/Cpp/dev/vcpkg/installed/x64-windows/include
)
#Hier werden die lib files gefunden
LINK_DIRECTORIES(
C:/Projekte/Cpp/dev/vcpkg/installed/x64-windows/lib,
C:/Program Files (x86)/Windows Kits/10/Lib/10.0.19041.0/um/x64
)
add_library(
test
testclass.h
testclass.cpp
)
add_executable(MIELE_OCULUS
main.cpp
)
TARGET_LINK_LIBRARIES(MIELE_OCULUS
cpprest_2_10
WS2_32
test
)
UPDATE:
With these changes in CMakelist.txt you can build the program, but after changing the src code or cleaning up the CMake project, linking errors will occur again.
changed CMakelist:
cmake_minimum_required(VERSION 3.0.0)
project(MIELE_OCULUS VERSION 0.1.0)
add_library(
mylib
includes/mylib/testclass.h
includes/mylib/testclass.cpp
)
#Hier weden die include files gefunden
TARGET_INCLUDE_DIRECTORIES(mylib PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib>
$<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib
)
INCLUDE_DIRECTORIES(
C:/Projekte/Cpp/dev/vcpkg/installed/x64-windows/include
C:/Projekte/Cpp/dev/Miele_Oculus
)
#Hier werden die lib files gefunden
LINK_DIRECTORIES(
C:/Projekte/Cpp/dev/vcpkg/installed/x64-windows/lib
C:/Program Files (x86)/Windows Kits/10/Lib/10.0.19041.0/um/x64
)
add_executable(MIELE_OCULUS
main.cpp
)
TARGET_LINK_LIBRARIES(MIELE_OCULUS
cpprest_2_10
WS2_32
mylib
)
Here is the verbose output:
Der Buildvorgang wurde am 01.11.2020 16:19:04 gestartet.
Projekt "C:\Projekte\Cpp\dev\Miele_Oculus\build\ALL_BUILD.vcxproj" auf Knoten "1" (Standardziele).
Das Projekt "C:\Projekte\Cpp\dev\Miele_Oculus\build\ALL_BUILD.vcxproj" (1) erstellt "C:\Projekte\Cpp\dev\Miele_Oculus\b
uild\ZERO_CHECK.vcxproj" (2) auf Knoten "1" (Standardziele).
InitializeBuildStatus:
"x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" wird erstellt, da "AlwaysCreate" angegeben wurde.
CustomBuild:
Alle Ausgaben sind aktuell.
FinalizeBuildStatus:
Die Datei "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" wird gelöscht.
Aktualisieren des Timestamps von "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Die Erstellung von Projekt "C:\Projekte\Cpp\dev\Miele_Oculus\build\ZERO_CHECK.vcxproj" ist abgeschlossen (Standardziele
).
Das Projekt "C:\Projekte\Cpp\dev\Miele_Oculus\build\ALL_BUILD.vcxproj" (1) erstellt "C:\Projekte\Cpp\dev\Miele_Oculus\b
uild\MIELE_OCULUS.vcxproj" (3) auf Knoten "1" (Standardziele).
Das Projekt "C:\Projekte\Cpp\dev\Miele_Oculus\build\MIELE_OCULUS.vcxproj" (3) erstellt "C:\Projekte\Cpp\dev\Miele_Oculu
s\build\mylib.vcxproj" (4) auf Knoten "1" (Standardziele).
InitializeBuildStatus:
"mylib.dir\Debug\mylib.tlog\unsuccessfulbuild" wird erstellt, da "AlwaysCreate" angegeben wurde.
CustomBuild:
Alle Ausgaben sind aktuell.
VcpkgTripletSelection:
Using triplet "x64-windows" from "C:\Projekte\Cpp\dev\vcpkg\installed\x64-windows"
ClCompile:
Alle Ausgaben sind aktuell.
Lib:
Alle Ausgaben sind aktuell.
mylib.vcxproj -> C:\Projekte\Cpp\dev\Miele_Oculus\build\Debug\mylib.lib
AppLocalFromInstalled:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -noprofile -File "C:\Projekte\Cpp\d
ev\vcpkg\scripts\buildsystems\msbuild\applocal.ps1" "C:\Projekte\Cpp\dev\Miele_Oculus\build\Debug\mylib.lib" "C:\Proj
ekte\Cpp\dev\vcpkg\installed\x64-windows\debug\bin" "mylib.dir\Debug\mylib.tlog\mylib.write.1u.tlog" "mylib.dir\Debug
\vcpkg.applocal.log"
FinalizeBuildStatus:
Die Datei "mylib.dir\Debug\mylib.tlog\unsuccessfulbuild" wird gelöscht.
Aktualisieren des Timestamps von "mylib.dir\Debug\mylib.tlog\mylib.lastbuildstate".
Die Erstellung von Projekt "C:\Projekte\Cpp\dev\Miele_Oculus\build\mylib.vcxproj" ist abgeschlossen (Standardziele).
InitializeBuildStatus:
Aktualisieren des Timestamps von "MIELE_OCULUS.dir\Debug\MIELE_OCULUS.tlog\unsuccessfulbuild".
CustomBuild:
Alle Ausgaben sind aktuell.
VcpkgTripletSelection:
Using triplet "x64-windows" from "C:\Projekte\Cpp\dev\vcpkg\installed\x64-windows"
ClCompile:
Alle Ausgaben sind aktuell.
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\link.exe /ERR
ORREPORT:QUEUE /OUT:"C:\Projekte\Cpp\dev\Miele_Oculus\build\Debug\MIELE_OCULUS.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:
/Projekte/Cpp/dev/vcpkg/installed/x64-windows/lib" /LIBPATH:"C:/Projekte/Cpp/dev/vcpkg/installed/x64-windows/lib/Debu
g" /LIBPATH:C:/Program /LIBPATH:C:/Program/Debug /LIBPATH:C:/Projekte/Cpp/dev/Miele_Oculus/Files /LIBPATH:C:/Projekte
/Cpp/dev/Miele_Oculus/Files/Debug /LIBPATH:"C:/Projekte/Cpp/dev/Miele_Oculus/(" /LIBPATH:"C:/Projekte/Cpp/dev/Miele_O
culus/(/Debug" /LIBPATH:C:/Projekte/Cpp/dev/Miele_Oculus/x86 /LIBPATH:C:/Projekte/Cpp/dev/Miele_Oculus/x86/Debug /LIB
PATH:"C:/Projekte/Cpp/dev/Miele_Oculus/)" /LIBPATH:"C:/Projekte/Cpp/dev/Miele_Oculus/)/Debug" /LIBPATH:/Windows /LIBP
ATH:/Windows/Debug /LIBPATH:C:/Projekte/Cpp/dev/Miele_Oculus/Kits/10/Lib/10.0.19041.0/um/x64 /LIBPATH:C:/Projekte/Cpp
/dev/Miele_Oculus/Kits/10/Lib/10.0.19041.0/um/x64/Debug /LIBPATH:"C:\Projekte\Cpp\dev\vcpkg\installed\x64-windows\deb
ug\lib" /LIBPATH:"C:\Projekte\Cpp\dev\vcpkg\installed\x64-windows\debug\lib\manual-link" cpprest_2_10.lib WS2_32.lib
Debug\mylib.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.l
ib advapi32.lib "C:\Projekte\Cpp\dev\vcpkg\installed\x64-windows\debug\lib*.lib" /MANIFEST /MANIFESTUAC:"level='asIn
voker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:/Projekte/Cpp/dev/Miele_Oculus/build/Debug/MIELE_OCULUS.pdb"
/SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Projekte/Cpp/dev/Miele_Oculus/build/Debug/MIELE_OCULUS
.lib" /MACHINE:X64 /machine:x64 MIELE_OCULUS.dir\Debug\main.obj
LINK : fatal error LNK1104: Datei "C:\Projekte\Cpp\dev\Miele_Oculus\build\Debug\MIELE_OCULUS.exe" kann nicht geöffnet w
erden. [C:\Projekte\Cpp\dev\Miele_Oculus\build\MIELE_OCULUS.vcxproj]
Die Erstellung des Projekts "C:\Projekte\Cpp\dev\Miele_Oculus\build\MIELE_OCULUS.vcxproj" ist abgeschlossen (Standardzi
ele) -- FEHLER.
Die Erstellung des Projekts "C:\Projekte\Cpp\dev\Miele_Oculus\build\ALL_BUILD.vcxproj" ist abgeschlossen (Standardziele
) -- FEHLER.
Fehler beim Buildvorgang.
"C:\Projekte\Cpp\dev\Miele_Oculus\build\ALL_BUILD.vcxproj" (Standardziel) (1) ->
"C:\Projekte\Cpp\dev\Miele_Oculus\build\MIELE_OCULUS.vcxproj" (Standardziel) (3) ->
(Link Ziel) ->
LINK : fatal error LNK1104: Datei "C:\Projekte\Cpp\dev\Miele_Oculus\build\Debug\MIELE_OCULUS.exe" kann nicht geöffnet
werden. [C:\Projekte\Cpp\dev\Miele_Oculus\build\MIELE_OCULUS.vcxproj]
0 Warnung(en)
1 Fehler
Verstrichene Zeit 00:00:00.90
Now it works
1:
Adding a header into add_library call doesn't add include directories for the header.
You need to add these directories manually, with INCLUDE_DIRECTORIES or
TARGET_INCLUDE_DIRECTORIES
I added this part:
#Eigene header Dateien include
TARGET_INCLUDE_DIRECTORIES(mylib PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/includes/mylib>
$<INSTALL_INTERFACE:includes/mylib> # <prefix>/includes/mylib
Thanks a lot to Tsyvarev ! :)
2:
The "strange" behavoir was a bad mistake from me, cause I didnt known that i delete the output terminal in windows bevor i start a new build in the command window
Thank you guys!

Post build event error when building project.sln with CMake

I've been tasked with converting and building a large framework into a CMake tree and binary. Currently, the framework is built using VS 2017, creating a solution named Framework_static_vc15.sln. As this is a large project, I opted to use a converter to create the CMakeLists.txt files for each part of this project. Here is the link to the converter I used.
https://cmakeconverter.readthedocs.io/en/develop/intro.html
This converter successfully creates all the text files needed, and I can run the command
cmake -S . -B build
To create a directory that I should be able to run cmake --build build on.
However, when I run the above command, the build fails every time with the following error
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: The command "setlocal [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc15.vcx
proj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: cd C:\Work\SVN\Software\Framework\Source\UeiDaqCore [C:\Work\SVN\Software\Framework\build\Source\
UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqC
ore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: C: [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqC
ore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: if not exist ..\..\CPP\lib mkdir ..\..\CPP\lib [C:\Work\SVN\Software\Framework\build\Source\UeiDa
qCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqC
ore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: copy C:\Work\SVN\Software\Framework\Source\UeiDaqCore\..\..\Output\Win32\vs15_DebugUeiDaqvc15SD.l
ib ..\..\CPP\lib [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqC
ore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: cd. [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqC
ore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: cd. [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqC
ore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: :cmEnd [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\Work\SVN\Software\Framework\build\S
ource\UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: :cmErrorLevel [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: exit /b %1 [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: :cmDone [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqC
ore_vc15.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1
38,5): error MSB3073: :VCEnd" exited with code 1. [C:\Work\SVN\Software\Framework\build\Source\UeiDaqCore\UeiDaqCore_vc
15.vcxproj]
This error is from a post build event inside a sub-project named UeiDaqCore, that arises when CMake tries to execute the following command UeiDaqCore_vc15.vcxproj -> C:\Work\SVN\Software\Framework\Output\Win32\vs15_Debug\UeiDaqCore_vc15SD.lib. CMake gives me the error list without all the paths, and here it is.
PostBuildEvent:
setlocal
cd C:\Work\SVN\Software\Framework\Source\UeiDaqCore
if %errorlevel% neq 0 goto :cmEnd
C:
if %errorlevel% neq 0 goto :cmEnd
if not exist ..\..\CPP\lib mkdir ..\..\CPP\lib
if %errorlevel% neq 0 goto :cmEnd
copy C:\Work\SVN\Software\Framework\Source\UeiDaqCore\..\..\Output\Win32\vs15_DebugUeiDaqvc15SD.lib ..\..\CPP\lib
if %errorlevel% neq 0 goto :cmEnd
cd.
if %errorlevel% neq 0 goto :cmEnd
cd.
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd
The system cannot find the file specified.
I looked through the Visual Studio UeiDaqCore project file for post build events named setlocal, and I also looked through the CmakeLists.txt files for setlocal post build events, but could find none.
From the error text, it looks like it's looking for a project named UeiDaqCore_vc15.vcxproj and a file named UeiDaqCore_vc15SD.lib, but cant find it. I'm not sure why, because both files are located in the folder its looking in.
I am running CMake with the administrator command prompt, as I've seen others who have had this problem, and it was caused by no admin privileges. Below this, I'll post the full CmakeLists.txt for the UeiDaqCore subproject.
project(UeiDaqCore_vc15 CXX)
################################################################################
# Source groups
################################################################################
set(no_group_source_files
ReadMe.txt
)
source_group("" FILES ${no_group_source_files})
set(Headers
../../CPP/include/UeiChannel.h
../../CPP/include/UeiConstants.h
../../CPP/include/UeiCustomScale.h
../../CPP/include/UeiDaq.h
../../CPP/include/UeiDaqAnsiC.h
../../CPP/include/UeiDaqError.h
../../CPP/include/UeiDataStream.h
../../CPP/include/UeiDevice.h
../../CPP/include/UeiDeviceEnumerator.h
../../CPP/include/UeiDriverEnumerator.h
../../CPP/include/UeiEvent.h
../../CPP/include/UeiException.h
../../CPP/include/UeiFrameUtils.h
../../CPP/include/UeiMessaging.h
../../CPP/include/UeiObject.h
../../CPP/include/UeiReader.h
../../CPP/include/UeiResourceParser.h
../../CPP/include/UeiSession.h
../../CPP/include/UeiSessionGroup.h
../../CPP/include/UeiStructs.h
../../CPP/include/Ueisystem.h
../../CPP/include/UeiTiming.h
../../CPP/include/UeiTrigger.h
../../CPP/include/UeiWriter.h
pugxml.h
resource.h
ResourceParser.h
SensorConversion.h
SignalParser.h
StdAfx.h
UeiAnsiCSession.h
UeiChannelimpl.h
UeiCJCConverter.h
UeiDaqCore.h
UeiDaqCoreVer.h
UeiDaqDriver.h
UeiDaqDriverSession.h
UeiDaqLV.h
UeiDataStreamImpl.h
UeiDeviceEnumeratorImpl.h
UeiDeviceImpl.h
UeiDriverEvent.h
UeiMessagingImpl.h
UeiObjectImpl.h
UeiReaderImpl.h
UeiRTDConverter.h
UeiSessionImpl.h
UeiSessionSettings.h
UeiTimingImpl.h
UeiTriggerImpl.h
UeiWriterImpl.h
UeiXmlParser.h
)
source_group("Headers" FILES ${Headers})
set(Sources
ResourceParser.cpp
SensorConversion.cpp
StdAfx.cpp
UeiChannel.cpp
UeiChannelImpl.cpp
UeiCJCConverter.cpp
UeiCustomScale.cpp
UeiDaqAnsiC.cpp
UeiDaqCore.cpp
UeiDaqLV.cpp
UeiDataStream.cpp
UeiDataStreamImpl.cpp
UeiDevice.cpp
UeiDeviceEnumerator.cpp
UeiDeviceEnumeratorImpl.cpp
UeiDeviceImpl.cpp
UeiDriverEnumerator.cpp
UeiException.cpp
UeiFrameUtils.cpp
UeiMessaging.cpp
UeiMessagingImpl.cpp
UeiObject.cpp
UeiObjectImpl.cpp
UeiReader.cpp
UeiReaderImpl.cpp
UeiResourceParser.cpp
UeiRTDConverter.cpp
UeiSession.cpp
UeiSessionGroup.cpp
UeiSessionImpl.cpp
UeiSessionSettings.cpp
UeiSystem.cpp
UeiTiming.cpp
UeiTimingImpl.cpp
UeiTrigger.cpp
UeiTriggerImpl.cpp
UeiWriter.cpp
UeiWriterImpl.cpp
UeiXmlParser.cpp
)
source_group("Sources" FILES ${Sources})
set(ALL_FILES
${no_group_source_files}
${Headers}
${Sources}
)
################################################################################
# Target
################################################################################
add_library(${PROJECT_NAME} STATIC ${ALL_FILES})
add_precompiled_header(${PROJECT_NAME} "StdAfx.h" "StdAfx.cpp")
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
set(ROOT_NAMESPACE UeiDaqCore)
################################################################################
# Target name
################################################################################
set_target_properties(${PROJECT_NAME} PROPERTIES
TARGET_NAME_DEBUG "${PROJECT_NAME}SD"
TARGET_NAME_RELEASE "${PROJECT_NAME}S"
)
################################################################################
# Output directory
################################################################################
set_target_properties(${PROJECT_NAME} PROPERTIES
OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/../../Output/${CMAKE_VS_PLATFORM_NAME}/vs15_$<CONFIG>"
OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/../../Output/${CMAKE_VS_PLATFORM_NAME}/vs15_$<CONFIG>"
)
################################################################################
# Include directories
################################################################################
target_include_directories(${PROJECT_NAME} PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/../../CPP/include;"
"$ENV{UEICOMMON}/includes"
)
################################################################################
# Compile definitions
################################################################################
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"_DEBUG;"
"UEIDAQ_DEBUG"
">"
"$<$<CONFIG:Release>:"
"NDEBUG"
">"
"WIN32;"
"_WINDOWS;"
"UEIDAQSTATIC;"
"__MSWINDOWS__;"
"_MBCS"
)
set_source_files_properties(ResourceParser.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(StdAfx.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;UEIDAQSTATIC"
)
set_source_files_properties(UeiChannel.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiChannelImpl.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiDaqCore.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiDataStream.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiDataStreamImpl.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiDevice.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiDeviceEnumerator.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiDeviceEnumeratorImpl.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiDeviceImpl.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiException.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiObject.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiObjectImpl.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiSession.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiSessionGroup.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiSessionImpl.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiTiming.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiTimingImpl.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiTrigger.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
set_source_files_properties(UeiTriggerImpl.cpp PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG"
COMPILE_DEFINITIONS_RELEASE "NDEBUG"
COMPILE_DEFINITIONS "WIN32;_WINDOWS;_MBCS;_USRDLL;UEIDAQCORE_EXPORTS"
)
################################################################################
# Compile and link options
################################################################################
if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Debug>:
/Od;
/RTC1;
/MTd
>
$<$<CONFIG:Release>:
/O2;
/Ob1;
/GF;
/MT;
/Gy
>
/W3;
/nologo;
/Zi;
/GR;
${DEFAULT_CXX_EXCEPTION_HANDLING}
)
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(ResourceParser.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(StdAfx.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiChannel.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiChannelImpl.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiDaqCore.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiDataStream.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiDataStreamImpl.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiDevice.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiDeviceEnumerator.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiDeviceEnumeratorImpl.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiDeviceImpl.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiException.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiObject.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiObjectImpl.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiSession.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiSessionGroup.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiSessionImpl.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiTiming.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiTimingImpl.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiTrigger.cpp ${FILE_CL_OPTIONS})
string(CONCAT FILE_CL_OPTIONS
"$<$<CONFIG:Debug>:"
"/Od;/RTC1"
">"
"$<$<CONFIG:Release>:"
"/O2"
">"
)
source_file_compile_options(UeiTriggerImpl.cpp ${FILE_CL_OPTIONS})
endif()
################################################################################
# Post build events
################################################################################
add_custom_command_if(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMANDS
COMMAND $<CONFIG:Debug> if not exist ..\\..\\CPP\\lib mkdir ..\\..\\CPP\\lib
COMMAND $<CONFIG:Debug> copy $<SHELL_PATH:${OUTPUT_DIRECTORY}>UeiDaqvc15SD.lib ..\\..\\CPP\\lib
COMMAND $<CONFIG:Release> if not exist ..\\..\\CPP\\lib mkdir ..\\..\\CPP\\lib
COMMAND $<CONFIG:Release> copy $<SHELL_PATH:${OUTPUT_DIRECTORY}>UeiDaqvc15S.lib ..\\..\\CPP\\lib
)
################################################################################
# Dependencies
################################################################################
add_dependencies(${PROJECT_NAME}
UeiPDNADriver_vc15
UeiSimuDriver_vc15
)
# Link with other targets.
target_link_libraries(${PROJECT_NAME} PUBLIC
UeiPDNADriver_vc15
UeiSimuDriver_vc15
)
I'm quite new to CMake, and any help towards a possible solution would be appreciated.
EDIT: Here are the post build events for UeiDaqCore copied directly from the Visual Studio window.
copy "$(SolutionDir)\Output\$(Platform)\vs15_$(Configuration)\UeiDaqvc15D.dll" "$(SystemRoot)\System32"
if not exist ..\..\CPP\lib mkdir ..\..\CPP\lib
copy "$(SolutionDir)\Output\$(Platform)\vs15_$(Configuration)\UeiDaqvc15D.lib" ..\..\CPP\lib
It looks like the POST_BUILD custom command is malformed. Specifically, the copy command is not putting a path separator between the defined OUTPUT_DIRECTORY:
C:\Work\SVN\Software\Framework\Source\UeiDaqCore\..\..\Output\Win32\vs15_Debug
from the file name:
UeiDaqvc15SD.lib
So they get (mistakenly) concatenated:
C:\Work\SVN\Software\Framework\Source\UeiDaqCore\..\..\Output\Win32\vs15_DebugUeiDaqvc15SD.lib
Try adding path separators \\ in the custom command after $<SHELL_PATH:${OUTPUT_DIRECTORY}>:
add_custom_command_if(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMANDS
COMMAND $<CONFIG:Debug> if not exist ..\\..\\CPP\\lib mkdir ..\\..\\CPP\\lib
COMMAND $<CONFIG:Debug> copy $<SHELL_PATH:${OUTPUT_DIRECTORY}>\\UeiDaqvc15SD.lib ..\\..\\CPP\\lib
COMMAND $<CONFIG:Release> if not exist ..\\..\\CPP\\lib mkdir ..\\..\\CPP\\lib
COMMAND $<CONFIG:Release> copy $<SHELL_PATH:${OUTPUT_DIRECTORY}>\\UeiDaqvc15S.lib ..\\..\\CPP\\lib
)

Building Boost library on windows 8 using CodeBlocks

I am trying to install and build Boost libraries on my laptop which runs Windows 8 and CodeBlocks. I am following the steps described in most of the guides that I found on web to no extent.
I downloaded boost 1.57.0 from boost.org and I extracted the library to C:/. From the root library, I run bootstrap.bat gcc and I keep obtaining a Failed to build Boost.Build engine.
The following is the content of bootstrap.log
###
### Using 'gcc' toolset.
###
c:\Boost\boost_1_57_0\tools\build\src\engine>if exist bootstrap rd /S /Q bootstrap
c:\Boost\boost_1_57_0\tools\build\src\engine>md bootstrap
c:\Boost\boost_1_57_0\tools\build\src\engine>gcc -DNT -o bootstrap\jam0.exe command.c compile.c constants.c debug.c execcmd.c execnt.c filent.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathnt.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c class.c cwd.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c
I cannot understand what is causing the error since the .log doesn't say anything about it. Do you have any idea?

compiling C++ program- link error

I'm trying to modify oclvanitygen [link], and I've done some of that. Now I need to test it, but I'm having trouble compiling it on Windows 7. I'm using the VS Command Prompt in VC++ 2010 Express to run a makefile. The relevant parts of the makefile, as modified by me:
CC = cl
OPENSSL_DIR = [Working Dir]\openssl
PTHREADS_DIR = [Working Dir]\pthread
PCRE_DIR = [Working Dir]\pcre
CURL_DIR = C:\curl-7.26.0-x86\builds\libcurl-release-static-ssl-static-ipv6-sspi
OPENCL_DIR = [Working Dir]\openCL
OPENCL_INCLUDE = /I$(OPENCL_DIR)\include
OPENCL_LIBS = $(OPENCL_DIR)\OpenCL.lib
CURL_INCLUDE = /I$(CURL_DIR)\include /DCURL_STATICLIB
CURL_LIBS = $(CURL_DIR)\lib\libcurl_a.lib
CFLAGS_BASE = /D_WIN32 /DPTW32_STATIC_LIB /DPCRE_STATIC /I$(OPENSSL_DIR)\inc32 /I$(PTHREADS_DIR) /I$(PCRE_DIR) /Ox /Zi
CFLAGS = $(CFLAGS_BASE) /GL
LIBS = $(OPENSSL_DIR)\out32\libeay32.lib $(PTHREADS_DIR)\pthreadVC2.lib $(PCRE_DIR)\pcre.lib ws2_32.lib user32.lib advapi32.lib gdi32.lib /LTCG /DEBUG
OBJS = vanitygen.obj oclvanitygen.obj oclengine.obj oclvanityminer.obj keyconv.obj pattern.obj util.obj winglue.obj
all: vanitygen.exe keyconv.exe
vanitygen.exe: vanitygen.obj pattern.obj util.obj winglue.obj
link /nologo /out:$# $** $(LIBS)
oclvanitygen.exe: oclvanitygen.obj oclengine.obj pattern.obj util.obj winglue.obj
link /nologo /out:$# $** $(LIBS) $(OPENCL_LIBS)
oclvanityminer.exe: oclvanityminer.obj oclengine.obj pattern.obj util.obj winglue.obj
link /nologo /out:$# $** $(LIBS) $(OPENCL_LIBS) $(CURL_LIBS)
keyconv.exe: keyconv.obj util.obj winglue.obj
link /nologo /out:$# $** $(LIBS)
.c.obj:
#$(CC) /nologo $(CFLAGS) /c /Tp$< /Fo$#
oclengine.obj: oclengine.c
#$(CC) /nologo $(CFLAGS_BASE) $(OPENCL_INCLUDE) /c /Tpoclengine.c /Fo$#
oclvanitygen.obj: oclvanitygen.c
#$(CC) /nologo $(CFLAGS_BASE) /c /Tpoclvanitygen.c /Fo$#
oclvanityminer.obj: oclvanityminer.c
#$(CC) /nologo $(CFLAGS_BASE) $(CURL_INCLUDE) /c /Tpoclvanityminer.c /Fo
clean:
del vanitygen.exe oclvanitygen.exe oclvanityminer.exe keyconv.exe $(OBJS)
Then I use the command
nmake /fmakefile.win32 oclvanitygen.exe
It fails with the following error:
link /nologo /out:oclvanitygen.exe oclvanitygen.obj oclengine.obj pattern.obj util.obj winglue.obj [Working Dir]\openssl\out32\libeay32.lib [Working Dir]\pthread\pthreadVC2.lib [Working Dir]\pcre\pcre.lib ws2_32.lib user32.lib advapi32.lib gdi32.lib [Working Dir]\openCL\OpenCL.lib /LTCG /DEBUG
LINK : fatal error LNK1117: syntax error in option ''
NMAKE: fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x45d'
What am I doing wrong? All of the header files and libs are in their correct places.