View Single Post
Old 22 November 2022, 18:43   #84
felmur
Registered User
 
felmur's Avatar
 
Join Date: Nov 2022
Location: Salerno/Italia
Posts: 16
Hello,
I installed eclipse + toolchain-gcc scrupulously following Bebbo's instructions, to whom I thank him for the excellent tutorial.

It works very well in Eclipse and now I successfully compile the programs I write, testing them in FS-UAE and also on my amiga600.

Everything worked fine until I needed to pass parameters to the program via the command line.

I wrote this simple source:
Code:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char const * const * argv) {
	printf("Number of arguments passed: %d\n",argc);
	for (int i=0; i<argc; i++){
		printf("Arg# %d: '%s'\n", i, argv[i]);
	}
	return EXIT_SUCCESS;
}
The code compiles perfectly, but when I try it in FS-UAE the parameters I pass via command line are not recognized. The value of argc appears to be correctly set, but it is also not possible to read the value of argv[0], which should contain the program name. Does anyone have any idea what I'm doing wrong?
Attached Thumbnails
Click image for larger version

Name:	amiga4000pereclipse-crop-2211221825-01.png
Views:	103
Size:	5.9 KB
ID:	77178  
felmur is offline  
 
Page generated in 0.04880 seconds with 11 queries