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

Can't compile in Debian #4

Closed
The-Funk opened this issue Mar 12, 2018 · 11 comments
Closed

Can't compile in Debian #4

The-Funk opened this issue Mar 12, 2018 · 11 comments
Assignees

Comments

@The-Funk
Copy link

cmake runs from build directory however I receive the following message when trying to run make:

error: ‘function’ in namespace ‘std’ does not name a template type

I'm assuming this is an issue with which version of the c++ standard is used to compile. I edited the CMakeLists.txt file in order to force both c++ 11 and later c++17 but received the same error message both times when running make.

I'm using cmake 3.10.2 and make 4.1

@The-Funk
Copy link
Author

Update

libviface will compile under Linux Mint 18.1, cmake version 3.5.1 and make 4.1

IF

The libtins.cpp file under /examples/libtins has the following line added

#include<iomanip>

@The-Funk
Copy link
Author

The-Funk commented Mar 13, 2018

Update to the update

I THINK that the /include/viface/viface.cpp file needs to have the following added in order to get compilation working on my newer Debian system. I will try this when I get home.

#include <functional>

If this is the case, something something something about explicit includes maybe.

@The-Funk
Copy link
Author

The-Funk commented Mar 13, 2018

/include/viface/viface.cpp needed explicitly #include <functional>
/examples/libtins/libtins.cpp needed explicitly #include <iomanip>

Everything compiles and works now :)

@carlos-jenkins carlos-jenkins self-assigned this Mar 13, 2018
@carlos-jenkins
Copy link
Contributor

Thanks for the report.

Let's keep this open until we fix it in code.

Thanks

@carlos-jenkins
Copy link
Contributor

  1. examples/libtins/libtins.cpp needed explicitly #include <iomanip>

Added in e918b79 as it was clearly missing.

  1. include/viface/viface.cpp needed explicitly #include <functional>

There is no such file. Do you mean viface.hpp? This is the public header, and I don't see any public API using anything from <functional>. Did you mean include/viface/private/viface.hpp?

What failed when you tried to build?

The only think I see is using function is test/catch.hpp, which is the testing framework https://github.com/catchorg/Catch2 that can be updated by just updating that file.

@The-Funk
Copy link
Author

It's actually /include/viface/viface.hpp sorry, I didn't notice it was a header at first, I'm used to using .h even in c++. I'm bad, I know.

Line 56 of that file specifically failed with the error, ‘function’ in namespace ‘std’ does not name a template type

I believe I have a rather new version of gcc and that's why this happened. If you include functional in that specific header file it compiles. I'm not sure if this is the correct solution but I will get back to you on that as soon as I implement the library here in a second.

@The-Funk
Copy link
Author

When I tried to use the library last night I encountered an error while loading shared library object. So I believe I still have an issue.

@The-Funk
Copy link
Author

Update:

I suppose it would have helped if after I installed the library to my system I had run ldconfig to update the ld.so.cache

Testing now and everything compiles and works properly! So the two changes I mentioned above took care of everything. :)

If you want to replicate my environment, I'm using a Debian Testing based Linux distribution, specifically Kali Linux.

@The-Funk
Copy link
Author

Last update, I promise.
I can confirm that the issue with needing to include functional is only present when using a newer compiler. On my Linux Mint system (using an older compiler) the only issue that needed corrected was the iomanip include.

Here's a detailed list of the compilers included by default in the different Debian distributions
https://packages.debian.org/search?keywords=g%2B%2B
My Kali Linux station is based on Debian Testing which comes with g++ 7.2.0

And here's a detailed list of the compilers included by default in Ubuntu based distributions
https://packages.ubuntu.com/search?keywords=g%2B%2B
My Linux Mint dev station is based on Ubuntu 16.04 which comes with g++ 5.3.1

@carlos-jenkins
Copy link
Contributor

This was fixed in e918b79 and in #5, sorry to keep this open so much.

@The-Funk
Copy link
Author

The-Funk commented Sep 29, 2018 via email

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