gcc

Tips on using GCC as a new user

I am really new to GCC and I don't how to use it. I already have a copy of a pre-compiled gcc binaries i've downloaded from one of the mirror sites in the gcc website.. Now, I don't where to go from here... Please give me some tips on the different path to proceed.. I am sorry for the rather vague question.. What I want are tips on ho...

Windows based development for ARM processors

I am a complete newbie to the ARM world. I need to be able to write C code, compile it, and then download into an ARM emulator, and execute. I need to use the GCC 4.1.2 compiler for the C code compilation. Can anybody point me in the correct directions for the following issues? What tool chain to use? What emulator to use? Are there ...

GCC special optimization options for double precision floating point arithmetics

Do you know which of the GCC optimization flags are the most appropriate to build an application, which uses double floating point and calculates a lot in real-time and it uses -lm. A target hardware is two Dual-Xeons with Linux on-board. Thanks in advance! ...

gcc crtbegin crtend

For what purpose does gcc use crtbegin.o and crtend.o ? ...

Pointer to current function

Is there any way to get a pointer to the current function, maybe through gcc extensions or some other trickery? Edit I'm curious whether it is possible to get the function pointer without ever explicitly using the function's name. I thought I had a good reason for wanting this, realized that I didn't really, but am still curious if it ...

Xcode 3.2 not recompiling changed files

I've been programming a new iPhone application and everything has been chugging along fine, until this afternoon when I noticed that any changes I was making were not being reflected in the actual app! Even code that throws errors isn't getting picked up by the compiler. To get around this, I have taken to the following procedure: Fin...

Explicit specialization in non-namespace scope

template<typename T> class CConstraint { public: CConstraint() { } virtual ~CConstraint() { } template <typename TL> void Verify(int position, int constraints[]) { } template <> void Verify<int>(int, int[]) { } }; Compiling this under g++ gives the following error: Explicit specialization in non-namespace scope 'class CConstrain...

How to port a simple application (which uses only standard libc) to iPhone OS ?

There is a simple application written in C, which includes only standard C library functions (from stdio, stdlib, etc.) and Makefile+GCC to build it. Now, I wanna port it to iPhone OS for iPhone/iPads. Will it be seamless or are there any possible incompatibility issues? ...

undefined reference and strange content of static library

Hey, I'm a real gcc newbee so excuse me if this is a silly question. I want to use opencv in android and therefore try to compile it into a static library that get's used in the android ndk build process to build a shared library that I intent to use for my android app. The build of the statc library works fine, but when building the sh...

Strange GCC 'expected primary expression...' error

Possible Duplicate: Templates: template function not playing well with classs template member function template <typename T> struct A { template <int I> void f(); }; template <typename T> void F(A<T> &a) { a.f<0>(); // expected primary-expression before ‘)’ token } int main() { A<int> a; a.f<0>(); // Thi...

Generating code at compile-time using scripts

Hello, I would ideally like to be able to add (very repetitive) C/C++ code to my actual code, but at compile time, code which would come from say, the stdout of a python script, the same way one does with macros. For example, let's say I want to have functions that depend on the public attributes of a given class, being able to just wr...

Undefined reference to vtable

So, I'm getting the infamously horrible "undefined reference to 'vtable..." error for the following code (The class in question is CGameModule.) and I cannot for the life of me understand what the problem is. At first, I thought it was related to forgetting to give a virtual function a body, but as far as I understand, everything is all ...

gcc -l option and .la library files

Could you please explain, how linking with -l option against .la files works? As far as my experience reaches - i have only linked against static library (.a) files. Now i took a look at some Qt generated Makefiles and cant figure out, how linker figures out to use/open libQtCore.la file, when -l QtCore switch is specified, instead of ...

librrd link problem

i use rrd (graphic programming ) under rrdtool, i have installed; and i rund gcc gcc -I/usr/include -I/usr/local/include -L/usr/lib -L/usr/local/lib -lrrd -o myprog test.c myprog is execute file and test.c ist testprogram who i use function rrd_create from libary but gcc put out error like this: /usr/bin/ld: cannot find -lrrd why!!!! ...

Is g++ on cygwin any different from what I get on Linux platform?

Can I start installing boost libraries, ACE framework and use it as my home Linux server? ...

Why is XCode freaking out?? I.e., Xcode says methods & properties do not exist but they do!

XCode has been acting really, really strange recently. It is telling me that various classes' methods and properties do not exist - but they do! This is happening both with a custom class, and a Core Data class. I have declared all of the methods and properties, including all the necessary @synthesize calls, and have predeclared the clas...

problem with clang application

Hi, I am building an application using clang libraries, I running to a problem, it will be very helpful if somebody can give some directions. #./a.out /home/nmathew/Desktop/algorithms/array.cpp gives In file included from /home/nmathew/Desktop/algorithms/array.cpp:1: In file included from /usr/include/c++/4.4.3/iostream:39: In file i...

C++: How to add external libraries

I'm trying to add SVL to my project. Without it I'm getting hundreds of errors (undefined reference...). After adding -lSVL all errors are gone, but gcc says: "cannot find -lSVL". Everything else (SDL, SDL_TTF, SDL_Mixer...) works fine. ...

GNU Objective-C runtime trickery

Can I, in the GNU Objective-C runtime, attach semi-arbitrary pieces of data to instance variables? Challenge: I'm currently working on a kind of Cocoa workalike for Linux, as a sort of pet project. (Please, let's not get sidetracked by all the "use GNUStep" stuff. I know about it, but it doesn't suit my needs. Moving on…) For this purp...

How do I link in functions from a .cpp source file that also has a 'main'?

I want to use some functions from a .cpp source file that has a main function in my .cpp source file. (I'm building with make and gcc.) Here's the rule from my Makefile: $(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) $(LIBS) -o $@ And here's the output (with some names changed to prevent distraction): $ make foo g++ -g -Wall -m32 -Ilinux/i...