obdev / CrossPack-AVR

Script and associated files for building avr-gcc and related tools on Mac OS X with Xcode 4
GNU General Public License v2.0
232 stars 54 forks source link

Xcode integration does not highlight source line when clicking on error message #2

Open obdev opened 11 years ago

obdev commented 11 years ago

This seems to be a problem with paths. Gcc outputs relative paths with errors and warnings, because files were specified with relative paths in the compiler command line. Xcode therefore does not know where to search for the file.

julian-weinert commented 3 years ago

Pretty funny to find that almost 10 years later. I'm commenting since there are not many references on the internet regarding this (surprise!).

The issue is that Xcode wants GCC to report errors with an absolute file path. That does the trick.

I'm noch using CrossPack, but a simple self-made project, since I have specifically setup makefiles that should also run without Xcode as my project requires.

I finally got it working with this:

$(BUILD)/%.o: %.c
    $(GCC) -c $(CFLAGS) -mmcu=$(MCU) "${CURDIR}/$<" -o $@
                                         ^^^^^^^^^^^  ^