English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 02 February 2019, 03:52   #1
Ledfoot
Registered User
 
Join Date: Oct 2018
Location: Cherry Hill, NJ USA
Posts: 85
What am I doing wrong?

Hey gang,

Have an A500 here with a new Vampire V2+ board in it, running the Coffin R54 image.

I thought I would try to get my feet wet with a little Amiga programming and ran across this web site that I felt was really helpful in laying out the basics on pretty much all the important topics for application programming:

http://www.pjhutchison.org/tutorial/graphics.html

I copied the simple_project folder from the SAS/C in Programs/Programming/SASC/SASC to my personal files directory, renamed it to "lines" and then copied/pasted the first code example from that page into a new file named lines.c

Ran the SASC_startup script which should have set up all the paths and such. Then ran the SCOPTIONS from my project's directory and set the output name to "lines".

Running the BUILD tool from my project folder spits out the following:

lines.c: Error 9 in lines.c line 31: undefined identifier "IntuitionBase"


This has me thinking that it's not finding the libraries?

Anybody have any ideas on how I can fix this? I get the exact same error trying the second example on that page in a new project as well. :

Thanks for any help!
Ledfoot is offline  
Old 02 February 2019, 07:35   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Are you linking in Amiga.lib or Amigas.lib?
Samurai_Crow is offline  
Old 02 February 2019, 10:01   #3
Ledfoot
Registered User
 
Join Date: Oct 2018
Location: Cherry Hill, NJ USA
Posts: 85
Not that I know of. First time using SASC here. How do I set that up? I assume through the SCOPTIONS program?
Ledfoot is offline  
Old 02 February 2019, 10:19   #4
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
If you want to build from the command line then
sc lines.c to lines link
is sufficient.

You can also set up an empty project with
scsetup work:project
and drop your source files there. Usually the program will build correctly by just clicking the build icon.
Leffmann is offline  
Old 02 February 2019, 16:22   #5
Ledfoot
Registered User
 
Join Date: Oct 2018
Location: Cherry Hill, NJ USA
Posts: 85
Quote:
Originally Posted by Leffmann View Post
If you want to build from the command line then
sc lines.c to lines link
is sufficient.

You can also set up an empty project with
scsetup work:project
and drop your source files there. Usually the program will build correctly by just clicking the build icon.

Just tried from the command line like you said - same error message.

I went into SCOpts and turn on linking and set the startup=c option which the instructions on that site said..

This seems to be in the compile phase, which makes me believe it's not seeing the required amiga header files... But I just double checked and SASC paths are all set - include: cxxinclude: lib: They're all there and set properly. I see the Amiga.lib inside of lib:

:
Ledfoot is offline  
Old 02 February 2019, 18:17   #6
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
If you add
lib:amiga.lib
like Sam Crow says then?

You could also declare all the library bases and open them explicitly. Minus error checking etc.:
Code:
#include <intuition/intuitionbase.h>
#include <graphics/gfxbase.h>

struct IntuitionBase *IntuitionBase;
struct Library *GadToolsBase;
struct GfxBase *GfxBase;

IntuitionBase = (void*)OpenLibrary("intuition.library", 36);
GadToolsBase = (void*)OpenLibrary("gadtools.library", 36);
GfxBase = (void*)OpenLibrary("graphics.library", 36);
It also works fine if you use a full and correct install of SAS/C 6.58:
http://eab.abime.net/showpost.php?p=1079045&postcount=7
Leffmann is offline  
Old 02 February 2019, 18:55   #7
Ledfoot
Registered User
 
Join Date: Oct 2018
Location: Cherry Hill, NJ USA
Posts: 85
Quote:
Originally Posted by Leffmann View Post
If you add
lib:amiga.lib
like Sam Crow says then?

You could also declare all the library bases and open them explicitly. Minus error checking etc.:
Code:
#include <intuition/intuitionbase.h>
#include <graphics/gfxbase.h>

struct IntuitionBase *IntuitionBase;
struct Library *GadToolsBase;
struct GfxBase *GfxBase;

IntuitionBase = (void*)OpenLibrary("intuition.library", 36);
GadToolsBase = (void*)OpenLibrary("gadtools.library", 36);
GfxBase = (void*)OpenLibrary("graphics.library", 36);
It also works fine if you use a full and correct install of SAS/C 6.58:
http://eab.abime.net/showpost.php?p=1079045&postcount=7


Ok, this was helpful!

* fixed the link to be lib:amiga.lib
Then tried the code snippets you suggested. Turns out if I just added in the 3 structure pointer declarations that got it to work (I do get warnings about uninitialized pointers, but that's ok since I don't use them at all.) Didn't need the imports or the OpenLibrary calls (from what I understand using the #include <proto> lines up at the top will cause the compiler to automatically do the opens for you, or at least that's what the author of that site claims. Still don't get how creating a variable gets this to work though.

Weird that that got it to work.

And it is a full 6.58 install already on the coffin image...
Ledfoot 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
What am I doing wrong? Brick Nash support.WinUAE 18 09 March 2017 03:28
What am I doing wrong here? TroyWilkins project.ClassicWB 27 14 August 2016 11:10
What am I doing wrong? \\.\ support.Other 6 20 December 2015 14:24
What am I doing wrong? NLS project.Killergorilla's WHD packs 6 07 January 2008 09:48
What am I doing Wrong? RMadrid New to Emulation or Amiga scene 45 31 March 2005 15:59

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 17:07.

Top

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