user809409
user809409

Reputation: 511

error: "_structName" has already been declared in the current scope

I am running into this "already declared" compilation error when building my program. I know that this can sometimes be caused by including the same header file twice. However, I am using an ifndef preprocessor directive to avoid such a scenario. It seems that this struct must be declared in another header file somewhere else in my build path. Is there any way to figure out where this struct is initially declared?

Upvotes: 2

Views: 9105

Answers (1)

Zéychin
Zéychin

Reputation: 4205

(In root of build path)

Linux:

find . | xargs grep name_of_your_struct

Windows (I am not 100% on the syntax, here, but I believe this is correct. Try findstr /? if this doesn't work.)

findstr /S "name_of_your_struct"`

Upvotes: 2

Related Questions