BartmanAbyss / vscode-amiga-debug

One-stop Visual Studio Code Extension to compile, debug and profile Amiga C/C++ programs compiled by the bundled gcc 12.2 with the bundled WinUAE/FS-UAE.
GNU General Public License v3.0
315 stars 39 forks source link

More documentation #3

Closed Azvareth closed 4 years ago

Azvareth commented 4 years ago

Hi!

Perhaps not the right place, or the right forum even.

I am new to C on Amiga (emulated), and would like to test it. I found your(s) excelent work here, it looks nice, uses visual studio code which is a nice editor...

I did some tests, opened a few windows and wrote Hello World as one should, after some changes and added includes (like missing rexx if you include alib_proto.h) it worked.

However, for me I am stuck and mostly that depends on missing documantation or the inability to find the right docs.

I also tried to do an Hello World with MUI and this is why I am adressing this topic, I got completely stucked, MUI apparantly wish to call a routine called DoMethod, I scanned the whole MUI NDK and could not find it, I scanned the whole internet and with only sparse information I could figure out that the routine where located in alib.lib or amiga.lib, I think the latter.

So I got an error when linking could not find where it was defined when linking (more or less) I added in different combinations lamiga lalib llibamiga and whatnot, still no luck, error was could not find whatever .lib I added.

So I explored the [user]*abyss\. thing, could not find any alib.lib or amiga.lib... so I "stole" a version from vbcc and put in various places, no luck.

I started Process Monitor (sysinternals) and did see that ld where trying to do something with /libamiga.(a|so) files, i read the docs for ld, and indeed it stated that it puts lib infront of the libraries I wish to use, I tried to change the name of the lib just to test. Did not work...

Anyway despite this long and for you I guess, kind of boring description of my problem. I wonder if you would like to include some help documentation how to solve various easy problems for an experienced coder, but perhaps a "stopper" for any unexperienced ones with your toolchain solution, or perhaps links and references to where one could solve the problem at hand.

//Thank you for your time, and my appology for the rather unusual "request" of mine. And thanks for a nice tool to test out and perhaps learn to use //HEA

BartmanAbyss commented 4 years ago

Hi, thanks for checking out my tool. However, as you have already discovered, it's not really designed to do system programming. It just supports enough of Kickstart to get demos/intros running. For your purposes I suggest checking out bebbo's amiga-gcc project. It comes with full amiga.lib support. I guess I should make that clearer in the README...

0wen101 commented 4 years ago

I did some tests, opened a few windows and wrote Hello World as one should, after some changes and added includes (like missing rexx if you include alib_proto.h) it worked.

I know I know, I should probably abandon this right now but how do I even add missing includes? Failing with compile hello world: 'fatal error: stdio.h: No such file or directory'

thank you

BartmanAbyss commented 4 years ago

You don't ;) Standard C runtime library is not supported. You have to use the AmigaOS library functions for everything, e.g. dos.library for file i/o and text output. Have a look at the included template, it shows how to print text to the console.

0wen101 commented 4 years ago

Ah ok, of course, makes sense. Many thanks again for this toolchain and effort. Thank you

0wen101 commented 4 years ago

just to be clear, if I avoid including any of the header files as listed here in the c standard library I should be ok ?

BartmanAbyss commented 4 years ago

Yep.

0wen101 commented 4 years ago

Perfect. Lastly what is the best resource, book or otherwise, in your opinion, for learning all about Amiga OS library functions in C ? Have a great weekend

BartmanAbyss commented 4 years ago

Check out the Amiga ROM Kernel Reference Manuals.

Azvareth commented 4 years ago

Jumping in, hope you do not mind.

I remember I had RKRM back in the days, it was really good, but I think I also had Libs and Devices or named something similar, that might also fit the bill....