gcc

how i install gcc to my new linux system by using source code :centos5.2?

hi, everybody, In my new centos5.2 system, there are not any component. if using Source code installing method, failled! because there is not a compiler for c/c++ code. how to use rpm method? which dependencies i need? thanks! Michael zhou. ...

How to get GCC linker command?

How can I get the command line GCC uses to invoke ld? I have a problem for an AVR target where GCC apparently adds a linker option which I am trying to override, so I would like to look at the exact options GCC uses for ld. ...

gcc linker errors when using boost to_lower & trim

Hi I'm trying to use the boost library in my code but get the following linker errors under Sparc Solaris platform. The problem code can essentially be summarised to: #include <boost/algorithm/string.hpp> std::string xparam; ... xparam = boost::to_lower(xparam); The linker error is: LdapClient.cc:349: no match for `std::string& ...

What's the best way to check if you C code has deprecated POSIX calls?

I've been working on some older C code. I found out that there are quite some POSIX calls that are now outdated and marked deprecated in the manual pages. What's the best way to check if there are still deprecated POSIX calls in your code? I'm thinking of either: special gcc warning options. some kind of lint tool detecting these call...

Debug heap/STL debugging equivalent for GCC?

I plan on using GCC more (Linux and Windows) and I was wondering if there's an equivalent of the MSVC debug heap and the STL checks available for the GCC CRT and STL. I already know about tools such as Valgrind, but I'm looking for something built in the libraries. ...

How I can add a keyword to gcc?

My target is to analyze and learn in details of compiler development techniques. Here I want to add a keyword in gcc and see how it works. ...

Filter C++ through a perl script?

I have a perl script I'd like to filter my cpp/h files through before gcc processes them normally -- basically as an extra preprocessing step. Is there an easy way to do this? I realize I can feed the cpp files to the script and have gcc read the output from stdin, but this doesn't help with the header files. ...

Are integers in C assumed to be handled by a hardware spec or handled in software?

Are integers in C assumed to be handled by a hardware spec or handled in software? By integer, I am referring to the primitive "int" The underlying idea being that if integers in C are not hardware dependent would it be a violation of standard to have gcc implement different integer handlers. This way you could have your traditional 32...

Problem with rand() in C

Possible Duplicate: why do i always get the same sequence of random numbers with rand() ? This is my file so far: #include <stdio.h> int main(void) { int y; y = generateRandomNumber(); printf("\nThe number is: %d\n", y); return 0; } int generateRandomNumber(void) { int x; x = rand(); return x; } ...

How to handle stdafx.h in cross-platform code?

I have a Visual Studio C++ based program that uses pre-compiled headers (stdafx.h). Now we are porting the application to Linux using gcc 4.x. The question is how to handle pre-compiled header in both environments. I've googled but can not come to a conclusion. Obviously I want leave stdafx.h in Visual Studio since the code base is p...

Including a library in Qt, why isn't this working?

This seems like it should be really simple. I compiled a library in Qt (this newmat library), and produced the file libnewmat.a. Now I need to integrate this library into another project but I just can't get it to work. I've tried a few different things with the LIBS variable in my .pro file including: Win32:LIBS += libnewmat.a #libr...

Differences in Macro ## concatenation operator between Visual-C++ and gcc

Hello, I'm having a macro like this ( not exactly, but function is quite equivalent): #define STRUCTMEMBER(Member,Value) GlobalStructInstance. ## Member = Value ... STRUCTMEMBER(Item,1); This works perfectly in Visual C++, but gcc 3.4.5 (MingGW) yield the following error: pasting "." and "Item" does not give a valid preprocessing to...

Align native code on fixed size memory boundaries with GCC/G++/AS ?

I have a C function that contains all the code that will implement the bytecodes of a bytecode interpreter. I'm wondering if there is a way to align segments of the compiled code in memory on fixed size boundaries so that I could directly calculate the address to jump to from the value of the bytecode? Sort of the same way an array work...

C (gcc on linux): How do i convert a hex string "0xfffffff" to an integer ?

C (gcc on linux): How do i convert a hex string "0xfffffff" to an integer ? ...

Disable warning messages in GCC through header files?

I am using the function gets() in my C code. My code is working fine but I am getting a warning message (.text+0xe6): warning: the `gets' function is dangerous and should not be used. I want this warning message not to pop up.Is there any way? I am wondering that there might be such possibilities by creating a header file for disabli...

interrupt program in debugger when c++ exception is thrown

How can I make gdb interrupt (like in breakpoint) the program at the point where an exception is thrown, and interrupt again on rethrows and beginnings of the relevant catch blocks? ...

Where are include files stored - Ubuntu Linux, GCC

So, when we do the following: #include <stdio.h> versus #include "myFile.h" the compiler, GCC in my case, knows where that stdio.h (and even the object file) are located on my hard drive. It just utilizes the files with no interaction from me. I think that on my Ubuntu Linux machine the files are stored at /usr/include/. How does...

Programs compiles in g++ but exits with linker errors in gcc

I'm trying out the solution to a question about specialized template classes. This code with a compiles fine in g++, but throws up linker errors when compiled with gcc. What's the cause of these errors ? $ g++ traits2.cpp $ gcc traits2.cpp /tmp/ccI7CNCY.o: In function `__static_initialization_and_destruction_0(int, int)': traits2.cpp...

Objective-C #import loop

Hi, I have the following code: #import <Foundation/Foundation.h> #import "ServerRequest.h" // works even though this line is included #import "ServerResponseRecord.h" @protocol ServerRequestDelegate<NSObject> -(void)request:(id)request gotResponseRecord:(ServerResponseRecord*)response; -(void)request:(id)request gotError:(NSError*)er...

Keil vs GCC for ARM7?

How does Keil compare to GCC for ARM7 development? I'm in the process of choosing hw consultants for a medium size project and some use keil and some use gcc. I'd like to know the gotchas involved in going with either option... ...