English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 26 May 2020, 12:38   #1
Jherek Carnelia
Dazed and Confused
 
Jherek Carnelia's Avatar
 
Join Date: Dec 2001
Location: portsmouth/uk
Posts: 242
Struggling with vbcc

Firstly I am only used to using an IDE where I press a button and a file is created and I can run it. However now I'm on furlough I thought I'd try to set up a cross compiling environment.

I downloaded the binaries for using vbcc from the internet (Blitter studio) and followed the instructions for setting up the folders and environment etc using the same path as in the example.

I can create the obligatory Hello World! and I get a file that, when copied to WinUAE, works. So far so good.

Next I tried an example from the RKMs, but I can't create a file. It seems to be a linker issue, but as I don't really know what I'm doing, I don't know how to fix it!

This is a sample of the errors I get (I've removed a few because I guess that they are referring to the same issue):

c:\vbcc>vc -o simplegadget simplegadget.c
>{
warning 121 in line 70 of "simplegadget.c": return type of main is not int
\Users\Me\AppData\Local\Temp\vbcc068c.o: In "_main":
Error 21: \Users\Me\AppData\Local\Temp\vbcc068c.o (CODE+0xa): Reference to undefined symbol _OpenLibrary.
\Users\Me\AppData\Local\Temp\vbcc068c.o: In "l3":
Error 21: \Users\Me\AppData\Local\Temp\vbcc068c.o (CODE+0x22): Reference to undefined symbol _OpenLibrary.
\Users\Me\AppData\Local\Temp\vbcc068c.o: In "l6":
\Users\Me\AppData\Local\Temp\vbcc068c.o: In "l40":
Error 21: \Users\Me\AppData\Local\Temp\vbcc068c.o (CODE+0x29a): Reference to undefined symbol _GT_GetIMsg.
vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib "C:\vbcc/targets/m68k-amigaos/lib/startup.o" "C:\Users\Me\AppData\Local\Temp\vbcc068c.o" -s -Rshort -L"C:\vbcc/targets/m68k-amigaos/lib/" -lvc -o simplegadget failed


If someone could point out where I'm going wrong, I would be grateful!
Jherek Carnelia is offline  
Old 26 May 2020, 12:48   #2
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,994
-lamiga

You need to link to the vbcc amiga library for amiga OS functions.
Hedeon is offline  
Old 26 May 2020, 13:01   #3
Jherek Carnelia
Dazed and Confused
 
Jherek Carnelia's Avatar
 
Join Date: Dec 2001
Location: portsmouth/uk
Posts: 242
Ah okay, thank you!

Not sure how to do that though. Can you give me an example of the line/s I need to add to the vc.cfg file, please?
Jherek Carnelia is offline  
Old 26 May 2020, 14:10   #4
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,994
Most simple to test would be

c:\vbcc>vc -lamiga -o simplegadget simplegadget.c

if the library is in the same spot as the vc library (which is called with -lvc automatically through the config file).
Hedeon is offline  
Old 26 May 2020, 14:26   #5
Jherek Carnelia
Dazed and Confused
 
Jherek Carnelia's Avatar
 
Join Date: Dec 2001
Location: portsmouth/uk
Posts: 242
Brilliant that worked a treat! Thank you for your help.

Just need to study the manuals now...
Jherek Carnelia is offline  
Old 29 May 2020, 18:35   #6
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Hedeon View Post
c:\vbcc>vc -lamiga -o simplegadget simplegadget.c
Note, that the position of the library on the command line matters. For example to override/replace functions from it. It is recommended to specify libraries last.
phx is offline  
Old 29 May 2020, 20:06   #7
Jherek Carnelia
Dazed and Confused
 
Jherek Carnelia's Avatar
 
Join Date: Dec 2001
Location: portsmouth/uk
Posts: 242
That's good to know. I'll do it that way from now on. Couldn't see where it said that in the manual?
Jherek Carnelia is offline  
Old 30 May 2020, 15:26   #8
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Sorry. Forget what I said! It only matters when you call vlink directly.
When using the vc frontend it makes sure that -l libraries appear after the object files for the vlink-call. But it's a good habit nevertheless.
phx 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
new user struggling minke New to Emulation or Amiga scene 25 26 December 2014 13:20
Game identification (Really struggling!) dnfrd Looking for a game name ? 10 11 December 2014 18:46
8gb CF card - Struggling gazj82 support.Hardware 11 11 September 2014 08:20
I'm new to all this - struggling with Cloanto Jim support.WinUAE 228 17 November 2013 21:58
Struggling with ClassicWB :( Geon106 support.WinUAE 3 28 March 2013 15:04

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:27.

Top

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