Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #11462] Error compiling icinga2 targeted for x64 on Windows #4069

Closed
icinga-migration opened this issue Mar 28, 2016 · 7 comments
Labels
bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11462

Created by TheFlyingCorpse on 2016-03-28 18:55:57 +00:00

Assignee: gbeutner
Status: Closed (closed on 2016-03-31 09:53:39 +00:00)
Target Version: 2.4.5
Last Update: 2016-04-20 08:16:03 +00:00 (in Redmine)

Icinga Version: 2.4.4
Backport?: Already backported
Include in Changelog: 1

Errors while compiling when vcvarsall is set to x64 on windows:

"C:\test\icinga2\build64v2\PACKAGE.vcxproj" (default target) (1) ->
"C:\test\icinga2\build64v2\ALL_BUILD.vcxproj" (default target) (2) ->
"C:\test\icinga2\build64v2\lib\base\base.vcxproj" (default target) (4) ->
(ClCompile target) ->
  C:\test\icinga2\lib\base/objectlock.hpp(65): error C2664: 'LONG64 _InterlockedCompareExchange64(volatile LONG64 *,LON
G64,LONG64)': cannot convert argument 1 from 'uintptr_t *' to 'volatile LONG64 *' [C:\test\icinga2\build64v2\lib\base\b
ase.vcxproj]
  C:\test\icinga2\lib\base/objectlock.hpp(87): error C2664: 'LONG64 _InterlockedCompareExchange64(volatile LONG64 *,LON
G64,LONG64)': cannot convert argument 1 from 'uintptr_t *' to 'volatile LONG64 *' [C:\test\icinga2\build64v2\lib\base\b
ase.vcxproj]
  C:\test\icinga2\lib\base/objectlock.hpp(65): error C2664: 'LONG64 _InterlockedCompareExchange64(volatile LONG64 *,LON
G64,LONG64)': cannot convert argument 1 from 'uintptr_t *' to 'volatile LONG64 *' [C:\test\icinga2\build64v2\lib\base\b
ase.vcxproj]
  C:\test\icinga2\lib\base/objectlock.hpp(87): error C2664: 'LONG64 _InterlockedCompareExchange64(volatile LONG64 *,LON
G64,LONG64)': cannot convert argument 1 from 'uintptr_t *' to 'volatile LONG64 *' [C:\test\icinga2\build64v2\lib\base\b
ase.vcxproj]
  C:\test\icinga2\lib\base/string-script.cpp(110): error C2440: 'return': cannot convert from 'icinga::String::SizeType
' to 'icinga::Value' [C:\test\icinga2\build64v2\lib\base\base.vcxproj]

How environment was setup:

1. Install Visual Studio 2015 Express with GitHub modules
2. Install Chocolatey
3. Install via choco: notepadplusplus;winflexbison;7zip;cmake;make
4. Install OpenSSL 1.0.2g 64bit (to openssl dirs)
5. Install boost_1_60_0-msvc-14.0-64
6. Install postgresql-9.3.11-1-windows-x64.exe
7. Install nsis-2.50-setup.exe
8. Env: OPENSSL_ROOT_DIR = C:\OpenSSL-Win64
9. Env: PATH+ = C:\Program Files (x86)\CMake\bin
10. Rename choco's cpack as it conflicts with cmake's (for manual packaging) in C:\ProgramData\Chocolatey\bin

Commands to build:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
cd C:\test\icinga2
mkdir build
cd build
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../inst "-DPostgreSQL_ROOT=C:/Program Files/PostgreSQL/9.3" -DBOOST_ROOT=c:/local/boost_1_60_0 -DBOOST_LIBRARYDIR=c:/local/boost_1_60_0/lib64-msvc-14.0 -DICINGA2_UNITY_BUILD=ON -DFLEX_EXECUTABLE="C:/ProgramData/chocolatey/bin/win_flex.exe" -DBISON_EXECUTABLE="C:/ProgramData/chocolatey/bin/win_bison.exe" -DICINGA2_WITH_STUDIO=OFF -DICINGA2_WITH_MYSQL=OFF ..
cd ..
cmake --build build --target PACKAGE --config Release

Changesets

2016-03-29 05:54:41 +00:00 by (unknown) b863a84

Build fix for Win64

refs #11462

2016-03-29 06:42:02 +00:00 by (unknown) 7968843

Another build fix for Win64

refs #11462

2016-03-29 06:45:46 +00:00 by (unknown) 02ed668

Add /bigobj compiler option for Windows

refs #11462

2016-03-29 21:56:06 +00:00 by TheFlyingCorpse 26db63b

Add support for x64 Icinga2SetupAgent

refs #11462

2016-04-20 08:07:23 +00:00 by (unknown) 3c788f3

Build fix for Win64

refs #11462

2016-04-20 08:07:23 +00:00 by (unknown) 94deb03

Another build fix for Win64

refs #11462

2016-04-20 08:07:23 +00:00 by (unknown) e314bc1

Add /bigobj compiler option for Windows

refs #11462

2016-04-20 08:07:24 +00:00 by TheFlyingCorpse a65f5fa

Add support for x64 Icinga2SetupAgent

refs #11462
@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-03-29 05:55:27 +00:00

  • Category set to Installation
  • Status changed from New to Assigned
  • Assigned to set to gbeutner
  • Target Version set to 2.4.5

Try again please.

@icinga-migration
Copy link
Author

Updated by TheFlyingCorpse on 2016-03-29 06:08:07 +00:00

Now it managed to build both base.dll and config.dll, getting closer!

New errors:

"C:\test\icinga2-gio\icinga2\build\PACKAGE.vcxproj" (default target) (1) ->
"C:\test\icinga2-gio\icinga2\build\ALL_BUILD.vcxproj" (default target) (2) ->
"C:\test\icinga2-gio\icinga2\build\test\boosttest-test-base.vcxproj" (default target) (10) ->
"C:\test\icinga2-gio\icinga2\build\lib\icinga\icinga.vcxproj" (default target) (12) ->
"C:\test\icinga2-gio\icinga2\build\lib\remote\remote.vcxproj" (default target) (13) ->
(ClCompile target) ->
  C:\test\icinga2-gio\icinga2\lib\remote/apilistener.cpp(1057): error C2664: 'void icinga::Dictionary::Set(const icinga::String &,const icinga::Value &)': cannot convert argument 2 from 'size_t' to 'const icinga::Value &' [C:\test\icinga2-gio\icinga2\build\lib\remote\remote.vcxproj]
  C:\test\icinga2-gio\icinga2\lib\remote/apilistener.cpp(1058): error C2664: 'void icinga::Dictionary::Set(const icinga::String &,const icinga::Value &)': cannot convert argument 2 from 'size_t' to 'const icinga::Value &' [C:\test\icinga2-gio\icinga2\build\lib\remote\remote.vcxproj]


"C:\test\icinga2-gio\icinga2\build\PACKAGE.vcxproj" (default target) (1) ->
"C:\test\icinga2-gio\icinga2\build\ALL_BUILD.vcxproj" (default target) (2) ->
"C:\test\icinga2-gio\icinga2\agent\windows-setup-agent\Icinga2SetupAgent.csproj" (default target) (36) ->
(_CheckForInvalidConfigurationAndPlatform target) ->
  C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(723,5): error : The OutputPath property is not set for project 'Icinga2SetupAgent.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Release'  Platform='X64'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [C:\test\icinga2-gio\icinga2\agent\windows-setup-agent\Icinga2SetupAgent.csproj]

@icinga-migration
Copy link
Author

Updated by TheFlyingCorpse on 2016-03-29 06:50:35 +00:00

With the 3 fixes (/bigobj) it now works to compile icinga2 itself on windows.the Icinga2SetupAgent doesnt work, I can provide a patch for it later, tonight or tomorrow.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-03-29 06:51:06 +00:00

  • Assigned to changed from gbeutner to TheFlyingCorpse

@icinga-migration
Copy link
Author

Updated by TheFlyingCorpse on 2016-03-29 23:48:36 +00:00

Updated with target for Icinga2SetupAgent.
I cant seem to make the compiler respect the target of cmake, setting manually the "PLATFORM=x64" will ensure its being built as x64. Similarly, set "PLATFORM=Win32" to ensure its Win32 (32bit).

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-03-31 09:53:39 +00:00

  • Status changed from Assigned to Closed
  • Assigned to changed from TheFlyingCorpse to gbeutner
  • Done % changed from 0 to 100

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-04-20 08:16:03 +00:00

  • Backport? changed from Not yet backported to Already backported

@icinga-migration icinga-migration added bug Something isn't working Installation labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.4.5 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant