Compilation error on linux server (C project)
I need some help.I worked on a C project locally and it ran perfect with no issues at all.Then I moved my whole project files to a linux server (using Bitwise) and ran it using the following...
View ArticleDefault makefile in CLION
I created a C file and added custom makefile to it in CLION.Now I have deleted that custom makefile and I'm trying to run my program but I can't.How to go back to the default makefile?
View ArticleCMake: OGREConfig.cmake
I have this weird issue that very few people seem to be having with Ogre3D, where CMake is unable to find (er, "accept") OGREConfig.cmake. Here's my console output:CMake Error at CMakeLists.txt:10...
View ArticleUndefined references with static variables in qMin and GCC in WSL
This code:test.h#ifndef H__#define H__struct test{ static const int some_variable = 10;};#endifmain.cpp#include <QtGlobal>#include "test.h"int main (void){ qMin(test::some_variable, 11);}Compile...
View ArticleUsing a different gcc version from that included with Rtools with Rcpp on...
Before I embark on updating gcc, has anyone actually attempted this, and can they confirm building R from source is required to update the gcc version one uses to compile c++ code with Rcpp (i.e. not...
View ArticleLink-time optimization and inline
In my experience, there's lot of code that explicitly uses inline functions, which comes at a tradeoff:The code becomes less succinct and somewhat less maintainable.Sometimes, inlining can greatly...
View Articleinvalid instruction suffix for mov?
I have this piece of inline assembly code that should print A in text mode: void print(){ asm volatile("mov ax,0xb800\n""mov ds,ax\n" /*<-as complains about this*/"movb 0,'A'\n" ); } However when I...
View Articlemakefile error "No rule to make target" how to solve it?
what's wrong with my makefile?CC = gccOBJS = main.o map.o extended_map.o election.o utilities.oEXEC = electionDEBUG_FLAG = -DNDEBUGCOMP_FLAG = -std=c99 -Wall -pedantic-errors -Werror$(EXEC) : $(OBJS)...
View Articleconverting .c file to .o using processes
I have to make a project which asks me to create a program that will compile a C project by recursively descending into directories and launching processes which compile a file of code by calling GCC...
View ArticleGCC, CMake, precompiled headers and maintaining dependencies
I'm trying to figure out how to maintain dependencies of my precompiled headers. It includes STL headers, some third-parties like boost and some of our rarely changing infrastructure headers. I came...
View ArticleHow to create a "C single-line comment" macro
I am trying to create a "single line comment" macro in C, this is used conditionally to comment out lines of codes, according to some global macro definitions. It is the same idea expressed in this...
View ArticleCannot call real mode C function from bootloader (NASM + GCC toolchain)
I am attempting to write my own OS kernel, and have been having some issues getting the linking to work properly between my bootloader and (what will soon be) my kernel (written in C).I have the...
View ArticleGetting ***stack smashing detected*** while counting array length
I am using VS code on Ubuntu 20.04. I am learning C programming. The program is to count length of array using function. while running the program I can give input to the array but not getting the...
View ArticleWhat is __XSI_VISIBLE?
I was working on a C/C++ project for an embedded system that uses gcc-arm-none-eabi-8-2019-q3-update as a compiler.I added the use of the strptime function of time.h but initially it was undefined and...
View ArticleCall C function without declaring it beforehand
Short version: I would like to declare a function in the same statement that calls it. The syntax I'm looking for is something of this sort:// foo is undeclared in this file, and implemented in another...
View ArticleSet the OpenMP project MacOS Mojave in CLion
I'm trying to execute my homework in C++ with OpenMP on Mac with macOS Mojave. But it's failed. The Mac is new, so all setups are not changed. What I did:I installed Homebrew.I installed llvm (brew...
View ArticleHow do I get GCC to put a char in ah/bh/ch/dh?
Suppose I have some inline assembly that needs a particular char value in ah, bh, ch, or dh. How can I tell GCC to put it there? I don't see a relevant constraint to do that, but the GCC manual says...
View ArticleUsing GCC to produce readable assembly?
I was wondering how to use GCC on my C source file to dump a mnemonic version of the machine code so I could see what my code was being compiled into. You can do this with Java but I haven't been able...
View ArticleStack/GHC Permission Error: "configure: error: C compiler cannot create...
I am trying to use stack to build a simple project (created withstack new simple) but when I run stack build I get the following error:configure: error: in...
View ArticleUndefined reference to vtable
When building my C++ program, I'm getting the error message undefined reference to 'vtable...What is the cause of this problem? How do I fix it?It so happens that I'm getting the error for the...
View Article