gcc « Development « C File Q&A

Home
C File Q&A
1.array
2.binary
3.delete
4.Development
5.directory
6.fgets
7.fopen
8.fprintf
9.fscanf
10.fwrite
11.header
12.include
13.input
14.LINE
15.linux
16.open
17.output
18.pointer
19.read
20.size
21.string
22.struct
23.Text
24.windows
25.write
C File Q&A » Development » gcc 

1. How do I execute a file in Cygwin?    stackoverflow.com

I created a C file in Eclipse on Windows and then used Cygwin to navigate to the directory. I called gcc on the C source file and a.exe was produced. How ...

2. gdb executable file format    stackoverflow.com

I'm trying to use GDB to debug (to find an annoying segfault). When I run:

gdb ./filename
from the command line, I get the following error:
This GDB was configured as "i686-pc-linux-
gnu"..."/path/exec": not ...

3. GCC on HP-UX, lots of poll(), pipe(), and file issues    stackoverflow.com

I'm having a lot of trouble building a 'middleman' logger - the intention is to place it on the path above an item in /usr/bin and capture everything going to and ...

4. Problem when using C object file (.o) in different computers    stackoverflow.com

I'm trying to create an object file which can be useable in any computer. So what I did was create bunch of functions and placed them in a .c file. Used ...

5. gcc not generating debug files    stackoverflow.com

I want to compile an application with debug information using gcc and gdb. When I do the following, the debug (.dSYM) files are generated correctly:

gcc -ggdb src/test.c -o build/test
If I, however, ...

6. calling fdopen: Bad file descriptor    stackoverflow.com

I'm getting the following error when trying to compile my program: calling fdopen: Bad file descriptor I've read this might be a problem related to including a precompiled header in one of ...

7. How can i print the compilation options on making several C files using GCC and make    stackoverflow.com

I want to print my whole file compilation options on make in my console on build. For example on compiling test1.c test2.c test3.c using make should print like

cc -g -O1 ...

8. link to a different libc file    stackoverflow.com

I want to supply the shared libs along with my program rather than using the target system's due to version differences: ldd says my program uses these shared libs: linux-gate.so.1 => (0xf7ef0000)(made ...

9. Embedding linker dependencies in an object file?    stackoverflow.com

Let's say I have a source file, say helper.c, which gets compiled into an object library (helper.a). Now, this uses functionality from many system libraries, so currently when I want ...

10. file format not recognized; treating as linker script    stackoverflow.com

I am trying to run the C files downloaded from here as follows :

gcc main.c docs_file.txt ksg_file.txt
However, I receive the following error:
/usr/bin/ld:docs_file.txt: file format not recognized; treating as linker ...

11. change visibility of symbols in shared library files    stackoverflow.com

I tried to compile sigintr.c in DD-WRT/src/router/rflow with arm-linux-gcc. The problem I encountered is:

sigintr.o: In function siginterrupt': sigintr.c:(.text+0x88): undefined reference to_sigintr' ...

12. linking a gas assembly file as a c program without using gcc    stackoverflow.com

Hey, as an exercise to learn more precisely how c programs work and what minimum level of content must exist for a program to be able to use libc, ive taken ...

13. Add GCC options to top of C source file    stackoverflow.com

Is is possible to put something at the top of the C source file, like

// GCC_OPTIONS=-g,-Wall
that will add those options automatically to gcc every time you compile this file?

14. How to refresh the file math.h    stackoverflow.com

Possible Duplicate:
Why Am I Getting Link Errors When Calling Function in Math.h?
Hello, I have a problem in C (gcc), when I compile a program ...

15. c FILE program error: double free or corruption    stackoverflow.com

This my program where it takes 10 integers and finds out if even or odd and stores them in respective files.I use gcc.

#include<stdio.h>
int main()
{
int a,i;
FILE *fp1,*fp2,*fp3;
fp1=fopen("data","w");
for(i=0;i<10;i++)
{
scanf("%d",&a);
putw(a,fp1);
}
fclose(fp1);
fp1=fopen("data","r");
fp2=fopen("even","w");
fp3=fopen("odd","w");
while((a=getw(fp1))!=EOF)
if(a%2==0)
putw(a,fp2);
else
putw(a,fp3);
fclose(fp1);
fclose(fp2);
fclose(fp1);
return 0;
}
I get this after entering ...

16. file format not recognized; treating as linker script    stackoverflow.com

i'm new on gcc compiler. My friend wrote this script (graphic filter) for me but i can't use it because i receive some error. I have 2 directory and a C file:

-dir- include ...

17. GCC outputs an executable ELF file when I want a shared library    stackoverflow.com

I'm trying to build a shared library in Cygwin using an i686-elf cross-compiler. The code is very simple:

int add(int a, int b) {
    return a + b;
}

void _init() ...

18. Creating one C file when compiling multiple sources    stackoverflow.com

I have a set of C files to compile using gcc and make. The build process works fine. I want to know if I can obtain - during compilation - one C ...

19. Single Source Code vs Multiple Files + Libraries    stackoverflow.com

How much effect does having multiple files or compiled libraries vs. throwing everything (>10,000 LOC) into one source have on the final binary? For example, instead of linking a Boost library ...

20. How to create a shared object file from static library    stackoverflow.com

How to create a shared object file from a static library? I am using Cygwin. Is the following syntax correct? gcc -shared -o libexample.so libexample.a

21. GCC: how to compile library into one C file?    stackoverflow.com

So we have for example ffmpeg that can be compiled into > than 4 libraries. Is it possible using GCC to compile\collect not into .a or .so libraries but into some ...

22. Adobe alchemy compiler problem- it generates .l.bc files, how to turn them into swc's?    stackoverflow.com

So I try to compile ffmpeg as I described here after this patch I started seeing .l.bc files but no .swc files. So how to use alchemy completion ...

23. Create a FILE in C    stackoverflow.com

I'm using MPLAB C32. I want to map my peripherals in streams, in order to do something like:

FILE* uart2 = fopen("UART2", 9600, param2, param3);
or just
FILE* uart2 = fopen("UART");
and then use ...

24. linking object files and linking static libraries containing these files    stackoverflow.com

Hello Stack Overflow Community, i am working on a c project to interleave multiple c programs into one binary, which can run the interleaved programs as treads or forks for benchmarking purposes. Therefore ...

25. Two variables with same name and type, in two different .c files, compile with gcc    stackoverflow.com

Here's the deal. I've had two identical global variables in two different .c files, they weren't declared as extern. So each .c file should have seen its own variable, right? But I ...

26. gcc: duplicate identifiers in object files or libraries    stackoverflow.com

Duplicate identifiers are simply ignored by the archiver and also by the linker. They are detected only if the source or object files are passed directly to gcc, which considers multiple ...

27. gcc compilation and Make file error    stackoverflow.com

I have a directory called "aos" in which i have the results of the make, namely .o file and .a file. My test case file in a directory called "test1" which is ...

28. Can CMake use g++ to compile C files?    stackoverflow.com

I have worked on a project where I was using g++ to compile C code in files that end in .c. The reason is that I'm told that g++ has better ...

29. How to run C code/file with MINGW?    stackoverflow.com

OK, I just began learning C language, and I read a lot of people suggest to use MinGW as a compiler. I downloaded, installed it and set it correctly (I think) ...

30. Unable to generate *.c.gcov file    stackoverflow.com

I have the following structure:

Source_code/build/unix/Makefile
Source_code/code/Lib/src/lib1/a.c
The -fprofile-arcs and -ftest-coverage options are mentioned in the gcc compilation option. It successfully generates the a.gcda and a.gcno files. And when given the following option gcov ...

31. generating a.out file format with gcc    stackoverflow.com

How do I generate a.out file format with gcc on x86 architectures ? With nasm I can do this easily with -f flag, for example:

[user@host]$ nasm -f aout start.asm 
[user@host]$ objdump -a ...

33. how to make gcc know #inlcude ?    bytes.com

Hi,everyone I'm using gcc to compile a program with a thirdpart framework. but i find some precompile in *.h file of framework like this #include So, when i compile my program,gcc will return some error to tell that cann't find the path DKFramework. then my question is how to let gcc know DKFramework equal to which dir, how can i ...

34. gcc compiler diagnostic files    cboard.cprogramming.com

Hello All! When I compile my c++ program using the Linux gcc compiler and the make file listed below, I get a whole bunch of additional diagnostics files saved on disk (presumably generated by the omp.h). Does anyone know how to suppress this (a flag?). Thanks a lot! Serguei *** I am sorry for posting this in a wrong forum *** ...

36. Single Large files do compile reliably. Gcc is Always Right    cboard.cprogramming.com

Just a follow up post on a strange and very difficult problem I finally cracked, yet in actual fact it was very simple. I'd written a 11000+ line program that was on a single file. It compiled and ran successfully on a Linux system and when I tried installing it on another Unix system while it compiled fine it would not ...

37. Couldn't compile this file with gcc, don't know why...    forums.devshed.com

I don't know why I couldn't compile this testcase. Here is the command line.. --snip-- gcc -o conftest -g -O2 -L/usr/local/mysql/lib -L/usr/local/mysql/lib -L/usr/local/ssl/lib -L/usr/local/ssl/lib -L/usr/local/lib -L/usr/local/lib -lmysqlclient -lz -lcrypt -lnsl_r -lm conftest.c -lmysqlclient -liconv -lssl -lcrypto -lcurl -lssl -lcrypto -lm -lcurl -lssl -lcrypto --snip-- but a far simpiler command line is --snip-- gcc -o conftest -g -O2 -L/usr/local/mysql/lib -lmysqlclient conftest.c -lmysqlclient ...

38. Calling gcc from file/system calls from file    daniweb.com

CC = /usr/bin/gcc GCCFLAGS = -c -Wall ROOTDIR = . SRCDIR = $(ROOTDIR)/src OBJDIR = $(ROOTDIR)/obj VPATH = src:obj:include OBJ = $(OBJDIR)/assess.o $(OBJDIR)/frequency.o $(OBJDIR)/blockFrequency.o \ $(OBJDIR)/cusum.o $(OBJDIR)/runs.o $(OBJDIR)/longestRunOfOnes.o \ $(OBJDIR)/serial.o $(OBJDIR)/rank.o $(OBJDIR)/discreteFourierTransform.o \ $(OBJDIR)/nonOverlappingTemplateMatchings.o \ $(OBJDIR)/overlappingTemplateMatchings.o $(OBJDIR)/universal.o \ $(OBJDIR)/approximateEntropy.o $(OBJDIR)/randomExcursions.o \ $(OBJDIR)/randomExcursionsVariant.o $(OBJDIR)/linearComplexity.o \ $(OBJDIR)/dfft.o $(OBJDIR)/cephes.o $(OBJDIR)/matrix.o \ $(OBJDIR)/utilities.o $(OBJDIR)/generators.o $(OBJDIR)/genutils.o assess: $(OBJ) $(CC) -o $@ $(OBJ) -lm $(OBJDIR)/assess.o: $(SRCDIR)/assess.c defs.h ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.