I have been coding C++ and C# for some years now, but not that much C++ lately, and I'm trying to follow the most simple guides I can find, and try to open a standard Window, but I got errors all over, and it may be different to code on the Amiga compared to PC/Windows/Linux, as what I heard the Amiga don't realy support C++ to the fully and most people using C, I can live with that.
I'm using CodeBech, and get error like this:
warning: implicit declaration of function 'OpenLibrary'
etc.
And what's these "proto" file, have never seen them on the PC. :) I have tried to find a good way to read the AutoDoc's, but haven't found one..
Most of the games and apps which i port from unix to aos4 are C++. MUIOWB browser also C++/C. As i know C++ have some bugs currently, but those ones can be workorounded and they happens in rare situations. You maybe never will meet with them. One difference beetwen let's say GCC on unix, its that our one builds as single-threaded. And as far as i can tell there is no other limitations. All those constuctors/destructors and other crap. Sources of our gcc are avaialbe at adtools.sourceforge.net, so if you will have real interest you can dig in anytime :)
If you want to start with "PC" way, you can just use classic "libc" and some 3d party toolkits like SDL, OpenGL, Allegro and so on. I.e. you can just use the same (most of them) posix and ansi c functions. But of course no directx or gdi here :)
But if you want to use "real amigaos4 fucntions" (which you use in end anyway, because when you use libc, they just stubs for real amiga functions in end), you can use them, and then you need all those "proto" files. You can think (for begining) about them as "new toolkit". Want aos4 fucntions - use proto.
For example your OpenLibrary function are from exec.library. And so, to have it works in your programm, you should
#include <proto/exec.h>
and then you can use it.You also can follow few ways with amiga-specific functions (like for compatibility with old code from os3 add -D__USE_INLINE__) , but by default you will be force to new way already, and you not need to worry about.
All what you need to know its that logic of real aos4 programms are:
-- open library
-- open interface
-- use functions of library, do all the code you need
-- drop interface
-- close library
Nothing hard in general. Just you need to check some docs in the SDK directory and if something is unclear ask here.
I believe there's a lot to learn here, maybe it's this step for all kind of OS and there's no easy portabillity betweens different OS, especially the GUI parts. I have search a bit here, but couldn't find any begginers guide with simple things like a Window/Screen, and the example I found somewhere (?) was a bit OS4 (as it used these proto-stuff), but not 100% as it needed the extra Compiler Switches (-D__USE_INLINE__, in CodeBench) to accept the code, and I want to use the new "future prof way". I would be happy if someone could point me some links.
I did also have to modify the "MyText.IText = (char*)"Hello Intuition!";" with this "(char*) or it complaint about:
warning: assignment discards qualifiers from pointer target type
..and the textoutput was placed half up onto the Windowbar, din't looked good at all, looked like a hack, and it's position where 0, 0, so it should be fine, and I don't have any GUI-hacks what I know about to trash things like this.
I have also search in the SDK directory for some simple examples with standard amiga GUI but couldn't find any. And I have a memory that examples like that existed in 3.x SDK, but I could be wrong.
Of course. All the native-gui code are different everythere. Be it gdi, or xwindow, or reaction, or mui.
As this site does not have "articles" section, it can be a bit misleading that "blog posts" are most of time is real articles. So, if you press on the main page in the blog-posts for "more", and swith on the first page, you will find reaction based examples of helloworld (i.e. opening of reaction based window, and so on). If you in interest in gui coding, then you should also read here Trixie's and Rigo's blogposts (I write mail to Walkero (admin of that site) to make a one more section called "articles", to avoid that misleading, but dunno if and when he will add it).
Aos4 also have support of one more widely used gui toolkit - MUI (i.e. Reaction are official in aos4, but MUI are come as some 3d party contribution, but also works fine). There is a lot of mui examples and docs fying around, and if you will in interest in mui exactly, ask here i will bring you few links.
If it was native aos4 example, then -D__USE_INLINE__ not need it. That switch mostly used when you tryint to port stuff from os3 to os4, or, just when you programming in "os3" way (i.e. without IInterface-> stuff. That swith just cover itnerface stuff automatically).
Anyway, just check example from Methos's article in first blog-posts.
I have seen these blogs, and they are sure usefull when I go for these parts. I read about ReAction on Wikipedia and it's the "new" official GUI for AOS4, but it also said it's using intuition as a base, and my first intention is not to build a heavy GUI program, and to start without GUI.. Ok, the Menu's (if I add that) is probably some type of GUI, but would like to create small resourcefriendly programs and learn the basics/base of what's everything else is built upon. For sure I will have to go for ReAction or MUI one day, and probably learn it all again, and if I understand it right is Cairo also a GUI addon with 2D (3D accelerated) graphics.
What exactly does this mean? I have a C++ project with different processes in them, communicating using ordinary messages, and it seems to work fine.
I have heard something about C++ exceptions not functioning correctly in threads (or rather, processes), but I did some testing, and that also seems to work.
@jaokim
I will better just copy+paste some answers about, from Hans and Ssolie:
From Hans:
From SSolie: