How to hold multiple type data in pointer
I am trying to parse a buffer that consists of many types of data.For an example buffer:void* buffer = "1111aaaa[another similar buffer][a second similar buffer]1111" // Buffer is not actually a...
View ArticleIs it possible to compile C++ that's using a .NET DLL with GCC?
I want to use the AML.Engine.dll (https://github.com/AutomationML/AMLEngine2.1) in a C++ project. I have gotten it to work with the Microsoft C++ Compiler, but also need it to work with GCC but...
View ArticleIs there any way generalise program specific seting in vs code? [duplicate]
This question already has an answer here:Why do you have to link the math library in C? 11 answersI was working with pow() function in c using vscode. And I want to use a variable in exponent parameter...
View ArticleC++ Perfomance Per Compiler, 200 times slower than C#
I was dealing with some performance issues which I discussed in this question: Super Slow C++ For LoopI have a simple program I wrote to parse binary data. I tested it locally on 2 computers.1. Dual 6...
View ArticleError: implicit declaration of function `int open(...)'
I am using open function in one of my C++ project on Solaris OS.#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> char in_pathname[PATH_MAX]; int in_fd = -1; in_fd =...
View ArticleExec format error 32 bit executable Windows Subsystem for Linux?
When I try to execute a 32bit file compiled with gcc -m32 main.c -o main on Windows Subsystem for Linux, I get the following error: bash: ./main: cannot execute binary file: Exec format error.If I...
View ArticleHow to use multiple source files to create a single object file with gcc
I'm using the -c option with g++ to create a bunch of object files, and it's only letting me specify one source file for each object file. I want to have multiple files go into some of them. Is there...
View ArticleDo I even need `-pedantic` if I specify the standard to ANSI C with `-std=c89`?
If I specify the standard to ANSI C with -std=c89, my code won't run until I perform certain changes to make it compliant with the standard. So do I even need -pedantic at this point if I've already...
View ArticleBuilding GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+
I downloaded GCC 4.5 from http://www.netgull.com/gcc/releases/gcc-4.5.0/ but when I try to setup / build I am getting below error:Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1040>...
View ArticleHow does #include work in C++? [duplicate]
This question already has an answer here:Why should I not #include <bits/stdc++.h>? 3 answersI have read from a codeforces blog that if we add #include <bits/stdc++.h> in a C++ program then...
View ArticleWhat is the effect of a `section` command with an empty list of input...
In an LD linker script I have the following fragment in the SECTIONS section:. = (__BUFFER_LOCATION_); BUFFER . : { } > EXTERNAL_MEM where __BUFFER_LOCATION_ is defined to some address and...
View ArticlegFortran and OpenACC support
According to the gFortran docs in order to enable OpenACC support it is necessary to use the -fopenacc switch. However, this does not seem to work.gfortran: error: unrecognized command line option...
View ArticleC/C++ function dynamic loader (helper)
I tried to implement a helper class to easily load .dll or .so files and get function pointer. The following code compile and work well with on ubuntu 16 and VS'2015, but I'm facing issue to have it...
View ArticleGcc collect2: fatal error: cannot find 'ld'
I'm going through the tutorial on making an OS on http://wiki.osdev.org/Bare_Bones. When I try to link boot.o and kernel.o using this command: i686-elf-gcc -T linker.ld -o myos.bin -ffreestanding -O2...
View Articlepipeline command ./a.out | cat, printf("line\n") in a.out is not excuted and...
A very strange thing, a.out just printf() a line then go into a dead loop, when a.out is executed single, I can see the line in termial, but if pipeline a.out with cat, then we can't see...
View ArticleCan't compile a C program on a Mac after upgrading to Catalina 10.15
There's a previous question Can't compile C program on a Mac after upgrade to Mojave, and the answers to that have covered most of the variations on what goes wrong.Now — as of Monday 2019-10-07 — you...
View ArticleHow to fix "gcc isn't recognized as internal command" on Clion for Window?
I followed the Clion installation guide and I installed MinGW.So now I coded a C program and I try to type in the terminal gcc test.cbut I get gcc isn't a recognized internal commandHere is my program...
View ArticleWhy does Visual C++ 2019 allow left operand (lvalue) casting of the...
This question already has an answer here:Why does an lvalue cast work? 2 answersWorking on a project that must run in Visual C++ and GCCBefore understanding that lvalue casting of the assignment...
View Articleproblem with glib-2.0 when cross compiling for arm32bit on 64bit ubuntu
when I try to cross compile my GStreamer pipeline to run it on Petalinux build, it loads the 64bit libraries while the host is a 32bit arm.arm-linux-gnueabihf-gcc PIPEX.c -o PIPEX `pkg-config --cflags...
View ArticleProblem installing R package "ld: warning: directory not found for option "
I'm trying to install the package gradientForest in R by using install.packages("gradientForest", repos="http://R-Forge.R-project.org") And I'm getting this error ld: warning: directory not found for...
View Article