[英]cygwin 64 library: undefined reference, relocation truncated to fit: R_X86_64_PC32 against undefined symbol
[英]relocation truncated to fit: R_X86_64_PC32 against undefined symbol `cfree'
我試圖在Cygwin
為Win64
編譯C4.5
算法。 我有錯誤
besttree.o:besttree.c:(.text+0x240): undefined reference to `cfree'
besttree.o:besttree.c:(.text+0x240): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `cfree'
當我查看besttree.c時,我發現
FormTarget(Size)
/* ----------- */
ItemNo Size;
{
ItemNo i, *ClassFreq;
ClassNo c, Smallest, ClassesLeft=0;
ClassFreq = (ItemNo *) calloc(MaxClass+1, sizeof(ItemNo));
while ( ClassesLeft )
{
/* Find least common class of which there are some items */
Smallest = -1;
ForEach(c, 0, MaxClass)
{
if ( ClassFreq[c] &&
( Smallest < 0 || ClassFreq[c] < ClassFreq[Smallest] ) )
{
Smallest = c;
}
}
/* Allocate the no. of items of this class to use in the window */
TargetClassFreq[Smallest] = Min(ClassFreq[Smallest], Round(Size/ClassesLeft));
ClassFreq[Smallest] = 0;
Size -= TargetClassFreq[Smallest];
ClassesLeft--;
}
cfree(ClassFreq);
}
此編譯可能是什么問題? 是因為在Cygwin for Win64中進行編譯? 我也找不到cfree api的來源。 謝謝
我的經驗是C4.5無法在Cygwin中進行編譯,因為Cygwin不具備Linux中的完整庫。 因此,我在Windows計算機中將Ubuntu安裝為虛擬OS。 然后,我可以成功編譯。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.