Questions tagged [cflags]

CFLAGS are switches that can be passed to the C compiler while compiling software.

CFLAGS are switches that can be passed to the C compiler while compiling software. CFLAGS are normally used inside Makefiles to have the same set of flags for the compilation.

CFLAGS can also be provided from outside of the Makefile via environment variables.

75 questions
3
votes
1 answer

CMake SET command not working as expected (CMake not setting value of predefined cached variable)

I'm using CMake in my builds. I'm trying to set compiler flags like this: set(CMAKE_C_FLAGS_DEBUG "-option1 -option2 -option3") however, my build fails because one of the compiler flags is not set. When I check the value of the variable in…
El Marce
  • 3,144
  • 1
  • 26
  • 40
2
votes
0 answers

HxCPP Add Include Paths and Linker Options

I'm trying to use an external C++ library in Haxe. I have an extern class with an @:include meta, but I can't figure out how to add the directory containing some headers to the HxCPP include path, or add linker options to add to the lbrary path and…
programmer
  • 743
  • 4
  • 10
2
votes
0 answers

cFlags arguments doesn't' work properly

I'm trying to add NDK to my project using externalNativeBuild and I want to set cFlags but It seems that the Flags doesn't work or the NDK doesn't add to project this way. here is my code to add NDK in build.gradle : externalNativeBuild { ndkBuild…
Shakib Karami
  • 678
  • 1
  • 4
  • 11
2
votes
1 answer

CFLAGS CPPFLAGS and LDFLAGS invoke cc but don't pass the values to gcc

I wrote a simple printf C code and made a simple makefile. When I run make with CFLAGS, CPPFLAGS and LDFLAGS, the values of the variables goes into a cc execution, followed by a gcc execution without those values, like this: $ CFLAGS="-I."…
2
votes
1 answer

pthread_cleanup_push and O2 CFLAGS

I have some warning when compiling a piece of code using pthread_cleanup_push/pop with -O2 CFLAGS. Just by removing the O2 cflags in the Makefile make it compile without issue. Is it forbidden to use gcc optimization with these pthread macros ? I…
ArthurLambert
  • 749
  • 1
  • 7
  • 30
2
votes
1 answer

Error in mkoctfile

I am trying compile he following in octave4.0 in Linux 14.04 : mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims read_data.cpp mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims write_data.cpp The following error crops up : ****mkoctfile: unrecognized…
user324
  • 331
  • 1
  • 5
  • 15
2
votes
1 answer

Determining the target architecture in an Autoconf M4 script

I'm currently working with a system that requires building both i686 and x86_64 libraries, building and installing them on the same system - it is a legacy project that has a mix of newer ABI-agnostic code that is generally run in 64 bit because it…
matthock
  • 629
  • 1
  • 4
  • 15
2
votes
1 answer

Adding third party libraries to contiki os

I want to add a third party library to the Contiki OS. Exactly, I was trying to add the nettle 3.0 cryptography library. Am I suppose to build the concerned library using special flags for contiki platform , not sure what exactly ? gcc msp430 If…
yushaa yave
  • 145
  • 1
  • 9
1
vote
1 answer

Cython compiler - fatal error C1083: Cannot open include file

I followed the following steps to replicate the Classical Music Composition Using State Space Models code. The inference algorithms for this code are in Cython. To run the notebook, first run: np.get_include(), which will output a sample-path. Then,…
Sara
  • 11
  • 2
1
vote
1 answer

Compile GN-based projects with modified compiler flags

The build system that V8 uses is not straightforward. Assume I desired to add -save-temps to the build flags to keep all intermediate files produced during compilation. Where would I specify this information? Do you specify it in a particular…
Melab
  • 2,594
  • 7
  • 30
  • 51
1
vote
0 answers

Building Opencv using c++ error: undefined reference to `cv::Mat::deallocate()'

I have configured my OpenCV successfully from OpenCV official code version 4.2.0 with the command as below: pkg-config --cflags --libs opencv The output after the configuration is as: -I/home/blaster/installed/include/opencv4/opencv…
1
vote
1 answer

How can I compile certain files and add flags in a Makefile only when a specific target is selected?

I am currently facing a problem when writing a Makefile for a C project. In particular, my project should have at least two Makefile targets (target_light and target_full), being target_light the default one. target_light should compile all my…
es483
  • 361
  • 2
  • 16
1
vote
1 answer

In Makefile, is the variable $(CFLAG) always appended?

consider the following simple makefile CC=gcc CFLAGS=-I. all: hellomake hellomake.o: hellomake.c hellomake.h $(CC) -c hellomake.c -o hellomake.o $(CFLAGS) hellofunc.o: hellofunc.c hellomake.h $(CC) -c hellofunc.c -o hellofunc.o…
learning_dude
  • 1,030
  • 1
  • 5
  • 10
1
vote
1 answer

Which rules should use CFLAGS in GNU make

In my makefile for a C project, I have set the CFLAGS variable as follows - CFLAGS=-ansi -pedantic -Wall -Wextra -O2 -isystem $(SQLITEDIR) I expected this variable to be used in the rule for building object files since the flags affect the…
user2309803
  • 541
  • 5
  • 15
1
vote
1 answer

how to printf pre-defined cflags

I have a simple cpp file as following on Unix environment: #include #ifndef HELLO #define HELLO "hello" #endif int main() { printf("HELLO = %s \n", HELLO); return 0; } If this was compiled and ran, it prints out HELLO =…
Byung Kim
  • 21
  • 5