Can't resolve any variables in cpp files included from cpp files

Is there a setting or has anyone got a work-around for this?

If for example I have 3 files, one.h, one.cpp and two.cpp.

one.h
#define SOMETHING 1

one.cpp
#include "one.h"
#include "two.cpp"

two.cpp
int a = SOMETHING;

one.cpp is marked as the only file to compile, two.cpp doen't get compied apart from within one.cpp

when editing two.cpp, "SOMETHING" shows up in red and cannot be navigated to, i.e. AppCode doesn't know it exists. including one.h at the top of two.cpp fixes the problem. I need AppCode to know that SOMETHING exists in a file included from another file.

The reality is I use "Unity" style builds, where large projects are split into sections with each section having a single "Unity.cpp" file that includes the header files AND the cpp files for all files in the section. All of the cpp files apart from "Unity.cpp" are marked as not included in the target so the compiler only compiles the "Unity.cpp" files. However, any cpp files included from Unity.cpp show all of thier varibles, structures, defines etc. as not found. The project compiles fine.

Strangely, when I first put my large project into AppCode I'm sure it worked, but after reloading AppCode it doesn't anymore.

Is there a setting I can change or is it a known problem?

Thanks,
Stu

1 comment
Comment actions Permalink

Stuart,
I'm afraid such configuraton is not yet supported by AppCode. Please create a bug report and copy the description there.

0

Please sign in to leave a comment.