gcc

What windows C IDE can I use that will use gcc to compile and let me insert breakpoints just like Visual Studio would for C#?

What windows C IDE can I use that will use gcc to compile and let me insert breakpoints just like Visual Studio would for C#? I have searched Google and cannot find anything more recent that 2005. I'm just getting back into C since graduating and would like a non MS IDE that uses GCC, but that's a versatile as Visual Studio. The thoug...

Make a cosine table with the gcc preprocessor

Hi. I wish to make a cosine table at compile time. Is there a way to do this without hard coding anything? ...

What's the difference between the -symbolic and -shared GCC flags?

From the documentation's description, they seem to do the same thing except that "not all systems" support shared and "only some systems" support symbolic (it's unclear if these are the same set of systems): -shared Produce a shared object which can then be linked with other objects to form an executable. Not all systems su...

Inlining std::inner_product

Allegedly inlining std::inner_product() does NOT get inlined with gcc compiler < gcc 4.1 compilers, per the following bug . Hence I would like to implement my own version of inner_product. Are there existing implementation available? Thanks ...

What is the best way to find what library a function may belong to?

What is the best way to find what library a function may belong to? When building source code, I sometimes get "undefined reference to" errors. When they are function calls, I'd like to know what libraries need to be linked in more easily than my usual guessing game. Any ideas? -Chenz ...

Building OSX App Bundle

Hi Suppose I have have made a an osX app without using Xcode. After compiling with GCC I get an executable which is linked to several other libraries. Some of those libraries might again be dynamically linked to other non-standard system libraries Is there any tool which exists which makes an OSX App bundle by first making the required ...

std::stringstream GCC Abnormal Behavior

I have a very interesting problem with compiling a short little program on a Mac (GCC 4.2). The function below would only stream chars or strings into the stringstream, but not anything else (int, double, float, etc.) In fact, the fail flag is set if I attempt to convert for example an int into a string. However, removing the preprocess...

Marking standard functions as deprecated/unusable

I have a large codebase that uses a number of unsafe functions, such as gmtime and strtok. Rather than trying to search through the codebase and replace these wholesale, I would like to make the compiler emit a warning or error when it sees them (to highlight the problem to maintenance developers). Is this possible with GCC? I already...

Includes in inline assembly

We are working on a toy operating system as a assignment for a class. I'm having some trouble with writing of the kernel panic function. It should save all registers, call some printf-like function, then print the saved registers and halt the cpu. Right now it's defined as a macro: #define panic(...) \ do{ \ asm volatile("S...

How to get the linker in gcc to recognize OpenCL library functions?

I'm getting my feet wet with OpenCL. I'm sure this problem is not specific to OpenCL, however. the top of my main file looks like: #include <stdio.h> #include <stdlib.h> #include <math.h> #include <OpenCL/opencl.h> // some code cl_device_id device_id; //declaring a device id gives no errors int err = clGetDeviceIDs(NULL, CL_DEVICE_T...

Cross-compile Apache Portable Runtime to the iPhone

This is a followup to a previous question on cross-compiling for the iPhone: http://stackoverflow.com/questions/1602182/cross-compile-autotools-based-libraries-for-official-iphone-sdk Basically, I am trying to compile the Apache Portable Runtime (APR) version 1.3.8 (latest) for the iPhone. I am currently running into the following error...

Is bool a native C type?

I've noticed that the Linux kernel code uses bool, but I thought that bool was a C++ type. Is bool a standard C extension (e.g., ISO C90) or a GCC extension? ...

GCC: Inline assembly - good for?

So I just found out GCC could do inline assembly and I was wondering two things: What's the benefit of being able to inline assembly? Is it possible to use GCC as an assembly compiler/assembler to learn assembly? I've found a couple articles but they are all oldish, 2000 and 2001, not really sure of their relevance. Thanks ...

Why can you return from a non-void function without returning a value without producing a compiler error?

Ever since I realized many years ago, that this doesn't produce an error by default, (in gcc at least) I've always wondered why? I understand that you can issue compiler flags to produce a warning, but shouldn't it always be an error? Why does it make sense for a non-void function not returning value to be valid? An example as requeste...

Globally use Google's malloc?

I'd like to experiment with Google's tcmalloc on Linux... I have a huge project here, with hundreds of qmake generated Makefile's... I'd like to find a way to get gcc to globally link against tcmalloc (like it does with libc)... Is this possible? Or will I have to edit every Makefile? (I'd prefer not to edit all the pro files as there a...

Objective-C with cpp extensions, I don't know what I'm doing...

So I'm still feeling like a novice at times when strange errors jump out of XCode. Yesterday I started getting this: ___gxx_personality_v0", referenced from: ___gxx_personality_v0$non_lazy_ptr That was when building a unit test target that used a ".mm" file in XCode with the iPhoneSDK. The error went away when I changed the file ...

How to I find the filename of a library via the library name?

How to I find the filename of a library via the library name? In otherwords, when I use "-lc", I know it is /lib/libc.so.6 (or something similar.) I want to be able to type some command where "-lc" is the input and "/lib/libc.so.6" is the output. To extend this idea futher, I wanted to specify my own search path so I can use this librar...

Error 1 & 2 when compiling GCC 4.4.2 on OpenSolaris 2009.06

My problem: I've been trying to compile, build, and install GCC 4.4.2 in my installation of OpenSolaris 2009.06 on my VirtualBox 3 i386 machine. But I keep getting this same error when running make: > checking whether ln -s works... yes checking for i386-pc-solaris2.11-gcc... /src/gcc-4.4.2/host-i386-pc-solaris2.11/gcc/xgcc -B/src/gcc-...

Building R Packages using Alternate GCC

The systems I work with have GCC 4.5 (experimental) in /usr/local/bin/gcc which has proven to be problematic for some R packages. I would like to instead use system GCC in /usr/bin/gcc. I have tried setting CC and CXX in the Bash configuration files (.bashrc, .bash_profile etc.) as well as on the command line, but although Bash recogniz...

What could be the reason for getting the error "multiple definitions" while linking?

I keep getting errors that my functions have been defined multiple times. Of course I only have one file and one function with that name in my file. Where could gcc find those other definitions? Here is an example error message, but I get many of those: /tmp/ccerCzAD.o:main.c:(.text+0xdb): first defined here /tmp/ccGbaGfJ....