Results 1 to 9 of 9

Thread: mac linker problems

  1. #1
    Junior Member
    Join Date
    Jun 2007
    Posts
    20

    mac linker problems

    I'm trying to build under OSX and am getting the following linker errors:

    Undefined symbols:
    daeMetaGroup::daeMetaGroup(daeMetaElementAttribute *, daeMetaElement*, daeMetaCMPolicy*, unsigned int, int, int)
    daeMetaChoice::daeMetaChoice(daeMetaElement*, daeMetaCMPolicy*, unsigned int, unsigned int, int, int)

    ------

    I saw a similar previous post saying to check the makefile to see if certain daeMeta cpp files were listed. The files listed were present in the "makefile_pc" file.

    Any ideas?
    Matt

  2. #2
    Hi Matt,

    generally there are two ways of using the DOM in your Mac-project.

    The first one is to simply build the DOM like on Linux and link it with your project statically. I tried this with the last SVN - version and I was able to reproduce your error-message. You simply have to rearrange the build-command to get rid of the error and successfully link to the DOM.

    For the current version in SVN:

    Use those LDFLAGS:

    Code :
    -L$(COLLADA_DOM_LOCATION)/lib/linux_1.4 -lcollada_dae -lcollada_dom -lcollada_dae -lxml2

    ...the linker needs -lcollada_dae twice (before and after -lcollada_dom). Of course you have to set or replace COLLADA_DOM_LOCATION with wherever your COLLADA_DOM is located at.

    If you link against the last official DOM-release (1.3) see here for setting up your client build-configuration. Additionally you have to add daeRawResolver.cpp to Makefile_PC in DOMROOT/src/dae/Makefile_PC.

    Now, the second and probably the more convenient way to use the DOM on Mac (10.4 Tiger), is to include the DOM as a framework to your projects. The current svn - version from sourceforge now contains a Xcode project which you can use to easily build the framework. A framework bundle contains all you need to build and link against the library: a dynamic library, the headerfiles and additional documentation. You can find more information about frameworks here.

    As another advantage the DOM-Framework is automatically build as an Universal Binary (Release-build only)

    After building it, place it in /Library/Frameworks (which is a convenient location).

    When building your project with a Makefile use

    Code :
    -I/Library/Frameworks/Collada141Dom.framework/Headers

    for CXXFLAGS so the compiler finds the correct headers, and use

    Code :
    -framework Collada141Dom

    as the linker flag.

    In Xcode add the existing DOM-framework to your project and also set the additional header-searchpath mentioned above.

    As a sidenote: The COLLADA Refinery-tool is now available for Mac, too. Download the current SVN from http://sourceforge.net/projects/colladarefinery , open up the Xcode project, build and run. You have to build the ColladaDom-framework first and place it into /Library/Frameworks.

    The Xcode-projects are pretty new and there isn't much documentation about using them as they are in svn only. I will write some documentation for the Wiki soon. Please let me know if you run in any troubles using the Xcode projects.

    - h

  3. #3
    Junior Member
    Join Date
    Jun 2007
    Posts
    20
    ok, from what you've said i'd like to use the framework. are you saying i can make a framework from COLLADA_DOM.xcodeproj? if so, can you explain how to do that?

    thank you.
    Matt

  4. #4
    That's right, you can easily build the framework by yourself. Note that you have to have OS X 10.4 Tiger and Xcode 2.4. You can download the latest Xcode Tools from http://developer.apple.com/products/online.html for free, but you have to sign up for a free membership first.

    Get the current DOM from SVN and open projects/Xcode/ColladaDom.xcodeproj . Per default the Release-Configuration is active and the current build target is set to Collada141Dom, so the only thing you have to, is to push the "Build"-Button. This takes some time, as the sources are build for Intel and PowerPC so you end up with an Universal Binary. After the build-process is done you "install" the framework by copying projects/Xcode/build/Release/Collada141Dom.framework into /Library/Frameworks. That's it, you're done.

    As a sidenote: On Tiger you don't need to install libxml2 to build the DOM as it's shipped with the OS. But if you want to check files against the Collada XSD Schema using libxml2, you have to download a more recent libxml2 version. The one shipped with Tiger has some bugs parsing the Collada Schema. However, the DOM itself is not affected by that bug.

    Hope that answers your questions.

    - h

  5. #5
    Junior Member
    Join Date
    Sep 2007
    Posts
    13
    Hello.

    Thanks heinzi for pointing out how to build Collada141Dom.framework, I successfully built it, but how to include it's headers? I'm doing cocoa test app and I tryed:
    I've set Framework Header searchpath in xcode to /Library/Frameworks/Collada141Dom.framework/Headers
    Code :
    #import <Collada141Dom/dae.h>

    But get multiple errors. Like
    "error: dae/daeInterface.h: No such file or directory"

    Please help.

  6. #6
    Hi,

    you have to add /Library/Frameworks/Collada141Dom.framework/Headers to "Header Search Paths" instead of framework search path. For the framework itself you don't have to set any path, as it's located under a standard-location in /Library/Framework. Usually, framework-headers are supposed to be in one directory only, without any subdirectories. But the DOM references to includes like <dae/daeArray.h>, that's why you have to add the directory to the header search paths.

    greets,

    h

  7. #7
    Junior Member
    Join Date
    Sep 2007
    Posts
    13
    Hello,
    Yes, it works now, thanks heinzi!
    After I added to Header Search Path, the error disappeared, but numerous other came. That was because i used it in Cocoa app, so i tryed with Carbon, and it builds with no errors/warnings.
    Thanks!

  8. #8
    Your welcome, by the way, using a C++ library does not necessarily mean you have to use Carbon. You can mix C++ easily with Objective C / Cocoa. But you have the use the file extension *.mm for that. It's sometimes referenced as Objective C++.

    For more information see http://developer.apple.com/documentatio ... on_10.html

    - h

  9. #9
    Junior Member
    Join Date
    Sep 2007
    Posts
    13
    Yes, i was reading about that, and using it right now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •