Compilation error when using struct defined in header file using C -


i have strange problem. have read articles find , think make correct:

i have struct defined in header file a.h

typedef struct{   int io; } apa; 

this files lies in folder, lets src/model

furthermore in root directory have main file in thich include header files follows:

#include "a.h"   int main(){   apa x;  return 0; } 

when compile using gcc i-flag according -isrc/model
i error compilation warning says:

'apa' undeclared (first use in function) (each undeclare identifier reported once each function appears in) x undeclared (first use in function)  

i cant seem find problem. appreciated.

if main file in different folder header file, total path of header file main file should mentioned.

eg)

#include "/src/model/a.h" 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -