gcc

How to eliminate external lib/third party warnings in GCC

Hi everyone, In the software project I'm working on, we use certain 3rd party libraries which, sadly, produce annoying gcc warnings. We are striving to clean all code of warnings, and want to enable the treat-warnings-as-errors (-Werror) flag in GCC. Is there a way to make these 3rd party generated warnings, which we cannot fix, to disa...

How many characters does string class in c++ support ?

Possible Duplicate: Maximum length of a std::basic_string<_CharT> string I would like to know how many characters does string class in c++ support. thanks.. ...

Linux: How to embed version information into shared library and binary?

On Linux, is there a way to embed version information into an ELF binary? I would like to embed this info at compile time so it can then be extract it using a script later. A hackish way would be to plant something that can be extracted using the strings command. Is there a more conventional method, similar to how Visual Studio plant ver...

Problems building GCC for Embedded PowerPC

I have an Embedded linux PowerPC project based on a powerpc-e300c3 core for which I have a board support package that included a GCC set up for a --host=i686-pc-linux-gnu and --target=powerpc-e300c3-linux-gnu. This happily creates executables from a host machine for execution on the embedded machine. For development I have the PowerPC's...

Why Does GCC Throw Errors About Unspecified Options?

When I run the following command from a makefile on 64-bit Red Hat Enterprise Linux 5.0 using GCC 4.2.3: gcc -c -ansi -pedantic -O0 -fPIC -I. -I.. -Iheader_files/include "source_file.c" I get the following error: cc1: error: unrecognized command line option "-lang-c" Superficially, the problem is that "-lang-c" is no longer a valid...

Is there a transparent way to force 64-bit gcc compilation on Solaris

Is there a way to force '-m64' not overriding CXXFLAGS/CFLAGS. I want automatic x64 build environment like in Linux/BSD amd64. Why do I need this? The problem is complexity of the project I need to be buit as x64 on Solaris. It contains several parts and each may use specific C/C++ compiler flags. So, I can't just run: CXXFLAGS=-m64 ...

What is the difference between '__asm' and '__asm__'?

I am learning inline assembly in C. As far as I can tell, the only difference between __asm { ... }; and __asm__("..."); is that the first uses mov eax, var and the second uses movl %0, %%eax with :"=r" (var) at the end. Also, there are a lot less websites about the first. What other differences are there? ...

Compiling GCC 4.x.x on MinGW / MSYS Fails

I've been attempting for the last week or so to compile any of the GCC 4 series of compilers to run in MinGW 5.1.6 / MSYS 1.0.11 (automated installers both from Sourceforge.org) which ships with GCC version 3.4.5. The end goal is to get GCC 4.5 to install, but I haven't been able to get any of the 4.x.x compilers to build. I've narrowe...

make deleting dependency files

I'm not sure if it's gmake or gcc that I don't understand here. I'm using the -MM and -MD options to generate dependency rules for the Unit Testing framework I'm using. Specifically: $(TEST_OBJ_DIR)/%.d: $(TEST_SRC_DIR)/%.cpp @$(CPPC) -MM -MD $< -o $@ @sed -i -e 's|\(.*\)\.o:|$(OBJ_DIR)/\1.o $(TEST_OBJ_DIR)/\1.d $(TEST_OBJ_DIR)/\1...

Gcc search path for crt1.o and crti.o

Hey I have compiled a cross-compiler tool chain with gcc and glibc. But I'm having some problems with the compiler. When I'm trying to compile a simple file it complains about a missing crti.o and crt1.o. These files does exist in ${TOOLCHAINPATH}/lib, but I do not know how to instruct the compiler/linker to look their. So, how can I...

Can't find libavcodec when running ./configure for vlc

Hi, I am trying to run './configure' for vlc on ubuntu 10.04. But it can't find libavcode libraries for some reason. I have check /usr/lib, it has the libraries, why ./configure can't find it? This is the error from './configure': checking for AVCODEC... no configure: error: Could not find libavcodec or libavutil. Use --disable-avcod...

Best way to convert Unix time_t to/from abitrary timezones?

My code receives a time_t from an external source. However, that time_t isn't acutally based on UTC Epoch time, along with it I get a timezone string (eg, EDT, PST, etc), and its based on this offset'ed epoch. I need to convert this to a true UTC Epoch based time_t. Additionally, I need to be able to go in the opposite direction, taking...

Does gcc support 128-bit int on amd64?

Does gcc support 128-bit int on amd64? How to define it? How to use scanf/printf to read/write it? ...

file format not recognized; treating as linker script

I am trying to run the C files downloaded from here as follows : gcc main.c docs_file.txt ksg_file.txt However, I receive the following error: /usr/bin/ld:docs_file.txt: file format not recognized; treating as linker script /usr/bin/ld:docs_file.txt:2: syntax error collect2: ld returned 1 exit status I am not sure what the problem ...

Virtual Instance of a C compiler on client browser

Is there a way I can create a virtual instance of gcc compiler on the client browser when the client opens my website?? By doing so, I can directly pass the user .c file as argument to my compiler instance and then execute it without having to make a POST call to server and execute the file there??? ...

Imitate/emulate a big-endian behavior in C?

I was wondering if it's possible to emulate a big-endian behavior, for testing purpose? via either windows or linux , mingw or gcc. Here's a sample of code which I would like the emulation to return big endian: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h> #if CHAR_BIT != 8 #error "Unsupported char si...

appname: /lib/libc.so.6: version `GLIBC_2.8' not found (required by appname)

ldd -v appname linux-gate.so.1 => (0x00949000) libpthread.so.0 => /lib/libpthread.so.0 (0x00cea000) libm.so.6 => /lib/libm.so.6 (0x00a83000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00ba1000) libc.so.6 => /lib/libc.so.6 (0x0015c000) /lib/ld-linux.so.2 (0x0012f000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00b93000) Version informatio...

Werror ignore certain files

I am wondering if it is possible to have werror in gcc/g++ exclude certain files (ones that I do not have source code to modify) so that I can continue using werror in a uninhibited state. ...

GCC to LLVM migration tips?

Xcode 4 comes with LLVM. As a casual programmer (i.e. download some open source projects and compile them on a mac via command line), is there any tips for the transition? ...

What modbus library should I use for modbus protocol for GCC

Dear all, We are building a product, which requires modbus communication (both rs-485 and TCP/IP). The code has to run on an embedded device which has Linux running on it. We have following criteria for the selecting the library that we would be using. It has to be opensource, since we are opensource geeks. We would give this product ...