
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] how to compile a C program without main() ?
On Thu, May 12, 2011 at 3:57 PM, Gernot Hassenpflug
<aikishugyo@example.com> wrote:
> Dear all,
>
> I'm not sure how best to word the subject, as I am not sure what I should be
> looking to solve here.
>
> I found this preload library (nocache) source code
>
> http://enricozini.org/2010/tips/nocache/
>
The information provided by others will be of more use for this
particular issue, but in general, if you are compiling a module, and
not a complete program, the -c flag will generally allow it to compile
in gcc. This tells it to compile, but not link.
>From there you would use ar or similar to link them together as a
library, or you would use gcc to link them together as a program
(which would have to have exactly one main() in one of the modules).
I am sure there are more complicated ways of doing things, but I am
not an expert. :)
--
Ken
Home |
Main Index |
Thread Index