24 August 2018, 08:34 | #921 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 676
|
If you want to do C/C++ coding on Linux (or Windows), really give QtCreator a try. I love it. Always found Eclipse too convoluted.
https://www1.qt.io/offline-installers/?hsLang=en (scroll to the bottom, download QtCreator standalone, not Qt the framework/toolkit). It is free, even when using it to produce commercial software; much like the gcc licence. |
24 August 2018, 10:11 | #922 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
I still do most of my C/C++ coding in the terminal to this date. I'm considering getting Visual Studio Code set up for this as it's available for Windows, Mac and Linux.
|
24 August 2018, 11:12 | #923 | |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Quote:
You are welcome to join us in our amigadev slack! https://join.slack.com/t/amigaports/...DA1OWQwNGY4MWQ |
|
29 August 2018, 07:52 | #924 |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,412
|
Been playing around with this recently (using eclipse CDT) and come across my first problem.
I'm just trying to create a txt file and although it compiles and links OK it doesn't seem to work? This is the code: Code:
printf("creating log file\n"); debugLogFile = fopen("DEBUG.TXT", "w"); if (debugLogFile) { printf("created log file\n"); } else { perror( "Error opening file" ); printf( "Error code opening file: %d\n", errno ); printf( "Error opening file: %s\n", strerror( errno ) ); } Output: Code:
Error opening file Error opening file: Success Error code opening file: 0 Anyone know what I've stuffed up I'm not linking with any extra libs or anything just using compiler options: -m68040 -noixemul -O3 -Wall -c -fmessage-length=0 Last edited by NovaCoder; 29 August 2018 at 08:28. |
29 August 2018, 13:51 | #925 | |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Quote:
I believe it’s the file access flag that is the culprit. Can’t remember which option was valid |
|
29 August 2018, 16:57 | #926 | |
MVG
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 215
|
Quote:
|
|
29 August 2018, 17:11 | #927 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Ah, fopen might be broken in libnix.
|
30 August 2018, 00:20 | #928 |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,412
|
Thanks guys, will try linking with clib2
Update: OK that threw up a linking error with strlcpy....do I need to change some other compiler settings? Code:
Invoking: Cross GCC Linker m68k-amigaos-gcc -s -mcrt=clib2 -o "HelloWorld_m68k" ./src/HelloWorld_m68k.o /home/novacoder/Development/tools/eclipse/df/SDL/Debug/libSDL.a /home/novacoder/Development/Amiga/tools/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: /home/novacoder/Development/Amiga/tools/m68k-amigaos/clib2/lib/libm.a(math_init_exit.o):math_init_exit.o:(.text+0x15a): undefined reference to `strlcpy' I managed to get it working without clib2 by using native Amiga DOS commands Last edited by NovaCoder; 30 August 2018 at 03:54. |
26 September 2018, 19:44 | #929 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Quote:
|
|
01 October 2018, 02:34 | #930 |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,412
|
Anyone know how to link in the library for the functions defined in unistd.h?
For example rmdir, stat, fstat Are they missing from libnix? This is building with noixemul and C++ BTW Another unrelated problem I've noticed is that the following code doesn't work as expected: PHP Code:
Thanks Last edited by NovaCoder; 01 October 2018 at 03:54. |
01 October 2018, 09:44 | #931 | ||
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Quote:
Quote:
Code:
#include <unistd.h> #include <sys/stat.h> // defining a variable or function with this name prohibits linking of code // parsing the command line into argv. int __nocommandline; // the startup message from workbench or 0 if started via cli extern struct WBStartup *_WBenchMsg; int main(int argc, char ** argv) { // just a test of some functions. struct stat sbuf; mkdir("blubb", 0); // mode does not care on Amiga stat("blubb", &sbuf); rmdir("blubb"); if (!_WBenchMsg) return 1; // started via workbench. return 0; } Code:
m68k-amigaos-gcc bla.c -Os -o bla -noixemul |
||
01 October 2018, 13:00 | #932 | |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,412
|
Quote:
Update: Yep that works, thanks Last edited by NovaCoder; 02 October 2018 at 01:31. |
|
01 October 2018, 20:05 | #933 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,567
|
I noticed that pfs3aio since v3.1 test #2 has extra data hunk, with size of 1 long, content 0x000011d0 and single reloc entry. None of object files should have non-constant data and nm only lists text ("T") symbols.
Updating to latest amiga-gcc didn't change anything (make clean/clean-prefix, git pull, make update, make all stuff done) How to find out where it comes from? Some library? (I was about to release final v3.1 pfs3aio but this needs to be fixed first, it should be 100% pure, single hunk and rommable) |
02 October 2018, 09:59 | #934 | ||
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Quote:
init.c: Code:
static const UBYTE *intext = "_interrupt"; you could move it into the text segment by making it const: Code:
static const UBYTE * const intext = "_interrupt"; Quote:
|
||
02 October 2018, 17:32 | #935 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,567
|
|
03 October 2018, 22:45 | #936 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
For those interested in my recent versions, I am providing now
Both do contain some stuff not yet on github... Quote:
I also wrote a script to easily benchmark different compilers. Here is the chart for dhrystone21.c: You may provide more benchmarks and compilers (prebuild for linux) and I'll update the chart and maybe also the compiler explorer Last edited by bebbo; 05 October 2018 at 16:23. |
|
03 October 2018, 22:49 | #937 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 722
|
Ummm, gprof??? As in "profiler works"?
|
03 October 2018, 22:52 | #938 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
give it a try
Code:
m68k-amigaos-gprof.exe test_gprof Flat profile: Each sample counts as 0.02 seconds. % cumulative self self total time seconds seconds calls s/call s/call name 99.11 2.22 2.22 1 2.22 2.22 new_func1 0.89 2.24 0.02 1 0.02 2.24 main 0.00 2.24 0.00 2 0.00 1.11 func1 Last edited by bebbo; 03 October 2018 at 23:06. |
03 October 2018, 22:55 | #939 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 722
|
will do, as soon as they hit github!
Issues to be reported at https://github.com/bebbo/gcc or you have a new location? |
04 October 2018, 09:38 | #940 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 676
|
Does anyone know how to build a .library file with the gcc toolchain? I tried to follow the example at https://github.com/bebbo/amigaos-cro...mple-library.c but had no success. It built _something_ but I don’t think it’s a valid library file
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
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 10:18 |
Issue with photon/xxxx WinUAE Toolchain | arpz | Coders. Asm / Hardware | 2 | 26 September 2015 22:33 |
New 68k gcc toolchain | arti | Coders. C/C++ | 17 | 31 July 2015 03:59 |
Hannibal's WinUAE Demo Toolchain 5 | Bobic | Amiga scene | 1 | 23 July 2015 21:04 |
From gcc to vbcc. | Cowcat | Coders. General | 9 | 06 June 2014 14:45 |
|
|