How to get rid of `deprecated conversion from string constant to ‘char*’` warnings in GCC?

So I’m working on an exceedingly large codebase, and recently upgraded to gcc 4.3, which now triggers this warning: warning: deprecated conversion from string constant to ‘char*’ Obviously, the correct way to fix this is to find every declaration like char *s = “constant string”; or function call like: void foo(char *s); foo(“constant string”); and … Read more

gcc makefile error: “No rule to make target …”

I’m trying to use GCC (linux) with a makefile to compile my project. I get the following error which is can’t seem to decipher in this context: “No rule to make target ‘vertex.cpp’, needed by ‘vertex.o’. Stop.” This is the makefile: a.out: vertex.o edge.o elist.o main.o vlist.o enode.o vnode.o g++ vertex.o edge.o elist.o main.o vlist.o … Read more

setup script exited with error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

When I try to install odoo-server, I got the following error: error: Setup script exited with error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1 Could anyone help me to solve this issue? 35 Answers 35 I encountered the same problem in college having installed Linux Mint for the main project of my final year, the … Read more

Undefined reference to vtable

When building my C++ program, I’m getting the error message undefined reference to ‘vtable… What is the cause of this problem? How do I fix it? It so happens that I’m getting the error for the following code (The class in question is CGameModule.) and I cannot for the life of me understand what the … Read more

“Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.” when using GCC

While attempting to compile my C program, running the following command: gcc pthread.c -o pthread Returns: Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. and my code does not compile. Why is this happening and how can I fix this problem? 1Best Answer 11 Open up Xcode, and accept … Read more

Why does GCC generate 15-20% faster code if I optimize for size instead of speed?

I first noticed in 2009 that GCC (at least on my projects and on my machines) have the tendency to generate noticeably faster code if I optimize for size (-Os) instead of speed (-O2 or -O3), and I have been wondering ever since why. I have managed to create (rather silly) code that shows this … Read more

What exactly is LLVM?

I keep hearing about LLVM all the time. It’s in Perl, then it’s in Haskell, then someone uses it in some other language? What is it? What exactly distinguishes it from GCC (perspectives = safety etc.)? 7 s 7 LLVM is a library that is used to construct, optimize and produce intermediate and/or binary machine … Read more

GCC -fPIC option

I have read about GCC’s Options for Code Generation Conventions, but could not understand what “Generate position-independent code (PIC)” does. Please give an example to explain me what does it mean. 6 s 6 Position Independent Code means that the generated machine code is not dependent on being located at a specific address in order … Read more