Suddenly getting "__builtin_ia32_sqrtsd_round" is undefined, with nvcc/gcc
I have a CUDA NSight project which was compiling fine, but suddenly isn't. I did have some system updates (Ubuntu 18.04) installed last week, which are likely the cause (or a part of it). Unfortunately...
View ArticleFix: /usr/bin/ld: cannot find -ly collect2: error: ld returned 1 exit status
I can't compile yacc i lex:$ cc gramatyka.c gramatyka.h semantyka.c -ly -ll output error: /usr/bin/ld: cannot find -ly collect2: error: ld returned 1 exit status How to fix it?
View ArticleHow can I compile a C++ library statically with Bazel to use in Rust?
I'm trying to integrate MediaPipe (https://github.com/google/mediapipe) which uses the google build system Bazel. I'm trying to figure out how to get a static library out of it. I've searched around...
View Articleswitch may fall through (no it may not)
On GCC 7 I have enabled most of all warnings on Qt creator 4.9. Now I have a switch statement which covers all enumeration values. If I add a default: I get a warning (from Qt creator):warning: default...
View ArticleNo acceptable C compiler found in $PATH after installing Cygwin
I want to install Kannel gateway on windowsXP. For that I downloaded and installed Cygwin. But when I went to configure the Kannel I got the following errors. (I set the PATH as...
View ArticleHow can I see the full file path in compiler errors?
I have a CMake project that I compile with gcc on Linux. Because of how CMake invokes gcc in subdirectories, gcc outputs only the base file name when it encounters an error:[100%] Building C object...
View ArticleHow to prevent "main.o:(.eh_frame+0x1c): relocation truncated to fit:...
When playing with creating baremetal executables, I hit this error:main.o:(.eh_frame+0x1c): relocation truncated to fit: R_AARCH64_PREL32 against `.text' collect2: error: ld returned 1 exit status I...
View ArticleHow to make GCC create checksum-same builds?
In company where I work there is complicated industrial ARM arch router project, consisting primarily of many C and C++ apps with Linux kernel. Currently we are preparing to certification and...
View ArticleIs the order of operations maintained when a function is inlined in C by a...
Consider the Following Code:#include <stdio.h> int f1() { printf("foo"); } int f2() { int a; } int main() { int a = f1(), b = f2(); printf("\n%d\n", a); printf("\n%d\n", b); return 0; } The...
View ArticleHow to include omp.h in OS X?
I'm new in C and have some problems compiling my code in OS X.I code Java a lot both in Eclipse and use terminal to compile my code. However now I'm learning openMP and have troubles with it.First I...
View ArticleAdvantage to use gfortran over gcc
Venturing out the bash profile in https://repl.it/, their installation includes bothgcc as well as gfortran:gcc --version gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 [...] gfortran --version GNU Fortran...
View Article"undefined reference" error when using c header files [duplicate]
I have three files: main.c, location.c and location.h. They can't seem to compile.Here are my source files. main.c:#include <stdio.h> #include "location.h" int main() { executeLook(); return 0; }...
View ArticleHow to install a really old version of MinGW
I need to install a really old version of MinGW. I need to install the 4.7.3 version of g++ and associated utilities and libraries. It looks like mingw-get libraries don't go back that far...
View ArticleUnable to locate the SFML libraries
Using cygwin I am trying to compile a program. Here is my makefile: SRCDIR := src OBJDIR := obj ICODIR := ico SRC := $(wildcard $(SRCDIR)/*.cpp) OBJ := $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o,...
View ArticleGCC compilation error when inheriting constructors
This code is compiled by gcc with an errortemplate<typename> struct B { }; template<typename... Types> struct A : public B<Types>... { using B<Types>::B...; using...
View ArticleHow to set version info for static libraries using gcc?
New to development with GCC/ Linux world. I have a project containing multiple static/ dynamic libraries that uses cmake. Is there a standard way to stamp version info for the libraries so we can know...
View ArticleStandard library ABI compatibility
Suppose we have a shared library which accepts or returns some kind of std class://lib.h #include <vector> std::vector<int> returnSomeInts(); //lib.cpp #include "lib.cpp"...
View ArticleRemoving CMOV Instructions using GCC-9.2.0 (x86)
I am looking to compile a set of benchmark suites using traditional GCC optimizations (as in using -O2/3) and comparing this with the same benchmark using no cmov instructions. I have seen several...
View ArticleInstalling SDL on OSX
I downloaded SDL2-2.0.3. I ran ./configure && make && make install.I've also tried brew install SDL2.This is my main.c//Using SDL and standard IO #include <SDL2/SDL.h> #include...
View ArticleZero-initialized, unnamed, temporary unsigned int
Am I right to interpret unsigned int{}; as zero-initialization of a temporary unsigned int without a name in the contexts provided below? The example does not work with clang or gcc, but compiles fine...
View Article