gcc can't find the linking lldap libraries even with -Llibrary-path...
I have a smal testing program to test ldap. I tried to compile it on Ubuntu 19.04. I have the source file called myldaptest.c, I ran: 1.gcc -c myldaptest.c 2.gcc -L/usr/lib/x86_64-linux-gnu -lldap...
View ArticleGCC seems to prefer small immediate values in comparisons. Is there a way to...
Firstly a trivial mathematical fact: given integers n and m, we have n < m if, and only if, n <= m - 1.GCC seems to prefer immediate values of smaller absolute value. Hence, when m is known and...
View ArticleBuilding boost with different gcc version
I have access to server where I need to build boost 1.46. How can I force bootstrap.sh to use /usr/bin/gcc-4.4. By default it uses /usr/bin/gcc and I can't figure out how to change this
View ArticleDowncasting shared_ptr to shared_ptr?
Update: the shared_ptr in this example is like the one in Boost, but it doesn't support shared_polymorphic_downcast (or dynamic_pointer_cast or static_pointer_cast for that matter)!I'm trying to...
View ArticleWhen try to compile with gcc, "error: error reading" shown on mac terminal
I'm trying to compile my c file created by MacVim with gcc on Mac terminal, but the screen showed like this:r_yeh_mbp_2019@Robinsons-MacBook-Pro ~ % cd Desktop r_yeh_mbp_2019@Robinsons-MacBook-Pro...
View ArticleWhat does the gcc warning "coverage_mismatch" mean?
Today I meet a Werror=Wcoverage_mismatch error when compiling some erlang/opt:beam/beam_emu.c: In function 'erts_current_reductions': beam/beam_emu.c:3150:1: error: the control flow of function...
View ArticleHow to install Nokogiri using gcc on MacOS Catalina
I am trying to install Nokogiri on my MacOS Catalina 10.15.1 system.gem install nokogiri The error in the log file is:"gcc -o conftest...
View ArticleLinker Script Always Interprets Variables as Zero?
There are a lot of logs and other stuff below, so to skip to the punchline: I have a linker script and am setting variables within it, and using these variables to set up memory sections. But it seems...
View ArticleGetting a list of all fortran floating proint error (FPE) warnings?
I am trying to compile and run some legacy fortran code on a linux box. At the end of the run, it says:Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG...
View ArticleInstall CLASS in python: cannot find -lmvec
I am trying to install CLASS (+MontePython) using the following link:https://monte-python.readthedocs.io/en/latest/installation.htmlorhttp://research.iac.es/congreso/cosmo2017//media/montepython.pdfI...
View ArticleSuppress Compiler warning Function declared never referenced
So i have some code like this:void foo (int, int); void bar ( ) { //Do Stuff #if (IMPORTANT == 1) foo (1, 2); #endif } When doing a compile without "IMPORTANT" I get a compiler Warning that foo is...
View ArticlePlace const variable to specific address in flash of LPC4074 with LPCXpresso...
I want to place a const variable to a specific flash address containing a bootloader version on my LPC4074 in LPCXpresso 8.2.2. Since gcc compiler doesn't support "@" sign and everything I read up to...
View ArticleVectorization of sin and cos
I was playing around with Compiler Explorer and ran into an anomaly (I think). If I want to make the compiler vectorize a sin calculation using libmvec, I would write:#include <cmath> #define NN...
View ArticleCreate new conda python 2.7 environment with gcc 4.9
I find it very difficult to understand how anaconda environments handle gcc. If I want to create a conda pyhton 2.7 environment it automatically installs gcc 7.3. That gcc version is causing me a lot...
View ArticleC++11 Initializing class static const array
Here's what I am trying. MinGW g++ 4.7.0.#include <iostream> #include <string> class Fruit { public: enum Value { APPLE, ORANGE, BANANA, NONE }; static const Value VALUES[4] = { APPLE,...
View ArticlePython.h still not found after installing python-dev and python3-dev [duplicate]
This question already has an answer here:fatal error: Python.h: No such file or directory 27 answersTitle. I used Cython to convert my python code to C so then I could compile it, but when compiling it...
View ArticleIs there a way to somehow group several symbols from different files together...
A bit of context first.I'm curently working on a modular (embedded) microOS with drivers, ports, partitions and other such objects represented as structures, with distinct "operations" structures...
View ArticleWhat does -fwrapv do?
Can anyone provide some code examples that act differently when compiled with fwrapv vs without.It says -fwrapv is supposed to "assume that signed arithmetic overflow of addition, subtraction, and...
View ArticleHow to find 64-bit divisions in existing C code?
Does anyone know a way of finding 64-bit divisions in an existing codebase? Possibly by introducing a compile error or warning for 64-bit division. (gcc or clang)?Background is I would like to replace...
View ArticleWhy there is so much difference between these methods of creating string
I was going through a site to benchmark the small functions and methods in c++ for the purpose of optimization and performance and I found some results on strings that I am not able to figure out why....
View Article