gcc

Beginner problem / error with ansi-c and gcc under ubuntu.

Hi, I am just starting programming ansi c with gcc under ubuntu (9.04). I get following error messages: error messages: main.c:6: error: expected identifier or ‘(’ before ‘/’ token In file included from /usr/include/stdio.h:75, from main.c:9: /usr/include/libio.h:332: error: expected specifier-qualifier-list before ...

Trying to compile MobileSubstrate addon - Undefined symbol

Hi! I went through this tutorial to create a MobileSubstrate addon. I could compile the example hook without errors. But as soon as I add #import <SpringBoard/SBAwayController.h> in ExampleHookProtocol.h and SBAwayController *awayController = [SBAwayController sharedAwayController]; in ExampleHookLibrary.mm (as the first line of...

Help in building an 16 bit os

I am trying to build an old 16 bit DOS like OS. My example kernel code: asm(".code16\n"); void putchar(char); int main() { putchar('A'); return 0; } void putchar(char val) { asm("movb %0, %%al\n" "movb $0x0E, %%ah\n" "int $0x10\n" : :"r"(val) ...

Using the "naked" attribute for functions in GCC

GCC documentation states in 6.30 Declaring Attributes of Functions: naked Use this attribute on the ARM, AVR, IP2K, RX and SPU ports to indicate that the specified function does not need prologue/epilogue sequences generated by the compiler. It is up to the programmer to provide these sequences. The only statements that can be s...

PHP exec not working with gcc

I just spent a few hours pulling my hair out over this. I'm trying to get gcc to compile a file from within PHP. $command = "/usr/bin/gcc /var/www/progpad/temp/tNu7rq.c -o /var/www/progpad/temp/tNu7rq.out"; exec($command, $output, $returnVal); echo $returnVal."<br />"; //returns 1 and no output file created. I'm running th...

Lightweight spinlocks built from GCC atomic operations?

I'd like to minimize synchronization and write lock-free code when possible in a project of mine. When absolutely necessary I'd love to substitute light-weight spinlocks built from atomic operations for pthread and win32 mutex locks. My understanding is that these are system calls underneath and could cause a context switch (which may be...

Free static checker for C99 code

I am looking for a free static checker for C99 code (including GCC extensions) with the ability to explicitly say "these preprocessor macros are always defined." I need that last part because I am compiling embedded code for a single target processor. The compiler (Microchip's C32, GCC based) sets a macro based on the selected processo...

how to read scanf with spaces

I'm having a weird problem i'm trying to read a string from a console with scanf() like this scanf("%[^\n]",string1); but it doesnt read anything. it just skips the entire scanf. I'm trying it in gcc compiler ...

How to create dll using gcc compiler/Mingw for visual basic?

How to create dll using gcc compiler/Mingw for visual basic? ...

Using MSADO15.DLL and C++ with MinGW/GCC on Windows Vista

INTRODUCTION Hi, I am very new to C++, is my 1st statement. I have started initially with VC++ 2008 Express, I've notice that GCC becomes kind of standard so I am trying to make the right steps event from the beginning. I have written a piece of code that connects to MSSQL Server via ADO, on VC++ it's working like a charm by importin...

C grammar in GCC source code

I'm looking for the C grammar in GCC source code, more specifically for the grammar in the yacc/bison form. ...

XCode project complains about missing files if a linked framework contains private headers

My Problem is this: My framework contains public and private headers - the public headers import private headers in the framework My app that links against this framework imports public headers Now when I compile it, XCode complains about missing files (the private headers that are indirectly imported via the frameworks public header...

Building 16 bit os - character array not working

Hi. I am building a 16 bit operating system. But character array does not seem to work. Here is my example kernel code: asm(".code16gcc\n"); void putchar(char); int main() { char *str = "hello"; putchar('A'); if(str[0]== 'h') putchar('h'); return 0; } void putchar(char val) { asm("movb %0, %%al\n" "movb $0x0E, %%a...

How can you determine installed versions of the glibc (etc.) libraries?

I'm working with an embedded Linux deployment and am using a cross compiler tool chain that doesn't compile I2C library function calls. How do I determine the precise versions of the libraries on the system so that I may rebuild the tool chain? I don't intend to replace the libraries deployed, as I do know they work (including I2C), s...

getaddrinfo is not statically compiled

I have included the header netdb.h, where getaddrinfo is included, but gcc issues this warning: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking gcc -m32 -static -s -O2 -std=c99 -D_POSIX_C_SOURCE=200112L myprogram.c How can I statically comp...

Getting 'error while loading shared libraries' when using -L to specifically find the library.

I've been trying to solve this for a few hours now. I am compiling some c files using gcc. The files require libpbc, so I am using the -L flag to point gcc at the directory which contains libpbc.so.1. The code compiles without error yet when I attempt to run it I get the following error message: ./example.out: error while loading sh...

link to a different libc file

I want to supply the shared libs along with my program rather than using the target system's due to version differences: ldd says my program uses these shared libs: linux-gate.so.1 => (0xf7ef0000)(made by kernel) libc.so.6 => /lib32/libc.so.6 (0xf7d88000)(libc-2.7.so) /lib/ld-linux.so.2 (0xf7ef1000)(ld-2.7.so) I have successfully lin...

C++ std::stringstream seemingly causes thread to hang or die under SunOS

I have an application developed under Linux with GCC 4.2 which makes quite heavy use of stringstreams to wrap and unwrap data being sent over the wire. (Because the Grid API I'm using demands it). Under Linux everything is fine but when I deploy to SunOS (v5.10 running SPARC) and compile with GCC 3.4.6 the app hangs when it reaches the p...

boost::unordered_map support by gcc

When unoreded_map support was added to gcc? I'm using gcc 4.1.1 shipped with RHEL 5.3. It looks like unoreded_map is missing. Is there a way to add it manually? ...

Can I cross compile with gcc for an old version of a Linux distro on my Ubuntu 9.10?

Hi, I have some old hardware with an old version of say SuSE linux running on it. Now I have this fancy development machine running Ubuntu 9.10. Some of the tools I use to compile my C app (written in Python 2.6.x) are not available on the old SuSe box. So... is it possible to compile for that old machine on my dev box? I have the foll...