几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】library linking errors in xcode 1.5 (http://www.dimcax.com/hust/showthread.php?t=17030)

yang686526 2009-05-06 04:46 PM

【转帖】library linking errors in xcode 1.5
 
library linking errors in xcode 1.5
library linking errors in xcode 1.5
i am trying to use/link to the latest dwg direct libraries in my software product. i am getting either 'undefined' or 'multiply defined' symbol errors in the library linking step of the compile process.
to diagnose the problem i returned to the "dd_nonlibsmac/examples/odreadex" example which i ported/built in xcode. it compiles and runs when using the 'zerolink' xcode option for development software.
i am seeing the same 'undefined' library linking errors in odreadex when not using the 'zerolink" compiler flag. i get error reports of undefined symbols, such as in the odreadex example.
ld: warning prebinding disabled because of undefined symbols
ld: undefined symbols:
odbrentity::~odbrentity()
odbrtraverser::~odbrtraverser()
odacisrendererimpl::odacisrendererimpl()
odbrbrepfacetraverser::setbrep(odbrbrep const&)
odbrbrepfacetraverser::odbrbrepfacetraverser()
....
the "odacisrendererimpl" only seems to be contained in the 'libdd_macosx_acisrenderer.a' and 'libdd_macosx_modelergeometry.a' files, and both of them are linked into the project build!!!
in the 'zerolink' mode of compiling, the project builds and runs properly.
tha main issue is, i cannot build my main/work project in 'zerolink'.
any ideas? i'm also consulting apple about this issue.
thanks in advance
michael
linking directdwg in xcode (mac os x)
hi,
i had similar (undefined symbols) problem when linking direct dwg libraries (dd libs) in xcode ide ("deployment" variant).
problem:
dd libraries can be linked with zerolink in "development" variant but failed to be linked with "ld" in "deployment" variant (a lot of "unresolved symbol" errors reported by "ld").
here is solution that worked for me:
1) rename all dd libraries to "lib<name.ext>". in other words, rename all dd_... libraries with prefix "lib", i.e. "dd_macosx_acisbuilder.a" to "libdd_macosx_acisbuilder.a". this is required by "ld" linking tool used by xcode for "deployment" builds.
2) build your project without dd libraries, naturally you'll get a lot of "undefined_symbol" errors at linking stage.
3) add "libdd..." library to resolve undefined symbols which are reported first. a little luck and guess work will be required to add proper libraries because sometimes it's not obvious which library exports required symbols.
4) build your project again. if you have added some library but same unresolved symbols are at the beginning of errors log, you should remove library from your project (xcode will do symbols lookup in libraries in the order of their addition to the project, rearranging libraries inside xcode project window will not change the order of "ld" command line and thus lookup order). repeat steps 3 and 4 until no "undefined symbol" errors left.
in my case i added following libraries one by one(in exact order):
libdd_macosx_db.a
libdd_macosx_alloc.a
libdd_macosx_root.a
libdd_macosx_ge.a
libdd_macosx_gi.a
libdd_macosx_ft.a
best regards and good luck with your projects,
yuriy litoshenko,
ecsat, kiev.
on behalf of fons de wolf.
adw software.


所有的时间均为北京时间。 现在的时间是 07:20 AM.