24 March 2018, 00:08 | #1 |
Registered User
Join Date: Mar 2018
Location: Prague
Posts: 35
|
VBCC problem with standard variable types
Hi!
I'm trying to get cross compiler / VBCC working on Mac. My intention is to write code for A500. If I compile a very simple C program which simply displays text with printf(), everything seems to compile and run just fine. But if I try to use any of the standard variable types (char/short/int, signed or unsigned), I get the following warnings and errors: vc +kick13 -o hello hello.c > int warning 216 in line 7 of "hello.c": illegal use of keyword <int> > int a warning 216 in line 7 of "hello.c": illegal use of keyword <int> > int a error 82 in line 7 of "hello.c": unknown identifier <int> > int a warning 54 in line 7 of "hello.c": ; expected > int a = 6; error 82 in line 7 of "hello.c": unknown identifier <a> 2 errors found! vbccm68k -quiet -hunkdebug "hello.c" -o= "/var/tmp/tmp.0.asm" -O=1 -I$VBCC/targets/m68k-kick13/include failed Here's the whole code: #include <stdio.h> int main() { printf("Testing...\n"); int a = 6; return 0; } Any ideas what went wrong with the installation process? I followed (more or less accurately) these instructions: https://blitterstudio.com/setting-up...ross-compiler/ I got the latest target and unix config files from here: http://server.owl.de/~frank/vbcc/2017-08-14/ Some extra information: 1. I had to modify the kick13 file by removing the "-no-cpp-warn". The compiler didn't recognise this flag for some reason. 2. I got lots of warnings but no errors while compiling the VBCC. I got warnings when the makefile asked all about little/big endianess and during actual compilation. 3. For the makefile's "questionnaire" I tried using default answers, big endianness and little endianness. All gave the same results. A little help would be much appreciated! |
24 March 2018, 00:16 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
VBCC defaults to C89, compile it as C99 with the -c99 argument.
|
24 March 2018, 01:11 | #3 |
Registered User
Join Date: Mar 2018
Location: Prague
Posts: 35
|
Hey, now it works. Thanks!
|
24 March 2018, 10:37 | #4 |
Registered User
Join Date: Mar 2018
Location: Prague
Posts: 35
|
I still seem to have one more mystery to solve:
By default, the compiler doesn't find the following include files: #include <proto/dos.h> #include <proto/exec.h> I assume I need to either add the target's include and lib directories to some environment variable or add some extra flag for the compiler. I can't seem to find an answer from the internet. Last edited by Crank; 24 March 2018 at 10:51. |
24 March 2018, 13:51 | #5 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
The VBCC environment variable is probably not set, try running
launchctl setenv VBCC /path/to/vbccon the command line. |
24 March 2018, 22:46 | #6 | |||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
http://server.owl.de/~frank/tags/vbcc0_9fP1.tar.gz IIRC, -no-cpp-warn is needed for many of Commodore's Kickstart 1.x headers, which were probably K&R C and not even compatible to C89 standards. Quote:
Quote:
So when being asked if your system/compiler implements a big-endian type you will reply 'n' and then 'y' for the little-endian types. Usually you just have to press enter and take the default for all questions, as dtgen is smart enough to determine all types correctly. |
|||
25 March 2018, 13:38 | #7 | |
Registered User
Join Date: Mar 2018
Location: Prague
Posts: 35
|
Quote:
/opt/vbcc That is where I have the following folders with no other files/folders: bin/ config/ targets/ |
|
25 March 2018, 13:48 | #8 | ||
Registered User
Join Date: Mar 2018
Location: Prague
Posts: 35
|
Quote:
vc +kick13 -o hello hello.c >#include <exec/types.h> error 248 in line 5 of "proto/exec.h": file 'exec/types.h' not found included from file "hello.c":1 1 error found! vbccm68k -quiet -c99 -no-cpp-warn -hunkdebug "hello.c" -o= "/var/tmp/tmp.0.asm" -O=1 -I$VBCC/targets/m68k-kick13/include failed Quote:
|
||
25 March 2018, 16:42 | #9 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
https://www.dropbox.com/s/5kougfenyw...ndk13.lha?dl=1 https://www.dropbox.com/s/2moala3whq...NDK39.lha?dl=1 Add the include_h path to your config files with -I"$VBCC/ndk1.3/Includes1.3/include_h/"or similar, after the argument that points to $VBCC/targets/m68k-kick13/ Use the 3.9 NDK for the other configs. |
|
26 March 2018, 18:36 | #10 |
Registered User
Join Date: Mar 2018
Location: Prague
Posts: 35
|
Ah, for some reason I was under the impression that NDK was only for the more modern Amigas. After installing NDK things started working fine
Now I have a hybrid C & ASM project going and basic initializations done (copied shamelessly the init code from other sources to get going as soon as possible). Many thanks to everyone for helping me get started! |
01 April 2018, 10:00 | #11 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Make sure to use the 1.3 NDK with the kick13 config and the 3.9 or 3.1 NDK with aos68k. Do not use the latest NDK for both!
|
01 April 2018, 19:31 | #12 |
Registered User
Join Date: Mar 2018
Location: Prague
Posts: 35
|
Yep, got 1.3 NDK installed. Seems to work fine now
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vbcc bind a variable to a register | iliak | Coders. Asm / Hardware | 6 | 31 July 2016 12:29 |
Join variable and string in scripts. | olesio | support.Apps | 3 | 31 January 2013 11:44 |
Speedy. The variable speed accellerator. | DDNI | Hardware mods | 9 | 18 June 2012 21:33 |
NTSC variable-length scanlines | TheDarkCoder | Coders. Asm / Hardware | 3 | 23 November 2011 15:51 |
Variable Master Clock | wiltshireguyuk | request.UAE Wishlist | 0 | 13 December 2004 16:40 |
|
|