Changing gcc/g++ version causes segfault [closed] - c++

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
It seems that changing the version of gcc I use from gcc 4.7.3 to gcc 4.9.2 causes a segfault for my project (after a clean build and run).
In an unfortunate turn of events gdb is broken on the server I am
getting this error on and can't use it for now. Any known changes in gcc itself that could cause this? I suspect the issue is potentially caused by a double free.

You should try to use valgrind.
Valgrind is a debugging tool only requiring for your code to be compiled with the -g flag. It's the best way to spot segmentation fault over a program, or any memory leak.
Think about using valgrind options while debugging (it's at the bottom of the valgrind report) something like leak-checkfull (I'm not able to run valgrind right now so I can't tell you exactly what it is).
But whenever I compile my code, I use valgrind with it to check every possible failure. Consider even putting VG in your Makefile rules for more simplicity.

Related

cant run any c/c++ program [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
Anytime I try to run a simple C or C++ program in CLion or emacs, no output shows up.
EDIT: Using virtual environment, C was not installed properly.
CLion doesn't ship with a C/C++ compiler. You need to install your own compiler, and then set it up with CLion.
For windows, you can install:
MinGW
Cygwin (make sure you select gcc-core and g++ during setup)
CLion will detect these environments automatically during installation if you set them up in their default locations.

How to get compiler warnings JUCE - Ubuntu [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I was recently dealing with an error that should have easily been realized with a simple compiler warning.
Does anyone know how to get compiler warnings to show up when compiling JUCE projects with make on Ubuntu?
I attempted:
make -Wall from the gcc/gnu Warning Options docs -> no change
make V=1 as commented in the makefile -> it was verbose, but didn't show the warnings
Editing the live build settings in the Projucer -> live build doesn't work on Ubuntu
Edit: Answered by OMGtechy
To add compiler warnings to the build: edit the Linux Makefile settings in the Exporter tab of the Projucer File Manager (See the picture in his answer). However, I didn't see any "uninitialized variable" warnings until I also ran with the optimization flag -O2. Apparently gcc is bad with that warning.
You want to add -Wallto your exporter compiler flags, possibly with -Werror too. Just adding them to the live build flags will only affect the Projucer's live build feature.

Why am I getting "No manual entry for gcc" [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
When I enter:
man gcc
I get "No manual entry for gcc". The same thing happens with g++. Why am I getting this and how can I fix it?
I have both gcc and g++ but it just doesn't seem to work when I use it on the Cygwin terminal. I'm on Windows.
You don't have the help files (aka man pages) for gcc or g++ installed in cygwin. You need to re-run the cygwin setup*.exe and select it to be installed. I'm not sure which package it is though.

What is the minimum reasonably supported GCC version? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have been developing a C++11 application against a modern compiler on my mac/linux, which works fine but then I tried to deploy it to a very old linux box (g++ 4.1.2: Feb 2007) and of course that's too old and the executable won't work.
This isn't surprising but now I'm wondering if there is a standard amount of time you are expected to support a compiler/standard?
I had a look around but there is no mention of this.. Should the support for a compiler version drop when the developers themselves deem it end of life and will not patch bugs?
You're the one running gcc (or g++). It's a compiler, used by developers. End-user systems may not have any version of gcc. It's glibc and libstdc++ you need to worry about. But in general, Linux does not aim for binary compatibility. Do not expect any binary executable to run properly on any other distribution/major version.
Conversely, glibc and libstdc++ are careful to work with old kernel versions, so you should be able to install (configure+make+install) the latest runtime support libraries on your Linux box, and then build your application for that.
The easiest way to do that is probably to install the same distribution and version that your target has, into a virtual machine. Then install the C++11 developer tools, and build your application.

Has anyone successfully used Eclipse CDT + Eclim + CDT4 Generator? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Has anyone successfully used these three together? I used CDT4 to generate my eclipse project files. With the GUI version, things work fairly well. Most features work. Although I have problems with external libraries. For some reason eclipse won't recognize the standard library strings and some of my other external library variables. I've read online that modifying "C/C++ Build" properties can help. However when I use CDT4 to generate my workspace, that option disappears in the preferences menu.
Now when I try to use eclim and vim to work on my workspaces I run into more strange issues. It seems like the completion stuff works pretty well. And Eclipse will mark problem lines with ">>" notation. However I've noticed that navigating the code is not working at all. For example hierarchical call trees and jumping to the definition of a symbol. These things work fine in the GUI.
Does anyone have any tips/tricks to help me out here? Are there any solid guides on the web that address issues like these?
Thanks!