c++ - Error when including <boost/shared_ptr.hpp> in iOS pre-compiled header file -


i'm developing ios app , using shared-pointer boost library. app little chunky, i've been trying lean up. think moving line:

#include <boost/shared_ptr.hpp> 

from individual files pre-compiled header file save me space since heard every include of shared_ptr recompiles different version , it's unclear whether compiler removing duplicates.

when move line pch file ton of compile-time errors, of are:

error: expected '=', ',', ';', 'asm' or '__attribute__' before 'boost' 

i've changed .pch file sourcecode.cpp.h file in info, hasn't helped.

thoughts?

edit: verified there in fact duplicate copies of compiled shared_ptr in binary!

you have c or objc sources in project.

in case:

#if defined(__cplusplus) #include <boost/shared_ptr.hpp> #endif 

xcode (by default) creates prefix every language/dialect in project, , if doesn't, it's still manually #included. unfortunately, moving header pch add duplicates. reduce build times, however.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -