English Amiga Board


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

 
 
Thread Tools
Old 23 November 2020, 21:35   #1241
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 46
Posts: 1,626
Send a message via Yahoo to Samurai_Crow
Quote:
Originally Posted by ciVic View Post
Hi all!

I'm trying this:

Code:
#include <string>
#include <fstream>
#include <iostream>
using namespace std;

int main (int argc, char *argv[])
{
    cout << "running test" << endl;
    ofstream out("test.dat");
    out << "Hallo Welt";
    out.close();
    return 0;
}
Compiling this way writes data to file but crashes afterwards:

Code:
m68k-amigaos-g++  -mcrt=clib2  main.cpp
If I omit -mcrt=clib2 it works. I'm using m68k-amigaos-g++ (GCC) 6.5.0b 200706181046 and my last pull was last week.
If CLib2 doesn't work, try LibNix.
Samurai_Crow is offline  
Old 23 November 2020, 22:55   #1242
ciVic
Registered User

 
Join Date: Oct 2013
Location: Germany
Posts: 37
Quote:
Originally Posted by Samurai_Crow View Post
If CLib2 doesn't work, try LibNix.

Thx but I have no choice. I need a lib that was compiled with clib2 and then the exe cannot use a different system afaik.
ciVic is offline  
Old 24 November 2020, 16:57   #1243
Warty
Registered User

 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 95
What's the current version of Bebbo's bgdbserver? The link on his page to version 6 is a 404. I was working on some code for deleting files recursively, and well, I seem to have deleted the contents of my 'test' directory, including bgdbserver. Version 5 is available on the web site, but I think that's an older version, as it requires -r.

Is there a version 7 coming? Anybody have a link to 6 I could use?

404:
https://franke.ms/amiga/bgdbserver_6.zip

from:
https://franke.ms/amiga/gdb-eclipse.wiki
Warty is offline  
Old 24 November 2020, 20:26   #1244
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 498
Quote:
Originally Posted by Warty View Post
What's the current version of Bebbo's bgdbserver? The link on his page to version 6 is a 404. I was working on some code for deleting files recursively, and well, I seem to have deleted the contents of my 'test' directory, including bgdbserver. Version 5 is available on the web site, but I think that's an older version, as it requires -r.

Is there a version 7 coming? Anybody have a link to 6 I could use?

404:
https://franke.ms/amiga/bgdbserver_6.zip

from:
https://franke.ms/amiga/gdb-eclipse.wiki

the correct link is: https://franke.ms/download/bgdbserver_6.zip - I updated the page. Thank you!
bebbo is offline  
Old 25 November 2020, 22:05   #1245
Warty
Registered User

 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 95
Awesome, thanks Bebbo!
Warty is offline  
Old 01 February 2021, 03:02   #1246
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 33
Quote:
Originally Posted by bebbo View Post
the correct link is: https://franke.ms/download/bgdbserver_6.zip - I updated the page. Thank you!
What that server does? Is it got some special features? For testing my apps I was planning to just static win running winuae, compiling the output to shared folder, and just relaunching the exe after every new build.
mateusz_s is offline  
Old 02 February 2021, 08:21   #1247
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 103
I try to port some code from SAS-C. It's a callback function defined like this:
Code:
int __asm __saveds QBobFunc(register __a1 struct myBltNode *node)
{
...
}
Can I achive this somehow with gcc, too?
thyslo is offline  
Old 02 February 2021, 09:50   #1248
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 498
Quote:
Originally Posted by mateusz_s View Post
What that server does? Is it got some special features? For testing my apps I was planning to just static win running winuae, compiling the output to shared folder, and just relaunching the exe after every new build.

the bgdbserver allows you to debug your program on the Amiga remotely.
What you need is a working TCP/IP stack on your Amiga, then you can debug the program even on a real Amiga.


debugging > printf
bebbo is offline  
Old 02 February 2021, 09:53   #1249
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 498
Quote:
Originally Posted by thyslo View Post
I try to port some code from SAS-C. It's a callback function defined like this:
Code:
int __asm __saveds QBobFunc(register __a1 struct myBltNode *node)
{
...
}
Can I achive this somehow with gcc, too?

Code:
int __saveds QBobFunc(struct myBltNode *node asm("a1"))
{
...
}

__saveds is only needed if a baserel data model is used - it means that the function loads the a4 register. Useful in callbacks given to someone else or interrupt handlers... the latter may also need the __interrupt attribute.
bebbo is offline  
Old 02 February 2021, 11:31   #1250
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 103
Thanks a lot, this works
thyslo is offline  
Old Yesterday, 19:03   #1251
zero
Registered User

 
Join Date: Jun 2016
Location: UK
Posts: 370
Is it me or does KPrintF formatting not work? I tried this:

KPrintF("Right: %d\n", 112);

And the output is

"Right: 0"
zero is offline  
Old Yesterday, 19:22   #1252
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 50
Posts: 578
Quote:
Originally Posted by zero View Post
Is it me or does KPrintF formatting not work? I tried this:

KPrintF("Right: %d\n", 112);

And the output is

"Right: 0"
Try %ld
Every parameter in variadic functions is promoted to longs (32bits)
alkis is offline  
Old Yesterday, 21:45   #1253
zero
Registered User

 
Join Date: Jun 2016
Location: UK
Posts: 370
Quote:
Originally Posted by alkis View Post
Try %ld
Every parameter in variadic functions is promoted to longs (32bits)
Thanks, that works.
zero is offline  
 


Currently Active Users Viewing This Thread: 2 (1 members and 1 guests)
Grumpa
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
New GCC based dev toolchain for AmigaOS 3.x cla Coders. Releases 8 24 December 2017 11:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 23:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 04:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 22:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 15:45

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 11:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.10817 seconds with 16 queries