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

[BUG] fails to compile #6

Closed
breznak opened this issue Oct 5, 2016 · 4 comments
Closed

[BUG] fails to compile #6

breznak opened this issue Oct 5, 2016 · 4 comments

Comments

@breznak
Copy link
Contributor

breznak commented Oct 5, 2016

  • on Ubuntu, g++ 4.8, clang++ 3.7, ...

the error I'm getting,

In file included from SampleMain.cpp:1:
./LRUCache11.hpp:246:21: error: no type named 'lock_guard' in namespace 'std'
        using Guard = std::lock_guard<lock_type>;
                      ~~~~~^
./LRUCache11.hpp:246:31: error: expected ';' after alias declaration
        using Guard = std::lock_guard<lock_type>;
                                     ^
                                     ;
./LRUCache11.hpp:258:3: error: unknown type name 'Guard'
                Guard g(lock_);
                ^
./LRUCache11.hpp:262:3: error: unknown type name 'Guard'
                Guard g(lock_);
                ^

Thank you very much for looking into it!

@mohaps
Copy link
Owner

mohaps commented Oct 6, 2016

what is the cmd line you're using to compile? std::lock_guard is a c++11 feature. -std=c++11 is required for that

@breznak
Copy link
Contributor Author

breznak commented Oct 6, 2016

-std=c++11 is required for that

Yes, I do have that:
$ clang++-3.7 -std=c++11 -o sample_main SampleMain.cpp && ./sample_main

The #3 fixes that for me.

@mohaps
Copy link
Owner

mohaps commented Oct 18, 2016

can you confirm with master if it still fails to compile?

@breznak
Copy link
Contributor Author

breznak commented Oct 18, 2016

@mohaps yes, the recent update & -lpthread as per readme fixes the compilation. Thank you!
I'm closing this issue.

@breznak breznak closed this as completed Oct 18, 2016
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