ar

Limiting the scope of global symbols from linked objects

僤鯓⒐⒋嵵緔 提交于 2019-12-10 16:36:23
问题 I have a C library in an archive file, clib.a . I've written a C++ wrapper for it, cpp.o , and would like to use this as a static library: ar cTrvs cppwrap.a clib.a cpp.o Code which links to this won't be able to use the stuff from clib.a directly unless the correct header is included. However, if someone coincidentally creates an appropriate prototype -- e.g. void myCoincidentallyNamedGlobalFunction() -- I'm concerned which definition of myCoincidentallyNamedGlobalFunction will apply. Since

LOCAL_SRC_FILES points to a missing file

泪湿孤枕 提交于 2019-12-10 12:37:55
问题 i'm doing an augemented reality program. i was handed this project and im new to cygwin and android programming. i have to use cygwin to compile one of my cpp file. however when i do a ndk-build on cygwin this error comes out: $ ndk-build Android NDK: ERROR:/cygdrive/c/project/jni/Android.mk:QCAR-prebuilt: LOCAL_SRC_FILES points to a missing file Android NDK: Check that /cygdrive/c/project/jni//../../../build/lib/armeabi/libQCAR.so exists or that its path is correct /cygdrive/c/android-ndk

linking a self-registering, abstract factory

非 Y 不嫁゛ 提交于 2019-12-09 17:15:53
问题 I've been working with and testing a self-registering, abstract factory based upon the one described here: https://stackoverflow.com/a/582456 In all my test cases, it works like a charm, and provides the features and reuse I wanted. Linking in this factory in my project using cmake has been quite tricky (though it seems to be more of an ar problem). I have the identical base.hpp, derivedb.hpp/cpp, and an equivalent deriveda.hpp/cpp to the example linked. In main, I simply instantiate the

Yii2的ActiveRecord与ActiveQuery简单介绍

╄→尐↘猪︶ㄣ 提交于 2019-12-07 20:43:08
活动记录 活动记录为与数据库中某张表中的 某条记录 相关联的 对象 ,我们通过调用此对象的 CURD方法对记录进行操作,Yii2的活动记录其实很标准,AR 类为模型Model,对应数据表,AR 类的实例为活动记录,对应表中某条记录。 在 Yii2 中活动记录为 AR 的实例,对应数据表中的某条记录 。 AR 的实例本身作为一条数据表中的记录不应该承担对表级别的操作 ,所以 Yii2 将此任务赋予了 AR 及其子类(我们自己写model)。我们可以调用相关的 类方法(即静态方法)对表进行检索从而获取我们想要的活动记录,当然, 这些静态方法也可以被此模型的实例所使用 (静态方法的特性) ActiveRecord 的 ORM 操作标准: 1、通过 AR 类访问数据库,检索其所对应的数据表获得符合条件的活动记录 2、对活动记录进行CURD操作 Yii2 的 AR 是通过调用 AQ 对其所关联的表进行检索操作,以下 AR 方法会返回 AQ 对象 User::find() //生成与当前AR所关联的表的AQ对象 User::findBySql($sql) //根据语句生成相对应AQ对象 $sql = "select * from yii_user where id = 1" 当进行关联查询的时候则是通过已经确定的活动记录对关联表进行条件检索 //关联查询时生成AQ $user->hasOne

Autoconf uses wrong AR on OS X

╄→гoц情女王★ 提交于 2019-12-07 11:19:48
问题 I'm testing on OS X. We have a configure.ac and Makefile.am . Autotools is selecting the wrong AR and ARFLAGS for the platform. It happens with (and without) AM_PROG_AR in Makefile.am : $ egrep 'AR =|ARFLAGS =' Makefile AMTAR = $${TAR-tar} AR = ar ac_ct_AR = ar Autoconf should be using Apple's libtool (not to be confused Autotools' libtool ) and libtool 's flags. Apple's libtool properly handles fat libraries and cross-compiles. It should be something like: AR = /usr/bin/libtool ARFLAGS =

cmake os x failure ar no archive members specific

本秂侑毒 提交于 2019-12-07 10:04:22
问题 I have a simple cmake project going that I can't get to compile on OS X 10.8.4. The cmake/make process works great on Linux but on OS X I am getting this error: Linking CXX static library libImageFilter.a ar: no archive members specified ... make[2]: *** [lib/libImageFilter.a] Error 1 make[1]: *** [lib/CMakeFiles/ImageFilter.dir/all] Error 2 make: *** [all] Error 2 I am using the Eclipse CDT4 Generator Unix MakeFile on both platforms. This seems like something to with the difference between

Autoconf uses wrong AR on OS X

橙三吉。 提交于 2019-12-05 12:36:05
I'm testing on OS X. We have a configure.ac and Makefile.am . Autotools is selecting the wrong AR and ARFLAGS for the platform. It happens with (and without) AM_PROG_AR in Makefile.am : $ egrep 'AR =|ARFLAGS =' Makefile AMTAR = $${TAR-tar} AR = ar ac_ct_AR = ar Autoconf should be using Apple's libtool (not to be confused Autotools' libtool ) and libtool 's flags. Apple's libtool properly handles fat libraries and cross-compiles. It should be something like : AR = /usr/bin/libtool ARFLAGS = -static -o Apple's Porting UNIX/Linux Applications to OS X does not discuss the topic, and I can't find

linking a self-registering, abstract factory

落爺英雄遲暮 提交于 2019-12-04 05:47:48
I've been working with and testing a self-registering, abstract factory based upon the one described here: https://stackoverflow.com/a/582456 In all my test cases, it works like a charm, and provides the features and reuse I wanted. Linking in this factory in my project using cmake has been quite tricky (though it seems to be more of an ar problem). I have the identical base.hpp, derivedb.hpp/cpp, and an equivalent deriveda.hpp/cpp to the example linked. In main, I simply instantiate the factory and call createInstance() twice, once each with "DerivedA" and "DerivedB". The executable created

What's the order for gcc to link unresolved symbol in static library

北战南征 提交于 2019-12-04 04:56:16
问题 When debug the function symbols conflicts problem, I find a strange behavior of gcc i couldn't understand, illustrate by the following sample code: main.c #include <stdio.h> int main() { b(); a(); } a.c #include <stdio.h> void a(void) { printf("func a in a\n"); } b.c #include <stdio.h> void a() { printf("func a in b\n"); } void b() { printf( "func b try to call a \n"); a(); } compile: gcc -c a.c gcc -c b.c ar -cr liba.a a.o ar -cr libb.a b.o gcc main.c liba.a libb.a execute: ./a.out func b

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

时光总嘲笑我的痴心妄想 提交于 2019-12-03 23:50:22
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/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: warning for library: ../lib/libfeat.a the