Variadic template error: 'In instantiation of' (gcc 9.2)
I'm learning about variadic template on c++17 on the Jason Turner's youtube channel then I copy his example code (shown below). In his video he uses the site godbolt.org with the gcc 7.#include...
View ArticleCan't link boost program_options library with g++. undefined reference to...
I'm trying to build the following code:Content of "stdafx.h"#define BOOST_ALL_DYN_LINK #include <boost/lambda/lambda.hpp> ... #undef BOOST_ALL_DYN_LINK #include <boost/program_options.hpp>...
View ArticleHow can I get GCC to optimize this bit-shifting instruction into a move?
I'm trying to use the following code to emulate a 16-bit half-float in software:typedef struct half { unsigned short mantissa:10; unsigned short exponent:5; unsigned short sign:1; } half; unsigned...
View Articlehomebrew can't install formula due to CC looking for not existing gcc version
I am runnng Mac OS 10.12 with Xcode 8.0.I tried to install the FEM-package elmer from ElmerCSC/homebrew-elmerfem.$ brew install elmer --with-elmergui --HEAD --with-elmerice --verbose But building...
View ArticleCan CMake use g++ to compile C files?
I have worked on a project where I was using g++ to compile C code in files that end in .c. The reason is that I'm told that g++ has better warning messages.I am switching the build process for this...
View ArticleRun a program built with gcc8 on a producing environment without gcc8
My developing/producing environments are all CentOS-7.7. In order to compile my program with gcc-8.3.0, I have installed "devtoolset-8" on my developing env, but it can not be used in the way same as...
View ArticlePDCurses wont compile on windows
I am trying to compile PDCurses, but when it attempts to compile pdcscrn.c it gives the error message../wincon/pdcscrn.c:93:5: error: unknown type name 'PCONSOLE_SCREEN_BUFFER_INFOEX'; did you mean...
View ArticleIs this a GCC bug like learncpp.com claims?
In C++ learning website (https://www.learncpp.com/cpp-tutorial/6-9a-dynamically-allocating-arrays/) there is a claim that GCC has a bug related to C-style string initialization when new operator is...
View ArticleTrouble building gcc on Mac - can't find system headers
I'm on a Mac running OS-X High Sierra and wanted to create a separate build of gcc. Lemme share a little of the process it took me a week to work out so it will help others:I made a safe directory...
View ArticleHow can I pause execution of a C program in linux? [duplicate]
I want to promt "Press any key to continue message" and continue the program on pressing any key. I use gcc compiler which does not comes with conio.h, so i cannot use getch(). sleepp() can pause the...
View ArticleGCC error when installing ncurses on OS X 10.8
I'm trying to install ncurses 5.9 on OS X 10.8 with GCC 4.9 installed. No errors or warnings show up when I run ./configure in the ncurses directory, but when I run make, I get gcc: error: unrecognized...
View Articlegcc inline - operand type mismatch for 'cmp'
I get the following error: Assembler messages: Error: operand type mismatch for `cmp'The only cmp in my code is:"cmpl %eax, $15\n\t"I don't get what is wrong with that - I have a register and an...
View ArticleHow can I mask the warning from makecontext if the function passed in has...
When using the function, makecontext, from <ucontext_t.h> in C, it takes the arguments (ucontext_t* context, void (*someFunction)(void), int numberOfArguments, ...). The numberOfArguments is to...
View ArticleMinGW GCC: multiple definition of destructor and non-virtual thunk
I'm trying to build elements library after few recent changes and can not make it link.My toolchain:GCC 9.2.1 with MCF threadsCMake 3.16.4The commit that breaks the build:...
View ArticleStrong and weak functions not resolved correctly inside same library
Context: Compiling for an STM32 microcontroller using GCC (arm-none-eabi...)I have a library that wraps the STM32 specific code (HAL.a), that code includes a startup file that declares the interrupt...
View Articleargv[] always returns the same integer
I am attempting to make a simple dice program. The program can run 2 ways: Either by using scanf() to get the amount of dice needed to be rolled, or by passing the amount of dice to be rolled as an...
View ArticleHow C handles the structures that are defined twice? [closed]
Structure rb_nvm_InitData_tst is defined in A.c with variables var1 and var2. It is initialized here with its instance rb_nvm_InitData_nvmast which is an array.Structure rb_nvm_InitData_tst is also...
View Article64bit integer conversion from string
I'm dealing with the problem of reading a 64bit unsigned integer unsigned long long from a string. My code should work both for GCC 4.3 and Visual Studio 2010.I read this question and answers on the...
View ArticleHow to find out which optimizations are actually applied when using gcc?
With IBM's XL compiler family it is possible to supply two options (-qreport and -qlist) to generate reports for each source file that include information on which optimizations were applied, or which...
View Articlecommand for compilation $ gcc Line.cpp -lGL -lGLU -lglut
compilation error - c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lGL c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lGLU...
View Article