Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any issues with mixing libraries with and without std=c++0x

Tags:

c++

gcc

c++11

I am writing a library that must depend libraries that are not presently compiling with support for the new standard. I would like to compile a library which must depend on those libraries with std=c++0x. Are there any problems with doing this?

like image 471
bpw1621 Avatar asked Jun 27 '11 14:06

bpw1621


1 Answers

If you mix libraries compiled with different compiler options then you must ensure that the ABI for the data types in the interface is the same. Some data types (such as std::string) have different interfaces and requirements between C++03 and C++0x, so interfaces that use them must be careful.

If your interfaces only use built-in types and your own classes, and these do not themselves use any standard library classes then all should be OK. Otherwise you will need to check the specific subset you are using.

like image 62
Anthony Williams Avatar answered Sep 28 '22 10:09

Anthony Williams