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

Build fails with MSBuild #171

Closed
philomath213 opened this issue May 14, 2020 · 3 comments
Closed

Build fails with MSBuild #171

philomath213 opened this issue May 14, 2020 · 3 comments

Comments

@philomath213
Copy link

philomath213 commented May 14, 2020

I'm trying to build SEAL 3.5.1 with MSBuild on Windows in Powershell.
The build fails when I use the project file native\src\SEAL.vcxproj .

PS C:\Users\philomath213\SEAL> msbuild .\native\src\SEAL.vcxproj /p:configuration=Release /p:platform=x64
...
...
...
"C:\Users\philomath213\SEAL\native\src\SEAL.vcxproj" (default target) (1) ->
(ClCompile target) ->
  C:\Users\philomath213\SEAL\native\src\seal\util\ztools.cpp(16,10): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory [C:\Use
rs\philomath213\SEAL\native\src\SEAL.vcxproj]

    19 Warning(s)
    1 Error(s)

When I use the solution file SEAL.sln building the project SEAL.vcxproj pass and I can findthe library built in \lib\x64\Release\seal.lib
msbuild SEAL.sln /p:configuration=Release /p:platform=x64
but it continue the build the others projects (examples, test, dotnet, ....).

Anyway to build SEAL.vcxproj project only?

Edit:

You can find the logs here.

@WeiDaiWD
Copy link
Contributor

WeiDaiWD commented May 15, 2020

Thanks for your report. The reason is that SEAL.vcxproj uses ${SolutionDir} to define additional include directories. When building the project itself, this variable is not set, due to the missing solution. There are two solutions:

  1. Build the project with a SolutionDir argument: msbuild .\native\src\SEAL.vcxproj /p:configuration=Release /p:platform=x64 /p:SolutionDir=.\.
  2. Or replace all $(SolutionDir) in SEAL.vcxproj with $(ProjectDir)\..\...

Now you can build either a standalone project or the entire solution.

@philomath213
Copy link
Author

Thank you @WeiDaiWD for your answer.
The 1st solution works fine, while in the 2nd solution, the SolutionDir argument should be /p:SolutionDir=..\..\ since it will be passed as string and the relative path won't be resolved.

@WeiDaiWD
Copy link
Contributor

You are right. Fix 1 has been implemented internally. It will appear in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants