- 12th August 2013 at 6:04 pm #64673
After exporting CROSS_COMPILE
And then trying to compile the file in the code_test directory with a makefile like this
SIMPLE_TEST = code_test
CC = $(CROSS_COMPILE)gcc
SIMPLE_TEST_SRC = test_prog.c sum.c
$(CC) $(TARGET_LDFLAGS) -g -o $@ $^
The terminal returns:
gcc -g -o code_test test_prog.c sum.c
Which is not what the getting started guide suggests will be returned
Codescape also says :”Error: Error: Cannot open Program File” when trying to run it.
I believe that the file is not compiling correctly as it is using the standard linux compiler instead of the one so it will compile for the board.
Please could you help me work out where I have gone wrong and how I can correct it.13th August 2013 at 8:53 am #64677
Have you built the toolchain successfully?
Please let me know the output of the following commands
Sean.13th August 2013 at 10:47 am #64676
Thank you for getting back to me quickly.
‘echo’ returns an empty line.
‘ls’ returns just the list of files and folders in the folder.13th August 2013 at 12:50 pm #64675
That suggests the CROSS_COMPILE variable is not currently setup. You can check all your shell environment variables using the command “env”; CROSS_COMPILE should be in there and set correctly.
It needs to display something like this when you run echo:
# export CROSS_COMPILE=/home/sean/minimorphSDK/GPL/buildroot/output/host/usr/bin/metag-linux-
# echo $CROSS_COMPILE
/home/sean/minimorphSDK/GPL/buildroot/output/host/usr/bin/metag-linux-13th August 2013 at 2:43 pm #64674
I have fixed it.
I’m not sure if it’s Ubuntu or just me.
I followed the instructions to create CROSS_COMPILE from the get started guide, which suggests you can create it from buildroot.
I had to create it using the full file path.
It now compiles correctly.
Thank you for your help
You must be logged in to reply to this topic.