[Lazarus] Erro: undefined symbol

Antonio Fortuny a.fortuny at sitasoftware.lu
Tue May 29 14:04:14 CEST 2012



Le 29/05/2012 13:45, michael.vancanneyt at wisa.be a écrit :
>
>
> On Tue, 29 May 2012, Antonio Fortuny wrote:
>
>> Hi All.
>>
>> Maybe I'm coming back with an old thing but I can't get rid of it.
>> I've compiled and installed a new package (UIB): no problem anywhere.
>> Then I begin to use the package into a new project. I've just added 
>> the package to the project and nothing else.
>> At the compilation I get the error messages:
>> UibDataSet.lpr(20,1) Error: Undefined symbol: THREADVARLIST_UIBDATASET
>> UibDataSet.lpr(20,1) Error: Undefined symbol: VMT_UIBDATASET_TUIBDATASET
>> UibDataSet.lpr(20,1) Fatal: There were 2 errors compiling module, 
>> stopping
>>
>> Line 20 is the
>> end.
>> of th lpr.
>> No components have been used yet neither any unit from the new package.
>> I didn't find any solution for it on the net and removing *.ppu and 
>> *.o does not solve the problem.
>> Neither does the change from {$mode objfpc} (my default) to {$mode 
>> DELPHI}.
>> Removing debug options in linker doe not solve the problem.
>> There are no other *.ppu nor *.o from the package anywhere in the 
>> target PC.
>
> Do you include the unit UIBDATASET in the uses clause?
yes
>
> Do you actually use something from the unit ?
yes, a dropped component from uib component palette, nothing else
>
> if not, try to do so.
>
> It looks like the compiler decided that the UIBDATASET unit uses 
> threadvars, and includes them in the global list of threadvars, but 
> then sees that you
> don't actually use the unit, so does not include the unit in the link
> script.
>
sounds reasonnable

I have restarted a new project doing this:
1. create a new application
drop a close button and add into the event onclick: Close;
Compile & run ok
2. add uiblaz package to project
compile & run: OK 8-)
3. drop TUibDatabse, TUibTransaction, TUibQuery
compile & run: OK
4. implement whatever the test program needs (query execute for read and 
update data including firebird arrays for which I changed the unit uiblib)
compile & run: OK
So far so good.
5.  add the unit uibdataset to the interfacse uses clause and guess what:
Hint: Start of reading config file 
D:\Programmes\lazarus\fpc\2.6.1\bin\i386-win32\fpc.cfg
Hint: End of reading config file 
D:\Programmes\lazarus\fpc\2.6.1\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.6.1 [2012/04/26] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling TestUIB.lpr
Compiling TestUIBMain.pas
...
TestUIBMain.pas(50,30) Hint: Parameter "Sender" not used
TestUIBMain.pas(18,3) Hint: Unit "uibdataset" not used in TestUIBMain
sounds of as far as I do not use anything from it
Compiling resource D:\Compiled\Lazarus\DCU\TestUIB.or
Linking D:\Compiled\Lazarus\TestUIB.exe
TestUIB.lpr(20,1) Error: Multiple defined symbol PASCALMAIN
TestUIB.lpr(20,1) Error: Multiple defined symbol _main
TestUIB.lpr(20,1) Error: Multiple defined symbol INITFINAL
TestUIB.lpr(20,1) Error: Multiple defined symbol FPC_THREADVARTABLES
TestUIB.lpr(20,1) Error: Multiple defined symbol FPC_RESOURCESTRINGTABLES
TestUIB.lpr(20,1) Error: Multiple defined symbol FPC_WIDEINITTABLES
TestUIB.lpr(20,1) Error: Multiple defined symbol __heapsize
TestUIB.lpr(20,1) Error: Multiple defined symbol __fpc_valgrind
TestUIB.lpr(20,1) Error: Undefined symbol: THREADVARLIST_UIBDATASET
TestUIB.lpr(20,1) Error: Undefined symbol: DEBUGINFO_UIBDATASETMAIN
TestUIB.lpr(20,1) Error: Undefined symbol: DEBUGSTART_UIBDATASETMAIN
TestUIB.lpr(20,1) Error: Undefined symbol: DEBUGEND_UIBDATASETMAIN
TestUIB.lpr(20,1) Error: Undefined symbol: THREADVARLIST_UIBDATASETMAIN
TestUIB.lpr(20,1) Error: Undefined symbol: U_UIBDATASETMAIN_FORM1
TestUIB.lpr(20,1) Error: Undefined symbol: VMT_UIBDATASETMAIN_TFORM1
TestUIB.lpr(20,1) Fatal: There were 15 errors compiling module, stopping

6. drop a TUibDataset
Options changed, recompiling clean with -B
Hint: Start of reading config file 
D:\Programmes\lazarus\fpc\2.6.1\bin\i386-win32\fpc.cfg
Hint: End of reading config file 
D:\Programmes\lazarus\fpc\2.6.1\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.6.1 [2012/04/26] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling TestUIB.lpr
Compiling TestUIBMain.pas
...
TestUIBMain.pas(51,30) Hint: Parameter "Sender" not used
Compiling resource D:\Compiled\Lazarus\DCU\TestUIB.or
Linking D:\Compiled\Lazarus\TestUIB.exe
TestUIB.lpr(20,1) Error: Multiple defined symbol PASCALMAIN
TestUIB.lpr(20,1) Error: Multiple defined symbol _main
TestUIB.lpr(20,1) Error: Multiple defined symbol INITFINAL
TestUIB.lpr(20,1) Error: Multiple defined symbol FPC_THREADVARTABLES
TestUIB.lpr(20,1) Error: Multiple defined symbol FPC_RESOURCESTRINGTABLES
TestUIB.lpr(20,1) Error: Multiple defined symbol FPC_WIDEINITTABLES
TestUIB.lpr(20,1) Error: Multiple defined symbol __heapsize
TestUIB.lpr(20,1) Error: Multiple defined symbol __fpc_valgrind
TestUIB.lpr(20,1) Error: Undefined symbol: THREADVARLIST_UIBDATASET
TestUIB.lpr(20,1) Error: Undefined symbol: VMT_UIBDATASET_TUIBDATASET
TestUIB.lpr(20,1) Error: Undefined symbol: VMT_UIBDATASET_TUIBCUSTOMDATASET
TestUIB.lpr(20,1) Error: Undefined symbol: DEBUGINFO_UIBDATASETMAIN
TestUIB.lpr(20,1) Error: Undefined symbol: DEBUGSTART_UIBDATASETMAIN
TestUIB.lpr(20,1) Error: Undefined symbol: DEBUGEND_UIBDATASETMAIN
TestUIB.lpr(20,1) Error: Undefined symbol: THREADVARLIST_UIBDATASETMAIN
TestUIB.lpr(20,1) Error: Undefined symbol: U_UIBDATASETMAIN_FORM1
TestUIB.lpr(20,1) Error: Undefined symbol: VMT_UIBDATASETMAIN_TFORM1
TestUIB.lpr(20,1) Fatal: There were 17 errors compiling module, stopping

In project options, generate debug data is checked,
debugger is set to automatic
heaptrc is NOT checked,
valgrind output is NOT checked

changing to dwarf debugger does not change anything

Antonio.

> Michael.
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>






More information about the Lazarus mailing list