Let’s say I want to use printk() within arch/x86/boot/string.c before compiling the kernel. Which header file do I have to include so that the linker knows where to find printk()? I tried #include <linux/kernel.h> and #include <linux/printk.h> but I always get errors during make bzImage telling me the linker does not find printk: Answer You are trying to instrument the
Tag: gcc
Disable variable-length automatic arrays in gcc
I couldn’t disable it even though by using -std=c89 flag. How can I disable it? Answer You can generate an error for variable length arrays using a compiler flag:
C compiler cannot create executables on OpenSUSE
I’ve tried to compile xdebug from sources, but I become this output: There is my config.log. I’ve found possible error: /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: i386 architecture of input file ‘/usr/lib/crt1.o’ is incompatible with i386:x86-64 output /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: i386 architecture of input file ‘/usr/lib/crti.o’ is incompatible with i386:x86-64 output /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: i386 architecture of input file ‘/usr/lib/crtn.o’ is incompatible with i386:x86-64 output /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: dynamic STT_GNU_IFUNC symbol
Error installing r packages (Linux Mint 17.1) “error: C preprocessor “g++ -E” fails sanity check”
I have transfered to a Linux system (previous OSX user) and I am trying to get my R packages installed. The first issue I ran across was: but I got around that by launching R using: If someone has a more permanent solution to using ‘sudo’ (because I will be using RStudio in the future), I would be interested to
size and objdump report different sizes for the text segment
I have tried this, but stuck up to the answer below questions where hello_world-1.c is The executed commands: Can anyone please help me to figure out what might be the reasons for the questions below? The size command didn’t list a stack or heap segment for hello_world or hello_world.o. What might be the reason behind this? (for above question, the
Rewrite at the beginning of the file
I was trying to rewriting text at beginning of file but facing the following: The header file is test.h: The source file is test.c : The main file is main.c: The make file is: The out put was expected is: But it is replacing first few characters of the first line. Where I am going wrong? Answer The output is
gcc segmentation fault – how can I find a line where it happened?
I’m using Ubuntu and gcc. My application crashes I only have Segmentation fault message in console. (previously Segmentation fault (core dumped) was reported but now it changed to just Segmentation fault). There are no hints where the problem is so I do not understand how should I fix the problem. I need some hints to find what caused this –
version `GLIBC_2.11′ not found while using gcc
I have problem using gcc/g++ after I changed the machine I use, I installed gcc-4.9.2 in my previous machine, when I moved to the new machine, I copied gcc folder to the new machine. When I try to use I get this error : I have already checked this question : `GLIBC_2.11′ not found If it says right, the version
How can I make my program compile without warning?
I should compile my program with spec flags to gcc. Then gcc complained about return values not taken care of. WhenI use variables to take the return values then gcc complains again: How can I resolve the warnings? My program is as follows. Answer Reading between the lines, I guess the original problem you were trying to solve was a
gcc linker (ld) can’t find shared libraries
I’ve trying to cross compile an app for iMX6 CPU using linaro-gcc and a dedicated rootfs. The app might be linked to OpenVG and the standard pthread libraries. It compiles fine but the linker failed to link to the OpenVG library so I added the linker switch -L/home/ae/Documents/toradex/col-imx6/colibri-imx6-sdk/usr/lib and now it links to the OpenVG library. But since then, it