Boris Kolpackov boris at codesynthesis.com
Fri May 31 11:13:02 EDT 2013


Hi Andrey,

Andrey Devyatka <an9bit at gmail.com> writes:

> Please tell me, can I use the static library in the following case:
>> [...]

This is exactly the same issue that we've discussed just a few days
ago: http://www.codesynthesis.com/pipermail/odb-users/2013-May/001286.html Because your application doesn't directly reference any symbols from
library-odb.cxx, the linker ignores library-odb.o from library.a. As
a result the schema creation code does not end up in the executable. Normally this is not a problem since most application executables
will also include code that persists objects, etc., which will
force the linker to include all the object files from the library. In your test, however, all you do is create the schema. As mentioned
in the above email, with GNU ld you can use the --whole-archive
option to force the linker to include every object file from your
static library: > $ g++ -o test2 main.o library.a -lodb-sqlite -lodb

g++ -o test2 main.o -Wl,-whole-archive library.a -Wl,-no-whole-archive -lodb-sqlite -lodb Another thing that you may find useful is the 'separate' value for
the --schema-format option. It will trigger the generation of the
schema creation code as a separate C++ source file (library-schema.cxx).
You can then perhaps link it directly to your executable instead of
packaging it into a static library. See the ODB compiler command line
documentation (man pages) for more information on this option. Boris

from:http://www.codesynthesis.com/pipermail/odb-users/2013-May/001299.html

最新文章

  1. ASP.NET MVC之Unobtrusive Ajax(五)
  2. 百度地图SDK
  3. min-height
  4. Linux磁盘操作命令
  5. thinkphp的save方法失败
  6. 用JAVA 查询 Active Directory(AD)
  7. Qt在Windows下的三种编程环境搭建
  8. 为部署ASP.NET Core准备:使用Hyper-V安装Ubuntu Server 16.10
  9. YDKJS:作用域与闭包
  10. 在Hadoop2.2基础上安装Spark(伪分布式)
  11. 对线性回归,logistic回归和一般回归
  12. OAuth和OpenID的区别
  13. JavaScript pop()函数弹出数组最后数据
  14. spark日志配置及问题排查方式。
  15. soap 简单的例子
  16. require的路径问题(比较重要)
  17. bootstrap基础学习四篇
  18. nginx应用编译安装
  19. springboot项目更改代码后实时刷新问题
  20. 375. Clone Binary Tree【LintCode java】

热门文章

  1. winform 实现两个datagridview之间的数据联动
  2. win10下安装psql9,后无法访问数据库引擎
  3. Fiddler抓取https相关设置
  4. map.keySet()获取map全部的key值
  5. Apple &amp; APPID &amp; iOS &amp; React Native
  6. hihoCoder#1082 然而沼跃鱼早就看穿了一切
  7. [cf360 div1.C]The Values You Can Make[Dp]
  8. 【ZJOI2017 Round1练习&amp;BZOJ4774】D3T2 road(斯坦纳树,状压DP)
  9. Linux下汇编语言学习笔记36 ---
  10. hiho一下 第四十九周 欧拉路