ar

Turn thin archive into normal one

孤街醉人 提交于 2019-12-30 04:46:26
问题 I'm building V8, and by default it builds as a "thin" archive, where the .a files essentially just contain pointers to the object files on your filesystem instead of containing the object files themselves. See man ar for details. I want to be able to put this library in a central place so that other people can link to it, and it would be obviously much easier to provide a normal archive file instead of providing a gaggle of object files as well. How do I take the thin archives produced by the

Different ways of linking archive

感情迁移 提交于 2019-12-24 15:22:05
问题 I have an archive named libapi.a which is being generated by makefile . This libapi.a depends on some of the boost libraries like libboost_system.a , libboost_filesystem.a and libboost_datetime.a Now in my makefile what is happening is the objects of the Boost libraries are extracted using ar x command. The objects are copied to build directory and libapi.a is generated using ar rcs ../build/libapi.so ../build/*.o My question is why are the objects of libboost libraries being extracted? Can't

体感Kinect结合Unity3D引擎开发虚拟现实AR

天大地大妈咪最大 提交于 2019-12-19 17:12:12
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 2015 年的第一场源创会 ,由 @爱吃鱼的猫大哥 做了一篇 虚拟现实—我们能做的其实很多的猪蹄, 主要介绍了 增强现实框架-MetaioSDK开发包, 我想大家对于这个主题肯定吃的还不够过瘾,那么今天就在来点猛料 ,满足大家欲望! 由于公司业务需要,我也用这个sdk做过Android上一个虚拟现实app小例子,毕竟收费,有一些功能不付费体验不到,在加上后面跟上需要做一个大型户外体验的虚拟项目,综合考虑选择微软体感Kinect结合Unity3D引擎开发虚拟现实AR! @红薯 是不是后面考虑让我参加一期嘉宾演讲了,哈哈!废话不多扯,直接上干货! 首先上好猪蹄和各种佐料: 大概的流程:Kinect打开之后运行,unity通过绑定的脚本会首先获取RGB流和Depth流,以及骨骼数据(主要为识别手势和人多位置做准),其次通过脚本获取各种手势,以及位置,比如SwipeRight没右手挥动一次,就会切换一个例子场景直接与实时拍摄的场景完美融合(效果图稍后呈上),包括RaiseRightHand会出现流星撞地面,感觉像世界末日的感觉。最后就是同时利用unity的GuiTexture实时显示RGB流!说了那么多先上一张效果图感受下激情摧毁办公室: 好了,材料准备好了,该看的都看了,接下来重点来了

Object files not properly added to archive on mac

我是研究僧i 提交于 2019-12-18 07:08:38
问题 I am trying to build an archive from a collection of object files. I am doing this with ar -rs my_archive.a foo.o bar.o other_object_files.o . On a linux machine everything is fine but when I try the very same command on my mac it seems like only some object files are added. This results in undefined symbols corresponding to subroutines in, let's say, other_object_files.o . Moreover, if I try to manually link the object files that gave rise to undefined symbols, I can properly build the

Override weak symbols in static library

二次信任 提交于 2019-12-18 04:49:05
问题 I want to make a static .a library for my project from multiple sources, some of them define weak functions and others implements them. Let's say as example I have : lib1.c : void defaultHandler() { for(;;); } void myHandler() __attribute__((weak, alias ("defaultHandler"))); lib2.c : void myHandler() { /* do my stuff here */ } Then I want to put them into one single library, so that it seems transparent for the end application $ ar -r libhandlers.a lib1.o lib2.o But there is now 2 symbols

What's wrong with my code? (Printing File names inside an Archive File)

亡梦爱人 提交于 2019-12-13 20:08:20
问题 I'm trying to write a program to open an archive file from Unix, read the files in and print what files are inside the archive and just the filename. Below is my code -- it compiles, but I got some weird output in the terminal -- e.g. ?;?U?. It should just display 2 txt file names. Can someone take a look at my code and give me some guidance on what I'm missing? Thank you! EDIT: I made some changes to my code, but it's still not working. Any suggestion or help is greatly appreciated. #include

Android : merging static libraries into single one

我的未来我决定 提交于 2019-12-12 17:01:10
问题 I use Android NDK r8 to generate multiple static libraries with include $(BUILD_STATIC_LIBRARY) and I successfully get : lib1.a, lib2.a, lib3.a, etc. Now I would like to merge these static libraries into single one. I try do it with ar.exe from Android NDK : android-ndk-r8\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\arm-linux-androideabi\bin\ar.exe r libALL.a lib1.a lib2.a lib3.a But when I use libAll.a into Android NDK makefile, it fails saying there is no index. How can I add

libtool vs ar for creating a static library (xcode linker)

假装没事ソ 提交于 2019-12-12 15:27:56
问题 Creating a static library on Mac 10.5 with xcode via libtool and with ar via the command line both generate a libMainProject.a file however, when trying to use the one generate by libtool to link into a xcode application I end up with multiple message like "vtable for project1 referenced from: _ZTV27project1$non _lazy _ ptr in libMainProject.a(project1.o)" Using the ar one is totally fine and links correctly. I have tried the addition of the -c option to the libtool while linking but that

Static library having object files with same name (ar)

被刻印的时光 ゝ 提交于 2019-12-12 08:27:47
问题 A bit context. Let's say I have source files, which need to end up in a static library. Let's say there are two cpp files a.cpp and a.cpp located in two different subdirectories. Something like this: foo/a.h foo/a.cpp bar/a.h bar/a.cpp Their content is not clashing and is completely different. The file names are just same. Now, when compiling I end up with two a.o files of course. gcc -c foo/a.cpp -o foo/a.o gcc -c bar/a.cpp -o bar/a.o If I create a static lib now with ar rcs libfoobar.a foo

Static library built for archive which is not the architecture being linked (x86_64)

拈花ヽ惹草 提交于 2019-12-12 08:23:36
问题 I am experiencing what seems to be the same problem when I try to compile two different programs. Each of them creates first a static library and then the main application linking that library. I am working on Mac OS Mavericks with gcc 4.7.2. Program 1 This is what is happening when I run make : First, the library libfeat.a is created, but I get a warning: ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o ranlib ../lib/libfeat.a /Applications/Xcode.app/Contents