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.
Related
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 1 year ago.
Improve this question
Could you guys tell me why a simple c++ file can't work and gives me errors in the terminal.Is it a simple error? Thank you.The photo is on the link:
You are invoking g++ in Windows. You must guarantee that this compiler and the relevant development tools are installed and configured correctly first.
These are the prerequisites before you start to use them:
https://code.visualstudio.com/docs/cpp/config-mingw#_prerequisites
You can refer to:
Instructions on the MSYS2 website to install Mingw-w64.
VSCode tutorial Using GCC with MinGW, this is quite clear, for example prerequisites point 4 tells you how to add the path to your Mingw-w64 bin folder to the Windows PATH environment variable carefully.
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.
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.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Trying to compile this WinURL tool from source on Win 8.1:
http://www.chiark.greenend.org.uk/~sgtatham/winurl/
(src zip on that page if you want to take a look)
The reason is that I want to change the keybinding from Win+W to something else as Win 8.1 takes over Win+W for search and the tool no longer works on Win 8.1
What are my choices for a minimal dev env on Win 8.1? I'm not interested in installing GBs of tools if I can get away with something very simple that just lets me compile the above. Would something like Cygwin gcc or MinGW work or do I need some sort of Visual Studio and if so is there a simple free edition I can use?
If you're looking for a lightweight compiler-only solution, don't look beyond MinGW. You can install it and add its bin folder to the Environment PATH variable.
If you want an IDE too, I would recommend CodeBlocks, or DevC++.
I would recommend CodeBlocks over DevC++ as people report to DevC++ being slow, and also its development cycle is very slow.
These are all free and open source solutions. And lightweight.
I got it to compile just fine with MinGW using the following script:
del *.o winurl.exe
windres winurl.rc winurlres.o
gcc -c winurl.c
gcc -o winurl.exe winurl.o winurlres.o C:\MinGW\lib\libgdi32.a -mwindows
strip winurl.exe
del *.o
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!