syoyo / tinydng

Header-only Tiny DNG/TIFF loader and writer in C++
MIT License
146 stars 30 forks source link

tinydng #including headers within custom namespace causes ambiguous declaration #6

Closed wkjarosz closed 6 years ago

wkjarosz commented 6 years ago

including other headers within your own tinydng namespace causes issues in the parent code. This declares functions outside of their expected scope, and causes ambiguous declaration issues. See for instance this appveyor build log:

https://ci.appveyor.com/project/wkjarosz/hdrview/build/1.0.152/job/f1bi9puchcrv9i4v

(search for "error" on the page)

Here #including some standard headers within the tinydng namespace means that on Windows, _wassert is now defined both within the global namespace and as tinydng::_wassert, and the compiler doesn't know which one to use.

All #includes should be moved to the global scope to avoid introducing functions into unexpected scope.

syoyo commented 6 years ago

Oops, stb_image.h was included inside tinydng namespace and it includes <assert.h> internally.

I have moved to global namespace in this commit https://github.com/syoyo/tinydngloader/commit/51986a3c4001de9e53e57ccab47a38da204214fd and it should resolve _wassert conflicts.

Could you please try again with the recent master?

wkjarosz commented 6 years ago

Seems to work now. Thanks!

syoyo commented 6 years ago

Thanks for reporting!