[fpc-pascal] Linking object file

Darius Blaszyk dhkblaszyk at zeelandnet.nl
Wed Mar 19 23:49:02 CET 2014


 

Hi, 

I was wondering if it's possible to link FPC object files by using the
$Link directive? At least I have troubles in getting this to work and
therefore I'm asking here. Please consider the minimal example I have
attached to this email. 

When linking the object file that implements the test_proc procedure I
get the following compiler output: 

Hint: Start of reading config file
C:lazarusfpc2.6.2binx86_64-win64fpc.cfg
Hint: End of reading config file C:lazarusfpc2.6.2binx86_64-win64fpc.cfg
Free Pascal Compiler version 2.6.2 [2014/02/28] for x86_64
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Win64 for x64
Compiling test.pp
Linking test.exe
test.pp(8,1) Error: Undefined symbol: TEST_INT_TEST_PROC
test.pp(8,1) Fatal: There were 1 errors compiling module, stopping 

What is needed in the test_impl.pas file so the linker can find the
implemented function? Do I need to create a library and export the
function perhaps? 

Regards, Darius Blaszyk 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140319/e51e7786/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.zip
Type: application/zip
Size: 551 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140319/e51e7786/attachment.zip>


More information about the fpc-pascal mailing list