English Amiga Board


Go Back   English Amiga Board > News

 
 
Thread Tools
Old 25 March 2018, 19:47   #41
plasmab
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
Quote:
Originally Posted by Leffmann View Post
It looks like it's not finding everything it needs from amiga.lib, but I'm not sure. Try separating the M68K target and NDK headers and libraries, and let the M68K target directories have priority. That's how I've set mine up, and the program builds without errors here.
They are separate. One is located at $(NDK_LIBS) and one is under $(VBCC)/argets/m68k-amigaos/lib/ (which is defined in the config).

How is priority between those figured out?
plasmab is offline  
Old 25 March 2018, 19:48   #42
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,993
In adding -lauto you removed -lamiga.
Hedeon is offline  
Old 25 March 2018, 19:49   #43
plasmab
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
My config file looks like..

Quote:
-cc=vbccm68k -quiet -hunkdebug %s -o= %s %s -O=%ld -I$VBCC/targets/m68k-amigaos/include
-ccv=vbccm68k -hunkdebug %s -o= %s %s -O=%ld -I$VBCC/targets/m68k-amigaos/include
-as=vasmm68k_mot -quiet -Fhunk -phxass -opt-fconst -nowarn=62 %s -o %s
-asv=vasmm68k_mot -Fhunk -phxass -opt-fconst -nowarn=62 %s -o %s
-rm=rm -f %s
-rmv=rm %s
-ld=vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -mrel $VBCC/targets/m68k-amigaos/lib/startup.o %s %s -L$VBCC/targets/m68k-amigaos/lib -lvc -o %s
-l2=vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -mrel %s %s -L$VBCC/targets/m68k-amigaos/lib -o %s
-ldv=vlink -bamigahunk -t -x -Bstatic -Cvbcc -nostdlib -mrel $VBCC/targets/m68k-amigaos/lib/startup.o %s %s -L$VBCC/targets/m68k-amigaos/lib -lvc -o %s
-l2v=vlink -bamigahunk -t -x -Bstatic -Cvbcc -nostdlib -mrel %s %s -L$VBCC/targets/m68k-amigaos/lib -o %s
-ldnodb=-s -Rshort
-ul=-l%s
-cf=-F%s
-ml=1000
plasmab is offline  
Old 25 March 2018, 19:50   #44
plasmab
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
Quote:
Originally Posted by Hedeon View Post
In adding -lauto you removed -lamiga.
Boc! Yes. I had them in my head as mutually exclusive. Fixed.
plasmab is offline  
Old 25 March 2018, 20:49   #45
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by plasmab View Post
They are separate. One is located at $(NDK_LIBS) and one is under $(VBCC)/argets/m68k-amigaos/lib/ (which is defined in the config).

How is priority between those figured out?
Not at all. Don't use the linker libraries from the NDK! vbcc's amiga.lib is a complete replacement.

And is there in any reason to call vlink directly? Usually this is done via the frontend "vc", which gets all the required options and paths from the config file.
Code:
vc +aos68k test.o -lauto -lamiga
phx is offline  
Old 25 March 2018, 21:39   #46
plasmab
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
Quote:
Originally Posted by phx View Post
Not at all. Don't use the linker libraries from the NDK! vbcc's amiga.lib is a complete replacement.

And is there in any reason to call vlink directly? Usually this is done via the frontend "vc", which gets all the required options and paths from the config file.
Code:
vc +aos68k test.o -lauto -lamiga
I'm actually linking some C and ASM together. Normally do the vc thing. even then i'd need to know to use auto and amiga together.. feels like auto should imply -lamiga.. is there a case where you wouldnt want that ?
plasmab is offline  
Old 25 March 2018, 22:10   #47
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by plasmab View Post
feels like auto should imply -lamiga.. is there a case where you wouldnt want that ?
Including amiga.lib into auto.lib wastes disk space with redundant data. And when using the assembler inlines from proto/xyz.h to call library functions you often don't have to link with amiga.lib at all.
phx is offline  
Old 25 March 2018, 22:16   #48
plasmab
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
Quote:
Originally Posted by phx View Post
Including amiga.lib into auto.lib wastes disk space with redundant data. And when using the assembler inlines from proto/xyz.h to call library functions you often don't have to link with amiga.lib at all.
Ok fair enough.
plasmab is offline  
Old 01 April 2018, 09:26   #49
plasmab
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
OK i have a request / question about some of the new features in vbcc. The +aos68kr target seems like a great idea but i'm struggling to use it and it seems to be short on docs because its relatively new.

What i am trying to do?

Create an amiga kernel module in C...

I've managed to create the module but I cannot open any libraries in the vbcc compiled module without causing a crash. I figured that was because i need to keep my DosBase, SysBase etc as a local variable rather than a global but the linker complained about missing _SysBase and _DosBase when compiled with +aos68k(m). But when i try with +aos68kr the linker segmentation faults.

Any ideas? Latest stable versions of all the tools.

EDIT: I am not using -lauto or -lvc ... just -lamiga and trying to open graphics.library.
plasmab is offline  
Old 01 April 2018, 11:33   #50
plasmab
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
Ok i solved my issue...

I need to use explicit __OpenLibrary(mySysBase, "graphics.library");

rather than the nice handy OpenLibrary() method.

I wonder if there should be (if there isnt already) a set of standard proto headers to make module / library development easier. There is so little docs on this that i found figuring this out extremely painful. What docs there are focus on SAS/C.
plasmab is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
vbcc IDE iliak Coders. C/C++ 23 23 April 2019 17:27
vbcc V0.9e released phx News 17 31 October 2016 21:18
vbcc 0.9d phx News 43 13 July 2015 19:41
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 14:45
Compiler: vbcc 0.8g patch 2 released Paul News 0 29 November 2004 15:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:17.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07616 seconds with 13 queries