<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-family: Verdana,Geneva,sans-serif'>
<p><retrying with a smaller zip><br /><br />I have prepared a minimal example of the linking problems I get.  Just unzip, create a "build" dir and run cmake. I'm using gcc 4.6.2.<br /><br />As soon as I try to use the function "file_size" I get the following linker errors:<br /><br />Free Pascal Compiler version 2.6.2 [2013/03/17] for i386<br />Copyright (c) 1993-2012 by Florian Klaempfl and others<br />Target OS: Win32 for i386<br />Compiling test.pp<br />Compiling test_h.pas<br />Linking project1.exe<br />test.pp(9,1) Error: Undefined symbol: _open<br />test.pp(9,1) Error: Undefined symbol: _filesize<br />test.pp(9,1) Error: Undefined symbol: _close<br />test.pp(9,1) Fatal: There were 3 errors compiling module, stopping<br /><br />It really seems I need to add an additional library to the pascal source or that the linker cannot find some included symbols in libmsvcrt.a.<br /><br />Any help appreciated.<br /><br />Regards, Darius<br /><br /><br /><br />Ludo Brands schreef op 20 apr '13:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<pre>On 04/20/2013 11:54 AM, Darius Blaszyk wrote:</pre>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%">Hi, I'm linking a C and FPC program but I keep on getting undifined symbols (see example below). Error: Undefined symbol: _strcpy Sofar I have added: {$linklib msvcrt} {$linklib gcc} What other libraries should I add? BTW, I'm compiling the C library with MinGW. Regards, Darius</blockquote>
<pre>_strcpy should be in msvcrt. It is defined in the mingw libmsvcrt.a file
on my system. Is your lib path correct?

BTW I use an explicit {$linklib libmsvcrt.a} with mingw.

Ludo
_______________________________________________
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a>
</pre>
</blockquote>
<p> </p>
<br />
<div> </div>
</body></html>