yet-another-user / pimpl

The C++ Pimpl Idiom Again!
36 stars 7 forks source link

compile errors on apple clang when including impl_ptr.hpp #15

Closed madmongo1 closed 7 years ago

madmongo1 commented 7 years ago

What are the include/define dependencies other than boost?

c++ 14 commit number e4cfd48 (master/HEAD)

Command line:

c++   
-isystem /Users/rhodges/play/wibble/cmake-build-debug/pimpl/include 
-isystem /Users/rhodges/play/wibble/pimpl/include 
-isystem /Users/rhodges/.hunter/_Base/eaa24bd/a5fd140/e9e53ac/Install/include  
-g   -std=gnu++14 
-o CMakeFiles/impl_ptr_tests.dir/test/impl.cpp.o 
-c /Users/rhodges/play/wibble/pimpl/test/impl.cpp

Note that boost is installed here: /Users/rhodges/.hunter/_Base/eaa24bd/a5fd140/e9e53ac/Install/include

[ 44%] Building CXX object pimpl/CMakeFiles/impl_ptr_tests.dir/test/impl_always_inplace.cpp.o
In file included from /Users/rhodges/play/wibble/pimpl/test/impl.cpp:1:
In file included from /Users/rhodges/play/wibble/pimpl/test/./test.hpp:4:
In file included from /Users/rhodges/play/wibble/pimpl/test/../include/impl_ptr.hpp:8:
In file included from /Users/rhodges/play/wibble/pimpl/include/./detail/shared.hpp:8:
/Users/rhodges/play/wibble/pimpl/include/./detail/./detail.hpp:176:31: error: template argument for template template parameter must be a class template or type alias template
    using    base_type = base<unique, impl_type, allocator>;
                              ^
/Users/rhodges/play/wibble/pimpl/include/./detail/./detail.hpp:177:35: error: use of undeclared identifier 'base_type'
    using      pointer = typename base_type::pointer;
                                  ^
/Users/rhodges/play/wibble/pimpl/include/./detail/./detail.hpp:177:46: error: expected a qualified name after 'typename'
    using      pointer = typename base_type::pointer;
                                             ^
/Users/rhodges/play/wibble/pimpl/include/./detail/./detail.hpp:177:46: error: type-id cannot have a name
    using      pointer = typename base_type::pointer;
                                             ^~~~~~~
yet-another-user commented 7 years ago

Just checked in changes I had to make to build using clang-4.0.0 (on my laptop). Pls let us know if that fixes your problem (I have no apple)

yet-another-user commented 7 years ago

What are the include/define dependencies other than boost

No other dependencies... AFAIK.

madmongo1 commented 7 years ago

Yes, that fixed it.

I have created 2 pull requests.

one for a .gitignore update for the CLion IDE (very good, I'd encourage anyone to try it),

the other to enable cmake as the build manager with optional support for Hunter (astonishingly good dependency manager for cmake).

yet-another-user commented 7 years ago

RE: pull requests

I'll merge in a couple of days (when I am back)... unless Giel beats me to it... Saw a file called 'sugar.cmake"... :-) Can we rename it to something neutral?.. ;-)

RE: CLion IDE... very good

$199 a year subscription... I have certain doubts. :-) Eclipse is a hog... but with multi-CPUs and tonnes of memory these days it seems to do all can think of... Nobody gets even close... Not Kdevelop, QtCreator, Geany, etc.

RE: Hunter... astonishingly good

Been using ol' trusty make for 40 years. Now I need Hunter to improve cmake to call make... Not judging... Just saying... Guys at work do use cmake... I'll have them to investigate Hunter. Tnx for the pointer.

madmongo1 commented 7 years ago

The sugar.cmake file is used by the Sugar package which is pulled in by hunter. It improves source file management in cmake. for details, see the sugar package docs at: https://github.com/ruslo/sugar

cmake does not replace make, it is a makefile maker. The advantage is that the same cmake project can also automatically make visual studio projects, xcode projects, ninja makefiles, codeblocks projects etc.

This means that one project is easily cross-compiled into any target environment - including code signing etc.

The presence of Hunter hunter means that one only needs to say, "I need these boost libraries, openssl, and x or y library in this project" - hunter then automatically downloads and builds them for your target. no need for manual dependency-building steps or having to specify odd include paths or compiler flags. The build generation system does it all for you.

You may have noticed recently that the boost steering group announced that the intention is to replace boost build with cmake in the near future.

The advantage of clion over eclipse et.al is that it actually works :)

They have a scheme where you can have a free licence if you are contributing to an open source project.

Have a good trip.

R

On 10 September 2017 at 03:57, Mike notifications@github.com wrote:

RE: pull requests

I'll merge in a couple of days (when I am back)... unless Giel beats me to it... Saw a file called 'sugar.cmake"... :-) Can we rename it to something neutral?.. ;-)

RE: CLion IDE... very good

$199 a year subscription... I have certain doubts. :-) Eclipse is a hog... but with multi-CPUs and tonnes of memory these days it seems to do all can think of... Nobody gets even closet... Not Kdevelop, QtCreator, Geany, etc.

RE: Hunter... astonishingly good

Been using ol' trusty make for 40 years. Now I need Hunter to improve cmake to call make... Not judging... Just saying... Guys at work do use cmake... I'll have them to investigate Hunter. Tnx for the pointer.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yet-another-user/pimpl/issues/15#issuecomment-328314437, or mute the thread https://github.com/notifications/unsubscribe-auth/AE7sybthmrtvPNEhQBGYGcD122fdlc6Mks5sg0IAgaJpZM4PR8rv .

muggenhor commented 7 years ago

Closing this because the problem is fixed by 2628fd0ce79138ea66a6729bd5a5691361753918