These are the files in /usr/bin I am following this tutorial to cross compile a simple C program: Now I save this is a .c file and try to compile it; This is hapening only when I am using arm-linux-gnu-gcc. But when I am using gcc, it works fine. Why is arm-linux* giving this error? Update Verbose Host configuration Redhat
Tag: gcc
Good way to debug stack value corruption
What is a good way to debug stack value corruption. In a program of mine sometimes the address of the this pointer gets changed after a method returns that does a shutdown on a file descriptor. I debugged the program for hours but I can not find the problem. What is a good method to find out what changes the
gcc won’t compile SDL C Program (undefined reference to SDL functions)
I recently moved to linux and i’m having an issue with compiling SDL C programs using gcc. The command i’m using: Even by seperating sdl-config flags: I’m getting the same error: My very simple program: Answer Order of arguments to gcc matters a lot. Read about Invoking GCC (and documentation of binutils, which gcc uses). Then replace with Better yet,
Strange Output Difference Between GCC and MinGW (C++)
I’m working on a project for a computer science class. I wrote the code and tested it using MinGW, and it works fine. I then copied the code over to the university’s Linux server and tested it there, since that’s what my professor grades assignments on. The output is very different – like it printed out a carriage return in
How to print a number in ARM assembly?
I am trying to print a number that I have stored. I’m not sure if I am close or way off. Any help would be appreciated though. Here is my code: It compiles and runs, but I don’t see anything printed. From what I understand, I need the address of where to start printing in r1, how many bytes in
fprintf, error: format not a string literal and no format arguments [-Werror=format-security
when I try to compile fprintf(stderr,Usage) on Ubuntu I got this error: but when I compiled that on other linux distributions (RedHat, Fedora, SUSE) that is compiled successfully. Anyone has an idea? Answer You should use fputs(Usage, stderr); There is no need to use fprintf if you arn’t doing formatting. If you want to use fprintf, use fprintf(stderr, “%s”, Usage);
Unable to run compiled files – bash: ./a.out: Permission denied. (I’ve tried chmod)
I’ve compiled my C source using cc test.c, and it did generate a.out file. However when I run it I get this error – My source is not in the home directory, it is on different FAT-32 partition, so I’ve mounted the drive in which the code is using the following command – Then I compile my code using cc
How to install cross compiler (on ubuntu 12.04 LTS) for microprocessor SA1100?
Can someone please tell me how to install the cross compiler (programming language C) for the SA1100 microprocessor? I have ubuntu 12.04 LTS. I´m a complete noob to Linux, I just installed Ubuntu yesterday. I need a special variant of the GCC compiler that is named “arm-unknown-linux-gnu-gcc” but don know how to do it. Can someone please help me? Answer
Build .so file from .c file using gcc command line
I’m trying to create a hello world project for Linux dynamic libraries (.so files). So I have a file hello.c: How do I create a .so file that exports hello(), using gcc from the command line? Answer To generate a shared library you need first to compile your C code with the -fPIC (position independent code) flag. This will generate
Buildroot : Which gcc for cross compilation?
I am newbee to buildroot. I can see multiple gccs in buildroot. I assume all are for cross compilation. What are the difference between those ? Answer The one you should use is buildroot-2012.05/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc. The other ones are purely internals binaries.