English Amiga Board


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

 
 
Thread Tools
Old 18 October 2014, 13:17   #1
Yesideez
(2b)||!(2b)
 
Yesideez's Avatar
 
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
Compile problems with VBCC

Hi, been wanting to learn some variant of C on the Amiga for years, finally decided to and hit a problem.

Something like this:
Code:
#include <stdio.h>

int main() {
  printf("Hello world\n");
}
I can compile that just fine with: vc helloworld.c -o helloworld

The problem comes when I try to use anything in proto/ instead of stdio.h

This program:
Code:
#include <proto/exec.h>
#include <proto/dos.h>

struct DosLibrary *DOSBase;

int main() {
  if (DOSBase=(struct DosLibrary *)OpenLibrary("dos.library",0)) {
    Write(Output(),"Hello world!\n",14);
    CloseLibrary((struct Library *)DOSBase);
  }
  return 0;
}
I try and compile using this: vc -sc -sd -O2 //targets/m68k-amigaos/lib/minstart.o helloworld.c -o helloworld -nostdlib

The error messages I get are contained within the attachment.

I've got the NDK3.9 includes installed.
Attached Files
File Type: txt errors.txt (46.3 KB, 231 views)
Yesideez is offline  
Old 18 October 2014, 13:34   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Must be something wrong with your installation. For me it compiles without any errors.

Code:
2> ed helloworld.c
Work:Entwicklung/Sources
2> vc -sc -sd -O2 vbcc:targets/m68k-amigaos/lib/minstart.o helloworld.c -o helloworld -nostdlib
Work:Entwicklung/Sources
2> helloworld
Hello world!
Work:Entwicklung/Sources
2>
Do you cross-compile from a non-68k platform? Then try vc +aos68k instead of just vc. The default target always is the host platform.
thomas is offline  
Old 18 October 2014, 13:57   #3
Yesideez
(2b)||!(2b)
 
Yesideez's Avatar
 
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
I installed the package using the installer and installed the update which was just a case of copying two files over.

I tried compiling a program and it failed. I installed the 68mamigaos target and it compiled fine.

Should I have done somethign different?

Attachment is my directory structure.
Attached Files
File Type: txt dirstructure.txt (8.5 KB, 189 views)
Yesideez is offline  
Old 18 October 2014, 14:19   #4
Yesideez
(2b)||!(2b)
 
Yesideez's Avatar
 
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
I've fixed it!

Turned out to be an assign that was defined when SAS/C was installed. When I installed VBCC an assign it added into my bootup was this:
Code:
assign >NIL: vincludeos3: "include:" add
I needed to change it to this:
Code:
assign >nil: vincludeos3: Coding:NDK_3.9/Include/include_h add
Thanks for helping - would probably have been a lot later to realise my install wasn't quite correct had you not have pointed it out
Yesideez is offline  
Old 18 October 2014, 15:47   #5
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
NEVER install in Novice mode!! Nothing!
thomas is offline  
Old 18 October 2014, 16:44   #6
Yesideez
(2b)||!(2b)
 
Yesideez's Avatar
 
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
I didn't.
Yesideez is offline  
Old 18 October 2014, 17:59   #7
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Then you didn't read the text when it asked you where the OS includes are.
thomas is offline  
Old 18 October 2014, 23:04   #8
Yesideez
(2b)||!(2b)
 
Yesideez's Avatar
 
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
There was no default - nothing would compile. I had to install the target.
Yesideez is offline  
Old 18 October 2014, 23:23   #9
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Sure. You have to install a binary and at least one target. During installation of the 68k target you were asked where the OS includes are. You should have pointed it to NDK_3.9/include/include_h, not to include: .

Anyway, if you install the 68k binary, the default target is aos68k. If you install the OS4 PPC binary, the default target is aosppc. And so on. If you didn't install the respective target you'll get a "no config file" error unless you select another target (one that is installed) by the +target option.
thomas is offline  
Old 18 October 2014, 23:38   #10
Yesideez
(2b)||!(2b)
 
Yesideez's Avatar
 
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
Ah!

When installing softwar via the installer I always go for expert mode
Yesideez 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
Help with compile JimDrew Coders. Language 23 30 October 2014 22:42
How compile WinUAE... WCoder support.WinUAE 57 17 April 2014 17:42
GFA compile xc8 Coders. General 31 19 May 2009 18:21
VBCC 0.8j for Windows hitchhikr Coders. General 11 09 October 2008 00:58
Compile WinUAE ????? Myriel support.WinUAE 14 10 January 2004 17:06

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 10:24.

Top

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