Professional Web Applications Themes

Link in XCode to an external .o file - Mac Programming

Hi, I have a problem linking to an .o file. I have the appropriate .h file, the object file was created using a C-Compiler, so as I can see, the function I want to use is called function. But as I link to the object file and run the program ZeroLink says something like __Z6functiontPtPmS_ ... not found. I know this behaviour from the windows-world. There are keywords yavailable like extern _cdecl but this is rather Microsoft-Like... Is there a workaround to link c object files to an c++ project in XCode? Any help is appriciated, because I am rather ...

  1. #1

    Default Link in XCode to an external .o file

    Hi,

    I have a problem linking to an .o file. I have the appropriate .h
    file, the object file was created using a C-Compiler, so as I can see,
    the function I want to use is called function.
    But as I link to the object file and run the program ZeroLink says
    something like __Z6functiontPtPmS_ ... not found.
    I know this behaviour from the windows-world. There are keywords
    yavailable like extern _cdecl but this is rather Microsoft-Like...

    Is there a workaround to link c object files to an c++ project in
    XCode?

    Any help is appriciated, because I am rather new to the XCode
    environment...

    Thanks a lot

    Wolfgang
    Wolfgang Guest

  2. #2

    Default Re: Link in XCode to an external .o file

    In article <google.com>,
    de (Wolfgang Hennig) wrote:
     

    Try turning off ZeroLink. It doesn't work with all projects,
    unfortunately, and yours might be one of those.

    You can turn it off by selecting your project file under Groups & Files
    (it's the first item there), pressing command-I, clicking on the Styles
    tab, and turning off the ZeroLink check box.

    Hope this helps,
    Eric

    --
    Eric Albert stanford.edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  3. #3

    Default Re: Link in XCode to an external .o file

    Wolfgang Hennig wrote: 

    If the object file was compiled as C, then you have to remember to
    surround the header with extern "c" { } to avoid the name mangling which
    leads to linker errors.

    --
    Pull out a splinter to reply.
    Peter Guest

  4. #4

    Default Re: Link in XCode to an external .o file

    > If the object file was compiled as C, then you have to remember to 

    Thanks a lot. This did help. I think I am to much stick to the mircosoft world...

    Cheers

    Wolfgang
    Wolfgang Guest

Similar Threads

  1. link to an external file
    By allymoizer in forum Macromedia Director Lingo
    Replies: 2
    Last Post: March 3rd, 09:25 PM
  2. link to an external file
    By allymoizer in forum Macromedia Director Basics
    Replies: 1
    Last Post: March 3rd, 07:17 PM
  3. link to an external URL file
    By hritikny in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 27th, 09:05 AM
  4. Link to external file
    By zeenu webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 3
    Last Post: January 14th, 10:37 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139