On 04 Feb 2011, at 21:38, Peter Andersen wrote: > Den 04-02-2011 21:27, Jonas Maebe skrev: >> >> On 04 Feb 2011, at 21:24, Peter Andersen wrote: >> >>>> That's a very bad way to link libc, because afaik it bypasses all compiler >>>> detections for the fact that you are linking to that library (and doing so >>>> requires using different startup code). Instead, either add {$linklib c} >>>> to the source, or add the "initc" unit to the uses clause. >>> >>> Please could you explain it a little bit more. >> >> What is it exactly that you do not understand? > > {$linklib c} > Is it possible just to add a line like: > {$/linklib c} > into the source
Yes (without the "/") > and if yes where in the source. In principle it can appear anywhere. > I have some > {$ifdef linux} > ,linux > {$endif} > should it be inside thes ifdef and endif ? If the C library should only be linked when compiling for Linux: then yes (although I wouldn't add it inside that particular ifdef/endif block since it's the in the middle of a uses-clause, but instead in a separate ifdef/endif block that only contains shared library-related stuff). If the library should always be linked, then add it somewhere outside those defines. Jonas_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal