gcc

how to compile a program with gtkmozembed.h

Hi, i have written a program under ubuntu, in which i include gtkmozembed.h. I am facing a problem in compiling the program.Below is the simplest form of a program which uses gtkmozembed. #include <gtk/gtk.h> #include <stdio.h> #include <gtkmozembed.h> int main(){ GtkWidget *mozEmbed; mozEmbed = gtk_moz_embed_new();...

Why aren't debugging symbols being added to my output file?

I am trying to compile a project to run on an ARM board that I have. To use the debugger, I have to put debugging symbols in the resulting .elf file. I configured everything and ran my makefile, which produced the following results: arm-elf-gcc -x assembler-with-cpp -c -mcpu=arm7tdmi-s -g -gdwarf-2 -Wa,-amhls=src/crt.lst src/crt.S -o...

WebKit and npapi and mingw-w64

Hi, The problem is the following: On Windows x64, pointers are 64-bit, but type long is 32-bit. MSVC doesn't seem to care, and even omits warnings about pointer truncation on the default warning level. Since recently, there is a GCC that targets x86_64-w64-mingw32, or better native Windows x64. GCC produces errors when pointers are trun...

gcc, UTF-8 and limits.h

My OS is Debian, my default locale is UTF-8 and my compiler is gcc. By default CHAR_BIT in limits.h is 8 which is ok for ASCII because in ASCII 1 char = 8 bits. But since I am using UTF-8, chars can be up to 32 bits which contradicts the CHAR_BIT default value of 8. If I modify CHAR_BIT to 32 in limits.h to better suit UTF-8, what do I ...

g++ and c++0x specification support

although it's been said that the support for c++0x new features in g++ are in experimental mode, many gcc developer claimed that you can use most of the new features in your codes and get the program to work. but when I try to compile this simple program it results in segmentation fault. Why? #include <thread> #include <iostream> void...

Is MinGW exactly the same as GCC as far as standards compliance or features?

As a port, I'd think it'd be hard to keep it completely up to speed with GCC. Is it, or are there any differences with regards to standards compliance or features? ...

Connect to a website via HTTP in C

i have a C code that parses a file and generates another file for the processed data. i now need to send these files to a web server (website). i guess there way is to do a HTTP POST. but i have never done this in c (Linux gcc compiler in ubuntu). Does anyone know how to do this. i need to a starting point as i have no clue of doing this...

How can I get bitfields to arrange my bits in the right order?

To begin with, the application in question is always going to be on the same processor, and the compiler is always gcc, so I'm not concerned about bitfields not being portable. gcc lays out bitfields such that the first listed field corresponds to least significant bit of a byte. So the following structure, with a=0, b=1, c=1, d=1, you ...

How to resolve include file names conflicts in GCC?

I have two header files named string.h in different libraries, they are conflicted with each other and even conflicted with standard C include file of the same name. There is no need to use any string.h except standard one, but I need to include libraries headers paths in GCC search path. Currently I use something like -I /usr/local/inc...

Configuration files for C in linux

Hi, I have an executable that run time should take configuration parameters from a script file. This way I dont need to re-compile the code for every configuration change. Right now I have all the configuration values in a .h file. Everytime I change it i need to re-compile. The platform is C, gcc under Linux. What is the best soluti...

Ignoring characters in a file while parsing

i need to parse through a text file and process the data. the valid data is usually denoted by either a timestamp with TS followed by 10 numbers (TS1040501134) or values with a alpabet followed by nine numbers (A098098098)...so it will be like TS1040501134A111111111B222222222...........TS1020304050A000000000........ However, there are c...

More GCC link time issues: undefined reference to main

Hi Guys, I'm writing software for a Cortex-A8 processor and I have to write some ARM assembly code to access specific registers. I'm making use of the gnu compilers and related tool chains, these tools are installed on the processor board(Freescale i.MX515) with Ubuntu. I make a connection to it from my host PC(Windows) using WinS...

g++, cost of exceptions when I don't use exceptions.

I've some C++ projects, which does not use exception handling. What are the benefits of adding -fno-exceptions , or does gcc figure out itself that I don't use exceptions(nor any libraries that uses exceptions) ? ...

non-copyable objects and value initialization: g++ vs msvc

I'm seeing some different behavior between g++ and msvc around value initializing non-copyable objects. Consider a class that is non-copyable: class noncopyable_base { public: noncopyable_base() {} private: noncopyable_base(const noncopyable_base &); noncopyable_base &operator=(const noncopyable_base &); }; class noncopya...

gcc 4.4 in Xcode

Hi how can I use the latest version of gcc installed from MacPorts in Xcode? ...

Which free C compiler gives options for greater optimizations?

Can you please give me some comparison between C compilers especially with respect to optimization? ...

How to build libpthread.so from source code?

I need a non-stripped version of libpthread.so for debugging. How can I compile it from source code? Host is Linux 2.6. ...

'Invalid conversion from some_type** to const some_type**'

I've got a function that requires const some_type** as an argument (some_type is a struct, and the function needs a pointer to an array of this type). I declared a local variable of type some_type*, and initialized it. Then I call the function as f(&some_array), and the compiler (gcc) says: error: invalid conversion from ‘some_type**’ t...

Suppressing "extra ';'" error in GCC when -pedantic is on

Hi all, I'm building my program with -pedantic flag, which causes an extra ';' error (because of a third-party header using a few macros inconsistently; the error is not shown when -pedantic is off). I don't really feel like turning -pedantic off, and neither do I want to edit the header. Is there any way to suppress this exact error? L...

What GNU C extensions are available that aren't trivial to implement in C99?

How come the Linux kernel can compile only with GCC? What GNU C extensions are really necessary for some projects and why? ...