Debugger - no debugging symbols found


#1

Hello guys,

I was trying to run a program, the program compiles and run fine without any problem. But during debugging it shows

Reading symbols from array...(no debugging symbols found)...done.

I am new to debugging. I am not sure whats wrong with my code even though it compiles and run with out any error. Help needed!!
Here my full code:

#include<stdio.h>

typedef struct arrayname {
    int a;
    char b;
} arraytype;
		
int main() {	

     arraytype gpio[] = {{1,'a'},{200,'z'}};
     printf("Done\n");
     printf("New type :\t %d \n", gpio[1].a);

     return 0;
}

Here is my full error message:
debug


#2

The above error is because you are missing -g flag during compiling. The -g flag will create all the necessary symbols for debugging. In order to solve the problem use -g flag like this,

gcc -g array.c -o array

Regards


#3

Thanks! @toddle996
-g flag indeed solve my problem. thank you so much.