Quantcast
Browsing all 22061 articles
Browse latest View live

Detecting 64bit compile in C

is there a C macro or some kind of way that i can check if my c program was compiled as 64bit or 32bit at compile time in C?Compiler: GCCOperating systems that i need to do the checks on:...

View Article


Does GMP work with gfortran? Is there an arbitrary precision arithmetic...

I'm working on some Fortran things, probably Fortran90 or Fortran95, and was wondering if GMP works with gfortran compiler. If so, how would one use the arbitrary precision arithmetic in gfortran?...

View Article


Why can GCC only do loop interchange optimization when the int size is a...

When I compile this snippet (with -Ofast -fnest-loop-optimize) gcc generates assembly which traverses the array in source order.However if I uncomment the line // n = 32767 and assign any number to n,...

View Article

Why is the executable developed by clang++ slower than g++ developed one?

For the same code on the same machine, built by g++ and clang++ respectively, why the later one takes much more time than the former one?➜ project>cat branch_prediction_victim.cpp#include...

View Article

How to specify a gcc path in pip command?

I am trying to install cupy 5.0.0. cupy5.0.0 needs gcc version not more than 7. My deafault gcc is gcc-9. I cannot use conda environment. Also i dont have sudo permission to change /usr/bin/gcc to...

View Article


makefile: No rule to make target '%.o'

I have 3 files: Source.cpp 2ndfile.cpp 2ndfile.hppAnd I'm trying to compile them with mingw32-makemakefile that doesn't work:all: launch.exelaunch.exe: %.o g++ -o $@ $^%.o: %.cpp g++ -c $<...

View Article

How to port code using sys/ioctl.h to MinGW gcc?

My codes (https://github.com/fangq/mmc, https://github.com/fangq/mcxcl) have been compiled out-of-box using gcc on Linux & Mac, cygwin-gcc or msys2-gcc on Windows, but not with MinGW compilers...

View Article

Does Clang use GNU or GCC? [closed]

I am writing a C/C++ program that I need to compile, however I cannot use GNU or anything related to it. I heard the best compiler is Clang, but I also heard that even Clang uses GCC packages. I use...

View Article


aarch64-linux-gnu-ld: no input files

In general, I restarted the collection and while it shows here such a logroot@W-PC:/home/w-pc/kernel_dev/android_kernel_huawei_hi6210sft# make -j5CHK include/generated/uapi/linux/version.hCC...

View Article


Exclude files from makefile

I have a rule in my makefile that uses a wildcard to get all .c files in the directory:SRCS_ENC = $(foreach DIR,$(SRC_ENC),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c)))Now I want to exclude all files...

View Article

`file`, why executables not reported as executables?

In GNU/Linux Debian 9.9 (stretch) my program is reported as:build/debug/program_g: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for...

View Article

How to vectorize with gcc?

The v4 series of the gcc compiler can automatically vectorize loops using the SIMD processor on some modern CPUs, such as the AMD Athlon or Intel Pentium/Core chips. How is this done?

View Article

What causes gcc invalid option for mtune?

I use ODB Library in my programm. By compiling I get the following message:[ 1%] Generating ../odb_gen/XXX_odb.cppcc1plus: error: bad value (‘/dev/null’) for ‘-mtune=’ switchcc1plus: error: bad value...

View Article


Output Compiler Version in a C++ Program

I am writing a program which needs the information of compiler version as the code is compiled.To simplify the problem, my code is something like#include <cstdlib>#include <iostream>using...

View Article

unsupported GNU version! gcc versions later than 7 are not supported [duplicate]

I am trying to install cupy 5.0.0 using pip. It has dependency on gcc-7. In my system default gcc is set to version 8. I also have cuda-10.0 installed.I am setting environment variable to use gcc-7...

View Article


Why does the compiler interpret assignment as definition

A sample c program is given below:#include <stdio.h>int i = 10;i = 25;int main(void){ printf("%d\n", i); return 0;}When it is compiled using gcc, it throws redefinition error.warning: data...

View Article

Inputting a space seperated 2-D array

I was recently working on 2-D arrays in C. My code looks something like this -#include<stdio.h>void main(){ int A[3][3]; int i,j; for(i=0;i<3;i++) { for(j=0;j<3;j++)...

View Article


How to set nvcc host compiler through environment variable

I am trying to install cupy 5.0.0 using pip3. It has dependency on gcc-7. In my system default gcc is set to version 8. I also have cuda-10.0 installed(which needs gcc-7)I am setting environment...

View Article

Bootloader Strategy for Corrupt Applications

I've implemented a bootloader for a Kinetis ARM Cortex-M4 microcontroller.The main application (starting at 0x10000) is re-programmed via the bootloader over a custom RS232 interface. I've implemented...

View Article

DllMain() not called when injecting but called with LoadLibrary()

Dll Code:#include <windows.h>BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved){ MessageBoxW(NULL, L"Hello world!", L"Test DLL", MB_OK); return TRUE;}LoadLibrary...

View Article
Browsing all 22061 articles
Browse latest View live