- August 12, 2013 at 6:04 pm #31436
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.August 13, 2013 at 8:53 am #37884
Have you built the toolchain successfully?
Please let me know the output of the following commands
Sean.August 13, 2013 at 10:47 am #37885
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.August 13, 2013 at 12:50 pm #37886
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-August 13, 2013 at 2:43 pm #37887
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