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

Compilation with Visual Studio (15.9.5) #1380

Merged
merged 8 commits into from
Jan 26, 2019

Conversation

BorisMansencal
Copy link
Contributor

@BorisMansencal BorisMansencal commented Jan 15, 2019

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

  • Unit-test of your feature with Catch.
  • Doxygen documentation of the code completed (classes, methods, types, members...)
  • Documentation module page added or updated.
  • New entry in the ChangeLog.md added.
  • No warning raised in Debug cmake mode (otherwise, Travis C.I. will fail).
  • [ x] All continuous integration tests pass (Travis & appveyor)

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).
@dcoeurjo dcoeurjo added this to Inbox in Issue triage via automation Jan 15, 2019
@dcoeurjo dcoeurjo added the Build label Jan 15, 2019
@dcoeurjo dcoeurjo added this to the 1.0 milestone Jan 15, 2019
@dcoeurjo
Copy link
Member

Thx for the PR!

@copyme
Copy link
Member

copyme commented Jan 16, 2019

@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.

@BorisMansencal
Copy link
Contributor Author

@copyme yes.
With this PR, all the IO tests are passing.
If some IO issues remain, they are not covered by the tests...

However, some other tests are still not passing when compiled with Visual Studio. See my issue #1381 for details.

@dcoeurjo
Copy link
Member

Looks nice, thanks a lot.
Could you please add an entry to the AUTHORS 🎉 ;) ?

@dcoeurjo
Copy link
Member

All good. Many thanks

@dcoeurjo dcoeurjo merged commit c17deb1 into DGtal-team:master Jan 26, 2019
Issue triage automation moved this from Inbox to Done Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issue triage
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants