Can cmake compile directly from source files in binary?

cmake compiles first the .c files to .o files, and then links them together: gcc a.c -o a.c.o gcc b.c -o b.c.o gcc c.c -o c.c.o gcc a.c.o b.c.o c.c.o -o a.out That instead of compiling directly from source files to binary: gcc a.c b.c c.c -o a.out No

make an intersection of vectors in C ++

I have a vector of vector of unsigned. I need to find the intersection of all these vector of unsigned's for doing so I wrote the following code: int func() { vector<vector<unsigned> > t; vector<unsigned> intersectedValues; bool firstInt

Cygwin gcc problem - impossible to find Python.h

So I downloaded Cygwin to build Matplotlib on Windows. Upon running python build I get a message saying Python.h cannot be found (pastebin). Looking in /usr/include/python2.7, I can clearly see Python.h exists. When I do: gcc -print-search-d

Static Libraries in Mac OS X

I have a makefile in Mac OS X and the last command line for the final compilation is: gcc count_words.o lexer.o -lfl -o count_words but it responds: ld: library not found for -lfl collect2: ld returned 1 exit status I found that the library libfl.a i

How do I know if I use the GOLD linker?

Someone else in my group built LD for my team to use. How can I tell if it was built with --enable-gold?Check the symlink /usr/bin/ld via ls -al, if it links to or ld.bfd. The rest should be obvious. Note: Nameing might be slightly different,

operation of the extern keyword

I have defined a variable in one file and declared it in another file using the extern keyword. but i have declared it with different datatype.. file1.c char i; main() { foo(); } file2.c void foo() { extern int i; i = 130; printf("%d", i); } In

Compile an object file from an intermediate gcc file

By using the -fdump-tree-* flag , one can dump some intermediate format file during compilation of a source code file. My question is if one can use that intermediate file as an input to gcc to get the final object file. I'm asking this because I wan

gcc 4.3.4 bug with the size of the structure?

What's wrong with this code when I compile it with -DPORTABLE? #include <stdio.h> #include <stdlib.h> typedef struct { unsigned char data[11]; #ifdef PORTABLE unsigned long intv; #else unsigned char intv[4]; #endif } struct1; int main() { stru

How will gcc react -O2 and -O0 in the same command?

Anyone has any ideas which will take preference if -O2 and -O0 is specified in the command line for gcc? I have some legacy code that gets configuration from multiple places.... λ > g++ outer.cxx -O2 -Os -o outer λ > sha1sum outer c3f62ab60393266388

Move a single float to an xmm register

I want to multiply the data stored in one xmm register with a single float value and save the result in a xmm register. I made a little graphic to explain it a bit better. As you see I got a xmm0 register with my data in it. For example it contains:

How could i get gotoxy () in gcc

I am using gcc in, I compile and execute in terminal. But In a online programming contest, they require the output as shown in diagram. For that, if I use TURBOC I can get it using conio.h using gotoxy() to get spiral format of output. But

Using another assembler (MASM, NASM, TASM, etc.) with GCC

I've been looking through questions on here and the internet for a while now and I cannot seem to find out whether or not it is possible to do inline assembly with GCC using something other than GAS. I am trying to find if I can avoid using not only

Sending a structure with a char pointer inside?

im trying to send a packet from my C program to my Delphi program, the data is variable in size, and if i used char Data[1024]; it will send 1024 bytes even if the data is 3 bytes, and if the data is larger than 1024 it wont send all of it :( struct

What is the difference between gcc optimization levels?

What is the difference between different optimization levels in GCC? Assuming I don't care to have any debug hooks, why wouldn't I just use the highest level of optimization available to me? does a higher level of optimization necessarily (i.e. prova

Objective C for Windows

What would be the best way to write Objective-C on the Windows platform? Cygwin and gcc? Is there a way I can somehow integrate this into Visual Studio? Along those lines - are there any suggestions as to how to link in and use the Windows SDK for so