简体   繁体   中英

static library c++ with XCode

I'm trying to create a library of a group of files .cpp and .hpp in xcode.

All files run right in the simulator and in the device without library.

And I have created the library and I have run it in the simulator (architecture x86) and run quite well.

When I tried to run the app with the library in the device I get an error like I would have forgotten any files:

Undefined symbols for architecture armv7:
"ssm::partialSortGreater(int, std::__1::vector<float, std::__1::allocator<float> > const&, std::__1::vector<int, std::__1::allocator<int> >&)", referenced from:

but It's running in the simulator with the same files, it's mental :S

thanks :)

Update:

BuildSettings: Library and App 图书馆

在此处输入图片说明

Update 2:

Moreover if I Archive the app and I install it with iTunnes, works!!! in the device :S Very weird

A few things to check in this instance:

Make sure the library is not set to "Build active architecture only" and make sure that it has ARMv7 set as a valid architecture.

Also, make sure that the main project has your library listed in the Build phases under Target Dependancies and Link Binary with Libraries.

If your library is not building the proper architecture or if your main project is not dependent on it's changes and not currently being linked against the static library your main project will not know that the static library exists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM