On 2018-12-04 15:46, ZEESHAN HAYAT wrote: > Hi, > I am trying to access target/nios2/cpu.h in vl.c. If I add #include > "target/nios2/cpu.h" in vl.c, I get the following errors:
You can not include a target-specific header file in common code. vl.c is only compiled once for all targets, but target-specific header files like cpu.h contain target-specific #defines like TARGET_LONG_BITS - so if you'd use one of these defines in common code, it would be right for one target but wrong for the other. If you need to use cpu.h from the target directory, add your code to a target specific file instead. Look for "obj-y" in the Makefiles instead of "common-obj-y". HTH, Thomas
