g++

Default file extension of the executable created by g++ under Cygwin vs Linux.

Hi All, I've done most of my work on VisualStudio and don't have much experience with gcc or g++. When I tried to compile a (ex. aprogram.cpp) this morning on my pc using cygwin, I got (aprogram.exe) when I tried to compile the same thing on my Ubuntu box I got (aprogram) w/o any extension. I am just wondering if someone be kind enough ...

profile linking times with gcc/g++ and ld

I'm using g++ to compile and link a project consisting of about 15 c++ source files and 4 shared object files. Recently the linking time more than doubled, but I don't have the history of the makefile available to me. Is there any way to profile g++ to see what part of the linking is taking a long time? Edit: After I noticed that the ...

What make g++ include GLIBCXX_3.4.9?

I compiled 2 different binaries on the same GNU/Linux server using g++ version 4.2.3. The first one uses: GLIBC_2.0 GLIBC_2.2 GLIBC_2.1 GLIBCXX_3.4 GLIBC_2.1.3 The second one uses: GLIBC_2.0 GLIBC_2.2 GLIBC_2.1 GLIBCXX_3.4.9 GLIBCXX_3.4 GLIBC_2.1.3 Why the second binary uses GLIBCXX_3.4.9 that is only available on libstdc++.so.6.0...

Suppressing Linking Errors in G++ 3.4.6

Don't ask why, but is there any way to suppress a failed linking error? Such as: undefined reference to BLANK This is in GCC 3.4.6 ...

Statically linking to a dynamic library. glibc

So. I have a problem where I have two versions of GCC on a machine. 3.4.6 and 4.1 This is due to some dependency issues with a new piece of software. (requires glibc 4.1) When I go to link this new software with the 4.1 libraries it links fine. However, when it comes to executing the software it can't find the library, because it is...

How to use multiple versions of GCC

We have a new application that requires glibc 2.4 (from gcc 4.1). The machine we have runs on has gcc 3.4.6. We can not upgrade, and the application must be run on this machine. We installed gcc 4.1, however, when it comes to compile time it is using all the includes, ect, from 3.4.6. How do we get around this? Any suggestions...

Dealing with "C compiler cannot create executables" in Cygwin

Whatever I try to compile in Cygwin I get the following output: checking for mingw32 environment... no checking for EMX OS/2 environment... no checking how to run the C preprocessor... gcc -E checking for gcc... gcc checking whether the C compiler (gcc ) works... no configure: error: installation or configuration problem: C compiler ...

Eclipse CDT - problem linking to windows lib files...

Hey! I'm getting the folling linker errors when compiling with gcc: undefined reference to `SetStretchBltMode@8' undefined reference to `StretchDIBits@52' undefined reference to `SetDIBitsToDevi Are these functions defined in the windows libs? If so do they come installed with Vista, or do I need to install them, and if so where c...

Dynamic Shared Library compilation with g++

I'm trying to compile the following simple DL library example code from Program-Library-HOWTO with g++. This is just an example so I can learn how to use and write shared libraries. The real code for the library I'm developing will be written in C++. #include <stdlib.h> #include <stdio.h> #include <dlfcn.h> int main(int argc, char **...

xcode / gcc linking problem: file is not of required architecture

Hi, I am trying to port a windows project that includes boost 1.37 and wxwidgets to the mac. It compiles ok, but the linker gives me a "file is not of required architecture for architecture ppc" error for libz.1.dylib and the same message as a warning a few other libraries. I also get a "duplicate dylib" warning for libz.1.dylib. The ...

How to supress specific warnings in g++

I want to suppress specific warnings from g++. I'm aware of the -Wno-XXX flag, but I'm looking for something more specific. I want some of the warnings in -Weffc++, but not all of them. Something like what you can do with lint - disable specific messages. Is there a built in way in gcc to do this? Do I have to write a wrapper script? ...

How do I check if gcc is performing tail-recursion optimization?

How do I tell if gcc (more specifically, g++) is optimizing tail recursion in a particular function? (Because it's come up a few times: I don't want to test if gcc can optimize tail recursion in general. I want to know if it optimizes my tail recursive function.) If your answer is "look at the generated assembler", I'd like to know ex...

Difference between -Wconversion between gcc and g++

Consider the following test program: static void func(int a) { } int main() { unsigned int b = 42; func(b); return 0; } Compiling it with gcc: lol@mac:~/projects$ gcc -Wconversion testit.c testit.c: In function âmainâ: testit.c:11: warning: passing argument 1 of âfuncâ as signed due to prototype lol@mac:~/projects$ ...

Problems linking static Intel IPP libraries on Linux with g++

I've been trying to move a project over from Xcode to Linux (Ubuntu x86 for now, but hopefully the statically-linked executable will run on an x86 CentOS machine? I hope I hope?). I have the whole project compiling but it fails at the linking stage-- it's giving me undefined references for all functions defined by IPP. This is probably...

How to compare two similar g++ -S assembly outputs?

diff fails as the assembly listing is filled with slightly different labels. ...

g++ include all /usr/include recursively

I'm trying to compile a simple program, with #include <gtkmm.h> The path to gtkmm.h is /usr/include/gtkmm-2.4/gtkmm.h g++ doesn't see this file unless I specifically tell it -I /usr/include/gtkmm-2.4. My question is, how can I have g++ automatically look recursively through all the directories in /usr/include for all the header files...

g++ issue with Magick++ and cygwin

When I try to compile a simple c++ file using Magick++ and cygwin, I keep getting this result: $ g++ -o imageTest imageTest.cpp `GraphicsMagick++-config --cppflags --cxxflags --ldflags --libs` g++: unrecognized option `-no-undefined' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -ldpstk collect2:...

Can I control register allocation in g++?

I have highly optimized piece of C++ and making even small changes in places far from hot spots can hit performance as much as 20%. After deeper investigation it turned out to be (probably) slightly different registers used in hot spots. I can control inlineing with always_inline attribute, but can I control register allocation? ...

cross compiling c++ to iphone arm

I've scanned over the (outdated) article that is the first hit on google about ARM cross-compiling. I've also seen the article about compiling OpenCV to the iPhone and the general cross compiling instructions there. My question is can I call the apparently already configured gcc/g++ in the iPhone developer package (which I already have i...

What's your favorite g++ option?

Hi, I am a newbie in C++ programming. When compiling I never use any option. This is my day to day command: g++ MyCode.cc -o MyCode For safety practice what's the best option to use? ...