gcc

Installing gcc 4.4.3 on Ubuntu 9.04

Hey, I have Ubuntu 9.04 and need to install gcc 4.4.3. Does anyone know how would I do that? I can't do it with any other versions except maybe gcc 4.4.x. Currently ubuntu 9.04 has only 4.3.3 available but that is not sufficient for me. Thank you in advance! ...

C memcpy error - memory could not be written on Windows XP

I have a C program which loads a file line-by-line into one string and then memcpy's this string into another string pointer using this code: typedef struct inmod_struct { Int32 ReturnCode; Int32 Length; char Body[ROWSIZE]; } inmdtyp,*inmdptr; inmdptr inmodptr; char line[600]; int doit() { ...

Why are the python.org OS X installers built with gcc-4.0?

In answering SO question 3500638, Ned Deily states that the Apple-supplied Pythons (2.5.4 and 2.6.5) are both built with gcc-4.2. However, all three of the python.org OS X Pythons (2.6.5, 2.7, 3.1.2) are built using gcc-4.0. Questions Why are the python.org Pythons (2.6.5, 2.7, 3.1.2) built using gcc-4.0? What are the gotchas of usin...

gcc 4.5.1 configure options for C++0x thread support

I am trying to compile gcc 4.5.1 for cygwin with support for C++0x threads. However, the resulting gcc does not recognize the -pthread option. My configure command is: ./configure --enable-bootstrap --enable-shared --enable-shared-libgcc --with-gnu-ld --enable-languages=c,c++ --enable-libgomp --enable-libssp --...

C++ undefined reference when linking

Im wondering if anyone would be able to help me as I have been scratching my head for two days on this. I have done the compilation and when trying to link a source code on linux getting undefined reference Compiling using, g++ -g -I/u01/kasunt/workspace/corelibCORBA/include -I/u01/kasunt/workspace/corelibCORBA/installed_compo...

Serializing binary struct gcc vs cl

Full disclosure - this is homework, although completed and fully working, I'm searching for a nicer solution. I have a binary file, which was created by a program compiled within Visual Studio (I believe). The structure looks something like this. struct Record { char c; double d; time_t t; }; The size of this structure o...

error: no matching function for call to 'make_pair(int&, Quest*)'

...

How do I change what version of GCC Xcode uses?

Currently, I am trying to compile Imprudence, a third party viewer for the Linden-Lab owned Second Life. I have gotten everything set up and I am now in Xcode. When I click on the Build And Run button, I get an error after a little bit stating that GCC 4.2 is not compatible with the Mac OS X 10.4 SDK. I have tried changing the Active Ar...

Objective-C 2.0 is not working in GNUstep

[GNUStep installers] gnustep-system-0.24.2-setup.exe gnustep-core-0.25.0-setup.exe gnustep-devel-1.1.1-setup.exe gnustep-cairo-0.22.1-setup.exe I installed them to windows 7. But, it is not able to use Objective-C 2.0 syntax. Example, @property, @synthesize, assign, and so on. And, I want to use CFSocket, but CoreFoundation was not su...

What's use of %c in x86_64 inline assembly?

I'm reading KVM source code and confronted with x86_64 inline assembly. In the following code, what's use of "%c"? It it new feature in x86_64 inline assembly? Any reference for new features in x86_64 inline assembly in gcc? Many thanks /* Check if vmlaunch of vmresume is needed */ "cmp $0, %1 \n\t" /* Load guest registers....

What is .cfi and .LFE in assembly code produced by GCC from c++ program?

I have the following c++ code int factorial(int n){ if(n==0){ return 1; } return n*factorial(n-1); } int main(void){ factorial(5); return 0; } When I create an assembly file using g++ -S factorial.cpp I get the following: .file "tail_call_opt.cpp" .text .globl _Z9factoriali .type _Z9fact...

System header files redefining macros: how do I tell gcc to ignore?

I have some Motif code that also uses widgets from the Xmt widget set. It include both "Xm/XmStrDefs.h" and "Xmt/ComboBox.h". However, there are some macros that are defined in both files: // XmStrDefs.h: #define XmNarrowSize "arrowSize" // ComboBox.h: #define XmNarrowSize "arrowSize" These are system header files that I'm not allow ...

i=i-- -- does gcc document, which will be done

Hello Once again, our best loved "i=i--" -like issues. In C99 we have: 6.5 Expressions #2: Between the previous and next sequence point an object shall have its stored value modified at most once 70) This paragraph renders !!undefined!! statement expressions such as i = ++i + 1; But for undefinded behavior there ca...

Problem with iostream

I m using MinGW for running g++ compiler on windows. Whenever I run the following code, it the compiler gives strange results. Code: #include <iostream> #include <cstring> using namespace std; int main() { int n; string a; cin>>n; getline(cin,a); cout<<a; return 0; } No problem occurs when I compile the code...

Baffling gcc complaint about usage of Qt4 setValidator

We're stumped as to why gcc complains about this line in our app: doubleFrom->setValidator(new QDoubleValidator(doubleFrom)); with these complaints: error: expected type-specifier before 'QDoubleValidator' error: expected `)' before 'QDoubleValidator' error: no matching function for call to 'QLineEdit::setValidator(int*)' candidates ...

p->data = (int*)malloc(sizeof(int)); compare to (int*)p->data = (int*)malloc(sizeof(int));

typedef struct _DListNode { struct _DListNode* prev; struct _DListNode* next; void* data; }DListNode; in gcc : DListNode *p = NULL; p = (DListNode*)malloc(sizeof(DListNode)); p->data = (int*)malloc(sizeof(int)); scanf("%d", (int*)p->data); compile correctly. in gcc : DListNode *p = NULL; p = (DListNode*)malloc(...

incorporate .so into another .so without dependency?

i have a c program that relies on a second library whose compilation i can control. i want to be able to compile my program into a shared object library without it linking to the second library. in other words i want a single monolithic shared object library at the end. how can i do this? if i separately compile the second library into ...

Redundant __packed__ attributes

This code is for Microchip's PIC32MX microprocessor. Their compiler is essentially GCC 3.4. I tend use GCC's __packed__ attribute to pack bitfields into a union, and later retrieve them as an unsigned char (ie. type-punning) for sending over SPI or I2C. This behaviour is all defined by my implementation, and works perfectly. I prefer th...

Optmization flags with g++

I am using g++ to compile a C++ code; a scientific simulation software. Currently I am using the -O3 and -funroll-loops flags. I could notice a big difference between -O0, -O1, -O2, and -O3, and almost no difference with -funroll-loops. Would you have any suggestions to help me to increase the optimization or tricks that I can use to g...

Ubuntu - how to unpackage gcc?

I am trying to unpackage "gcc-4.4_4.4.3.orig.tar.gz." After reading 5 sites from Google to do the unpackage, I cannot figure it out. Please tell me how to unpackage "gcc-4.4_4.4.3.orig.tar.gz." thanks ...