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 fails on VS2013 #64

Closed
blazeable opened this issue Apr 6, 2015 · 7 comments · Fixed by #65
Closed

Compilation fails on VS2013 #64

blazeable opened this issue Apr 6, 2015 · 7 comments · Fixed by #65

Comments

@blazeable
Copy link

I'm trying to compile the latest sources using VS2013 targeting x64, but I'm getting compilation errors in include/tins/internals.h. VS2013 doesn't like this template:
template <class T, class P, class=void>
struct accepts_type : std::false_type { };

template <class T, class P>
struct accepts_type<T, P,
typename std::enable_if<
std::is_same< decltype( std::declval<T>()(std::declval<P>()) ), bool>::value
>::type
> : std::true_type { };

Which would be a bug (or lack of support) in VS2013, as it compiles fine elsewhere.

However, I'm getting this even when configuring with LIBTINS_ENABLE_CXX11=0. It seems the TINS_IS_CXX11 definition in cxxstd.h does not check the HAVE_CXX11 macro from config.h.

@mfontanini
Copy link
Owner

That shouldn't happen if you set that option to 0. Remember that CMake
caches options, so if you set it to 1 and then to 0, it won't work. Have
you tried that on a clean compilstion?

As for the error. I'll see if there's any workarounds.

Thanks for the info.
On Apr 6, 2015 4:15 AM, "blazeable" notifications@github.com wrote:

I'm trying to compile the latest sources using VS2013 targeting x64, but
I'm getting compilation errors in include/tins/internals.h. VS2013 doesn't
like this template:
template <class T, class P, class=void>
struct accepts_type : std::false_type { };

template <class T, class P>
struct accepts_type<T, P,
typename std::enable_if<
std::is_same< decltype( std::declval()(std::declval

()) ),
bool>::value

::type
: std::true_type { };

Which would be a bug (or lack of support) in VS2013, as it compiles fine
elsewhere.

However, I'm getting this even when configuring with
LIBTINS_ENABLE_CXX11=0. It seems the TINS_IS_CXX11 definition in cxxstd.h
does not check the HAVE_CXX11 macro from config.h.


Reply to this email directly or view it on GitHub
#64.

@mfontanini
Copy link
Owner

Sorry, you're right. The switch doesn't do anything on VS, since VS uses C++11 by default. I'll add a quick fix now, just disabling that section of code, and try to fix it tonight.

@mfontanini
Copy link
Owner

Okay, I've just pushed a fix that disables that part of the code when using Visual Studio, so you should now be able to compile it.

Sorry for the troubles. I'll have a look at this later, although I just tried a few things and apparently VS doesn't like the use of decltype and declval there. Hopefully there's some workaround for this. I'll keep you updated.

@blazeable
Copy link
Author

Thanks for the fix, I was able to build the libtins library with LIBTINS_ENABLE_CXX11=1 defined :) However I'm getting compilation errors in the example projects, seems the build system isn't adding the pcap and openssl directories to the include path for some of the generated VS projects. Looking into it.

@walidfaour
Copy link

I'm trying to compile the latest sources using VS2013 targeting x64, but I'm getting compilation errors in include/tins/internals.h. VS2013 doesn't like this template:
template <class T, class P, class=void>
struct accepts_type : std::false_type { };

template <class T, class P>
struct accepts_type<T, P,
typename std::enable_if<
std::is_same< decltype( std::declval<T>()(std::declval<P>()) ), bool>::value
>::type
> : std::true_type { };

Which would be a bug (or lack of support) in VS2013, as it compiles fine elsewhere.

However, I'm getting this even when configuring with LIBTINS_ENABLE_CXX11=0. It seems the TINS_IS_CXX11 definition in cxxstd.h does not check the HAVE_CXX11 macro from config.h.

Hi, I am trying to compile it on windows I have cmake, installing vs2017 community with c++ support now and I have MinGW g++ and gcc also. Can you help?

@mfontanini
Copy link
Owner

What is the problem?

@walidfaour
Copy link

Okay that issue was solved

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

Successfully merging a pull request may close this issue.

3 participants