简体   繁体   English

如何在Window中创建c / c ++库并在iPhone项目中使用?

[英]How to create c/c++ library in Window , and use in iPhone project?

I want to use c or c++ code to build an library that can use in iPhone . 我想使用c或c ++代码来构建可以在iPhone中使用的库。

I had asked a similar question "make arm architecture c library in mac" . 我曾问过一个类似的问题“在Mac中制作手臂架构c库”

And someone says use Xcode to build static library . 有人说使用Xcode构建静态库。

But I must build the library in Windows (maybe use Visual Studio) . 但是我必须在Windows中构建库(也许使用Visual Studio)。

And it seems will have architecture problem 而且似乎会有架构问题

In fact , I dont quite understand how to create the library in Windows , and how to let the library use in iPhone project ? 实际上,我不太了解如何在Windows中创建该库,以及如何让该库在iPhone项目中使用? .

Can someone tell me some tips? 有人可以告诉我一些提示吗? Some gcc commands like : 一些gcc命令,例如:

gcc -c math.c -o math.o
ar rcs libmath.a math.o

(But I use this command to make libmath.a in Linux , and take it to iPhone , it says the lib has no architecture info and cannot use ) (但是我使用此命令在Linux中创建libmath.a,并将其带到iPhone上,它说该lib没有体系结构信息并且不能使用)

or some visual studio steps? 或一些Visual Studio步骤?

如果您将在库中使用仅POSIX的环境,则可以在Windows和iPhone中使用它(但可能与某些#define一起使用)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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