Author Topic: how to configure C::B for cross compiling to Linux-ARM from Windows?  (Read 6175 times)

Offline metcenger

  • Single posting newcomer
  • *
  • Posts: 2
Hello!
I want to work in a Windows and compile code for ARM-Linux.
1. Is it possible?
2. I dowloaded compiler gcc-linaro-4.9-2015.02-3-i686-mingw32_arm-linux-gnueabihf. Correct?
3. When I made empty project and configure C::B like on foto, I have mistake.
Can you help me to start with C:B?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: how to configure C::B for cross compiling to Linux-ARM from Windows?
« Reply #1 on: February 16, 2016, 03:18:30 pm »
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Post a full build log.
Do NOT post images or link to images as the "build log"

Edit: The CB Arm Wizard is NOT a good way to create a Embedded Linux Arm CB Project!!

Tim S.
« Last Edit: February 16, 2016, 04:06:07 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline metcenger

  • Single posting newcomer
  • *
  • Posts: 2
Re: how to configure C::B for cross compiling to Linux-ARM from Windows?
« Reply #2 on: February 17, 2016, 07:54:43 am »

-------------- Clean: Debug in tst2 (compiler: GNU GCC Compiler for ARM)---------------

Cleaned "tst2 - Debug"

-------------- Build: Debug in tst2 (compiler: GNU GCC Compiler for ARM)---------------

arm-linux-gnueabihf-gcc.exe -Wall -g -std=c99 -ID:\arman_work\CodeBlocks\test -c adau_fw_loader.c -o obj\Debug\adau_fw_loader.o
arm-linux-gnueabihf-gcc.exe  -o bin\Debug\tst2.exe obj\Debug\adau_fw_loader.o   
d:\arman_work\compiler_linaro\gcc-linaro-4.9-2015.02-3-i686-mingw32_arm-linux-gnueabihf\bin\../arm-linux-gnueabihf/libc/lib/libc.so.6: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 1 second(s))
1 error(s), 0 warning(s) (0 minute(s), 1 second(s))


Possible that I use not a correct compiller. Because I installed C::B on the Linux and use another Linaro for ARM-Linux Compiller and at this case all work correct.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: how to configure C::B for cross compiling to Linux-ARM from Windows?
« Reply #3 on: February 20, 2016, 06:13:35 pm »
Edit: I am using Windows 7 32 bit for Testing.

Please post your CB config for "GNU GCC Compiler for ARM"

Note: I have never used the Linaro_Toolchain_arm-linux-gnueabihf compiler.

Compiler Installation Directory: C:\Program Files\Linaro_Toolchain_arm-linux-gnueabihf

Installed using linaro-toolchain-2015.02-3-arm-linux-gnueabihf.exe

CB Used: 16.01 SVN 10695

CB Compiler Edited: "GNU GCC Compiler for ARM"
C Compiler:             arm-linux-gnueabihf-gcc.exe
C++ Compiler:           arm-linux-gnueabihf-g++.exe
Linker Dynamic Libs:    arm-linux-gnueabihf-g++.exe  Edit2: Or arm-linux-gnueabihf-gcc.exe if only doing C.
Linker Static Libs:     arm-linux-gnueabihf-ar.exe

These locations are blank for me.
Linker Settings
Search Directories
Additional Paths


main.c
Code
#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hello world!\n");
    return 0;
}

Code
-------------- Clean: Debug in testArm4c (compiler: GNU GCC Compiler for ARM)---------------

Cleaned "testArm4c - Debug"

-------------- Build: Debug in testArm4c (compiler: GNU GCC Compiler for ARM)---------------

arm-linux-gnueabihf-gcc.exe -Wall -std=c99 -g  -c main.c -o obj\Debug\main.o
arm-linux-gnueabihf-g++.exe  -o bin\Debug\testArm4c.exe obj\Debug\main.o   
Output file is bin\Debug\testArm4c.exe with size 10.30 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Tim S.
« Last Edit: February 20, 2016, 06:16:26 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org