10 August 2022, 18:27 | #1 |
Registered User
Join Date: Jul 2014
Location: Warsaw/Poland
Posts: 171
|
VBCC Reference to undefined symbol __ctors / __dtors
Hi All,
I have faced an issue with VBCC and undefined symbol __ctors / __dtors. I've tried a simple example like Hello World and more advanced example with window/gadget management and they show the same errors. This is my first attempt to code Amiga with C, and unfortunately I have no idea how to fix that. Thanks I use VBCC (vbcc_bin_win64.zip from http://sun.hasenbraten.de/vbcc/ ) Sources for Target is taken from: https://github.com/deplinenoise/amiga-sdk My command line: vc.exe +amigasdk -cpu=68000 hello.c -o hello Error messages for C code below: Code:
vc.lib(_main.c): In "__main": Error 21: vc.lib(_main.c) (CODE+0xb6): Reference to undefined symbol __ctors. vc.lib(_main.c): In "__Exit": Error 21: vc.lib(_main.c) (CODE+0x6): Reference to undefined symbol __dtors. Error 21: vc.lib(_main.c) (CODE+0xc): Reference to undefined symbol __dtors. vc.lib(stdlib/malloc.c): In "_malloc": Error 21: vc.lib(stdlib/malloc.c) (CODE+0x64): Reference to undefined symbol _LibAllocPooled. Error 21: vc.lib(stdlib/malloc.c) (CODE+0x3c): Reference to undefined symbol _LibCreatePool. vc.lib(stdlib/malloc.c): In "__freemem": Error 21: vc.lib(stdlib/malloc.c) (CODE+0x10): Reference to undefined symbol _LibDeletePool. vc.lib(stdlib/malloc.c): In "_free": Error 21: vc.lib(stdlib/malloc.c) (CODE+0xa6): Reference to undefined symbol _LibFreePooled. vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -L"%VBCC%/targets/amiga-sdk-master/clib" -Z -mrel "%VBCC%/targets/amiga-sdk-master/clib/startup.o" "C:\TEMP\vbcc068c.o" -s -Rshort -lvc -o hello failed Press any key to continue . . . Code:
#include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello, World!"); return 0; } Code:
-cc=vbccm68k -D__AMIGA__ -D__VBCC__ -quiet %s -o= %s %s -O=%ld -I"%%VBCC%%/targets/amiga-sdk-master/sdkinclude" -I"%%VBCC%%/targets/amiga-sdk-master/netinclude" -ccv=vbccm68k -D__AMIGA__ -D__VBCC__ %s -o= %s %s -O=%ld -I"%%VBCC%%/targets/amiga-sdk-master/sdkinclude" -I"%%VBCC%%/targets/amiga-sdk-master/netinclude" -as=vasmm68k_mot -quiet -Fhunk -phxass %s -o %s -I"%%VBCC%%/targets/amiga-sdk-master/sdkinclude" -asv=vasmm68k_mot -Fhunk -phxass %s -o %s -I"%%VBCC%%/targets/amiga-sdk-master/sdkinclude" -rm=del /f %s -rmv=del /f %s -ld=vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/amiga-sdk-master/clib" -Z -mrel "%%VBCC%%/targets/amiga-sdk-master/clib/startup.o" %s %s -lvc -o %s -l2=vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/amiga-sdk-master/clib" %s %s -o %s -ldv=vlink -bamigahunk -t -x -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/amiga-sdk-master/clib" "%%VBCC%%/targets/amiga-sdk-master/clib/startup.o" %s %s -lvc -o %s -l2v=vlink -bamigahunk -t -x -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/amiga-sdk-master/clib" %s %s -o %s -ldnodb=-s -Rshort -ul=-l%s -cf=-F%s -ml=500 |
10 August 2022, 20:52 | #2 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
There may have been some changes since then. One of them was that vlink renamed __ctorsto ___ctors. Probably for SAS/C-compatibility. |
|
10 August 2022, 22:36 | #3 |
Registered User
Join Date: Jul 2014
Location: Warsaw/Poland
Posts: 171
|
|
10 August 2022, 23:10 | #4 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Right on top of the vbcc release page, you find:
|
10 August 2022, 23:39 | #5 |
Registered User
Join Date: Jul 2014
Location: Warsaw/Poland
Posts: 171
|
thanks
, now I see following error message: Code:
error 248 in line 5 of "proto\intuition.h": file 'exec\types.h' not found I have an access to NDK13 / NDK3.2 / NDK39. Should I copy one of them INCLUDE folder to "\vbcc_target_m68k-amigaos\targets\m68k-amigaos"? ----EDIT---- fixed, I've just copied NDK3.2 includes and added " +aos68k -lamiga -lauto" to vc.exe commandline Last edited by Cyprian; 11 August 2022 at 00:13. |
11 August 2022, 14:00 | #6 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Quote:
-I...into your config file. BTW, NDK13 is not recommended for m68k-amigaos. You should use the m68k-kick13 target with it. |
||
11 August 2022, 22:59 | #7 |
Registered User
Join Date: Jul 2014
Location: Warsaw/Poland
Posts: 171
|
thanks @phx
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vasm / vlink undefined symbol | zeGouky | Coders. General | 2 | 02 January 2019 08:49 |
Using libraries with VBCC (Undefined Symbol) | NoBrain2k | Coders. C/C++ | 7 | 03 July 2018 12:02 |
Reference to undefined symbol __ldivu / __lmodu | iliak | Coders. C/C++ | 8 | 25 July 2016 00:01 |
AsmOne: Undefined symbol | copse | Coders. Asm / Hardware | 2 | 02 April 2012 01:41 |
Undefined symbol bsr.b init_bitmaps | VoltureX | Coders. General | 12 | 13 November 2011 16:11 |
|
|