Error message when building WxWidgets sample program
I was trying to follow the instructions here to setup WxWidgets.I've managed to run the commands wx-config --version and wx-config --list but not the commands to compile the minimal example, which...
View ArticleC++ 14 GCC prefers constructor with std::initializer_list instead of...
I encountered some situation that I cannot explain.I succeeded to reproduce the problem in a short example:My class MyObj (originally nlohmann::json) has 2 constructors: move constructor and...
View Articlebuild boost::iostreams with zlib
I'm trying to build the following code:#include <boost/iostreams/filter/zlib.hpp>#include <iostream>int main(int argc, char* argv[]){ int a = boost::iostreams::zlib::default_compression;...
View Articlewhy the program is not terminating in gcc? [closed]
Why the program listed below is not terminating. I am using gcc compiler in linux.#include <stdio.h>int main(void){ int c; printf("Enter characters: "); while((c = getchar()) != EOF) putchar(c);...
View ArticleCan't link static boost::iostreams library
I build the following code:#include <boost/iostreams/filter/zlib.hpp>#include <iostream>int main(int argc, char* argv[]){ int a = boost::iostreams::zlib::default_compression; std::cout...
View ArticleMake errors in Ubuntu WSL
I'm trying to use make to build a static library. This operation is successful if I run it from a virtual machine (using CentOS 7 on VirtualBox) or on one of our company's Linux servers, but I get the...
View Articlevpcmpeqb in inline assembly
Currently I am trying to move from using NASM, to using inline assembly in c, as this would make linking a lot easier in the future (especially with inlining). However, I can't get my vector...
View ArticleWhy does GCC use multiplication by a strange number in implementing integer...
I've been reading about div and mul assembly operations, and I decided to see them in action by writing a simple program in C:File division.c#include <stdlib.h>#include <stdio.h>int main(){...
View ArticleExecut binaries / tests on host that are built by non-host toolchain
Scenario:We would like to build our sources by an external / hermetic toolchain so all includes, libs and tools from the host are ignoredTo do so, a new toolchain is introduced to Bazel-Configuration....
View ArticleHow can I configure Codeblocks to not close the console after the program has...
I should specify, I do not want to do the waiting for input thing or to use the debugger. I want the program to run and terminate as it normally would, but where the console window doesn't close after...
View ArticleInstall gccgo for testing Protocol Buffers 3 along with Go
I'm trying to install gccgo for testing Protocol Buffers 3 with Golang...I have to confess that I'm back to dev after 8 years off (and I'm not a native speaker) so, thank you for your indulgence. Thank...
View ArticleWrite registers data into array using asm C
I created a program that writes registers data into variables using asm. And it seems to be working well. But then I decided to replace variables by an array and to write registers data into an array....
View ArticleWhat are the exceptions for __always_inline and __never_inline in gcc?
Andrei Alexandrescu mentioned in a talk that he presented at cppcon that gcc doesnt always inline when then __always inline macro is defined and used, and vice-versa for __never_inline. I couldn't find...
View ArticleCan I tell gcc/g++ to warn on missing header guards?
Whether one uses #ifndefs or #pragma onces, compilers understand guards. And every header file (.h/.hpp) should have a guard. Exceptions perhaps for some .inc files that might be intended to be...
View ArticleExecutable without dynamic linkker
Can I compile (using g++ compiler) an executable (on linux) and strip out the dynamic linker /lib64/ld-linux-x86-64.so.2 ?I mean that if I ldd the executable after building it should detect the linker...
View ArticleHow to solve duplicate function problem when linking libraries?
I have executable, that links against library1.so. Library1.so contains a function called json_object().I am trying to enhance library1 where library1.so would link against library2.so. Unfortunately,...
View Articlecan't compile OpenFOAM v1912 with intel icc and intelmpi
! UPDATE on 28 Feb, 2020:The problem is solved. please refer to :https://develop.openfoam.com/Development/openfoam/issues/1608SummaryI'm new to OpenFOAM and I'm trying to compile OpenFOAM-v1912 using...
View ArticleGCC: GLFW undefined reference to `glfwCreateWindow' [duplicate]
I created the ./hello-glfw folder. and I have an index.c file. Here's what my file looks like#include <GLFW/glfw3.h>int main(void){ GLFWwindow* window; /* Initialize the library */ if...
View Articlegch file generates stray character errors
I'm compiling a small library with the commandg++ cppbase.cpp -c -wand I'm using pre-compiled header cppbase.h.gch. cppbase.cpp looks like this:#include "../inc/cppbase.h.gch"namespace cppbase {...
View ArticleDifferent ways how gcc allocate memory for stack [duplicate]
How does gcc decides how much memory allocate for stack and why does it not decrement %rsp anymore when I remove printf() (or any function call) from my main?1. I noticed when I played around with a...
View Article