-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Compilation with Visual Studio (15.9.5) #1380
Conversation
With Visual Studio Community 2017 (15.9.5), namespace 'experimental' is present both in 'std' and 'DGtal' namespaces and it produces an error. Using 'std' namespace explicitly solves the problem.
On Windows 10, with Visual Studio Community 2017 (15.9.5), the file wingdi.h is included. This file alredy defines 'Arc' as a function. Thus Visual produces an error if 'Arc' is declared to define a type. Changing the typedef from 'Arc' to 'ArcT' solves the problem.
When compiling with Visual Studio (tested with 15.9.5), several io tests (testLongVol, testPNMReader, testVolReader, testCompressedVolWriter) fail if binary mode is not correctly set for iostreams. This commit makes these tests pass.
On Windows (with Visual Studio), the call to getline() may be found '\r' before '\n'. By restricting the header check to only two characters, we avoid this problem. This change makes testGenericReader and testGenericWriter pass.
Build functors passed to Composer functor explicitly. This change makes testPNMRawWriter pass (with Visual Studio).
Thx for the PR! |
@BorisMansencal it looks like some of the changes are also platfom compatibility related i.e., IO with binary. Am I right? If so, then this makes me think that even though we could have compiled the code on Windows before most likely it has not worked as predicted. I think we may still have some issues of such. |
Looks nice, thanks a lot. |
All good. Many thanks |
Thanks a lot for contributing to DGtal, before submitting your PR, please fill up the description and make sure that all checkboxes are checked. Please remove these lines in your PR.
PR Description
This PR makes code compile on Windows 10 (1809), with Visual Studio Community 17 (15.9.5).
It makes also the following tests pass :
testLongVol
testPNMReader
testVolReader
testGenericReader
testPNMRawWriter
testGenericWriter
The code compiles and tests pass on linux with gcc 8.2.1 and osx 10.13 with clang.
Checklist
cmake
mode (otherwise, Travis C.I. will fail).