Re: "External" object files

From: Owen Jacobson (angstrom_at_lionsanctuary.net)
Date: 06/19/04

  • Next message: Owen Jacobson: "Re: new to programming in Linux"
    Date: Sat, 19 Jun 2004 03:24:32 GMT
    
    

    On Fri, 18 Jun 2004 15:48:44 +0200, Doru-Catalin Togea wrote:

    > My problem is that my application is located some other place then the
    > xawtx code and I do not know how to refere to (#include) the relevant
    > xawtv code. It is not reasible to relocate my code into xawtv's source
    > tree.
    >
    > Most of the code relevant to me is implemented into the
    > ../xawtv-3.93/console/webcam.c file with no corresponding header file.
    > There is also a .../webcam.o file from the compilation of xawtv.
    >
    > Is it possible to somehow link against webcam.o and make use of the
    > functionality of that object file?

    Just like any other object file -- pass it as an argument to the link
    phase of your project's compilation. In order to refer to symbols defined
    in that object file, you'll need to declare them somewhere in the code
    that uses them.

    Good luck,
    Owen

    -- 
    Some say the Wired doesn't have political borders like the real world,
    but there are far too many nonsense-spouting anarchists or idiots who
    think that pranks are a revolution. 
    

  • Next message: Owen Jacobson: "Re: new to programming in Linux"

    Relevant Pages

    • Re: problem with pointer and module
      ... I don't think your problem has much really to do with pointers. ... you didn't tell it to include the object file created by the ... I'm guessing that this means that the initializations ... I assume thet the first compilation produced a mod_example.o file ...
      (comp.lang.fortran)
    • Re: Fortran module checking
      ... This is used during compilation only. ... An ordinary object file, which is loaded just like any other (or is ... All of this assumes the most common implementation scheme for module ...
      (comp.lang.fortran)
    • Re: c program
      ... this '.s' file is then PREPROCESSED for compilation. ... These days this will give you an object file for linking. ... Modern compilers are "single pass" which means they hide all the messing about and go from the source code text to object files in "one pass" and do not generate assembler code. ...
      (comp.lang.c)
    • Re: Fortran module in a library
      ... The object file is no different from any other object file. ... The .mod file is used during compilation - not linking. ... But them in a handy directory ... compiler switch you need to tell the compiler to look there. ...
      (comp.lang.fortran)
    • Re: How do linkers work?
      ... That is why I explained the concept of separate compilation, ... and the three parts that an object file must have, ... Plenty of linkers can patch up branches so ... EPROMS are executables? ...
      (comp.lang.c)