On 1/27/2017 10:04 AM, Michele Portolan wrote:
I have a project that build correctly using gcc 4.9.3, generating a
dynamic library that I can later link to obtain my executables. So,
nothing special.

My problem is that on one of my target systems, I only have a gcc 4.1.2
and I am forced to use it for at least  linking the last executable. My
project uses extensively C++14,so I cannot build it with the older gcc.

Is there a way to have Cmake generate a library that is compatible with
gcc 4.1.2?

I think your choices are to rewrite without C++14 or to include all of the static C++ support libraries into your library.

You will need to make all your symbols hidden and then explicitly mark what you want exported. You should be doing that anyway of course. And when linking in the static libraries you will want to be sure that ld in the link step is using -exclude-libs ALL option. Because if any C++14 symbols escape from your .so it will screw up the C++03 link.

Also, you won't be able to pass any complex objects or exceptions between libraries because the internal implementation of std::list and std::string has changed from 2003 to 2014.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to