I am writing a gui wrapper for gcc for a jailbroken iphone, etc. and it is almost done. However, I get this output when it is run ld: can't open output file for writing : a.out, errno=1 collect2:ld return 1 exit status.
I believe this has to do with the privelages the app runs with. I have tried the setuid trick in the cydia developer fa...
            
           
          
            
            Hello,
I am getting this error whenever I try to run GCC outside of it's installation directory (E:\MinGW\bin). 
So, lets say I am in E:\code and have a file called one.c. Running:
gcc one.c -o one.exe will give me this error:
gcc: CreateProcess: No such file or directory
The only workaround is to navigate to it's installation direc...
            
           
          
            
            GCC complains if i do this: 
#define M(obj,met, ..., contents) obj##_##met(const void * self, __VA_ARGS__) { \
   contents \
   }
Giving me these 2 reasons:
error: missing ')' in macro parameter list
warning: __VA_ARGS__ can only appear in the expansion of a C99 variadic macro
Apparently, C99 - style variadic macros expect the clos...
            
           
          
            
            We had just migrated our software to CentOS 5 platform, from RedHat 9.
We're now compiling our C programs on CentOS 5 using gcc v4.1.2 and everything works fine on CentOS, but these new binaries will not run on RedHat 9 anymore (kernel 2.4.1). 
Any suggestions on how we can compile a binary that can run on both of these platforms?
...
            
           
          
            
            I'm having a real strange problem using GCC for ARM with the optimizations turned on. 
Compiling my C++ application without the optimizations produces an executable that 
at runtime outputs the expected results. As soon as I turn on the 
optimizations - that is -O1 - my application fails to produce the expected results.
I tried for a cou...
            
           
          
            
            Hmm... Title is a bit of a mouthful, but I'm really not sure which part of this is causing issues, I've run through it a ton of times, and can't pinpoint why...
The idea is for a single Choice instance to be able to store any one value of any
of the types passed in to it's template list... It's kind of like a union, except
it keeps trac...
            
           
          
            
            Under Linux, C++, and GCC, can I get a physical address for a given virtual address?  I know I won't be able to manipulate the physical address as a physical address.
...
            
           
          
            
            I am trying to run a program compiled from C code from an unknown source. I want to make sure that the program  does not harm my system in anyway. Like for instance, the program might have soemthing like system("rm -rf /") in the source, which is un-detectable, unless the code is thoroughly examined.
I thought of the following 2 ways
...
            
           
          
            
            I have written some code in C++ with a corresponding C interface (i.e C-function wrappers around the classes) that a friend wants to use in an iPhone application.
Since I heard you can compile C++ for the plattform, but not use the iPhone sdk at the same time (sic) I thought that compiling all the code into a static library that my frie...
            
           
          
            
            I'm trying to forward declare a class with the _may_alias attribute, but GCC gives an error when I attempt to do so:
struct __attribute__((__may_alias__)) MyType;
MyType* foo();
typedef struct  __attribute__((__may_alias__)) MyType { ... } MyType;
MyType* foo() {}
Gives the error:
    testc.c:4: error: redefinition of typedef ‘A’
   ...
            
           
          
            
            I have four arrays of data (3072 bytes each.) I want to point to one of these arrays, so if a function were passed a pointer to these arrays, it could manipulate them, and the pointers could be s
So initially I thought of pointers-to-pointers:
uint16_t *buffer0_level[BUFF_WORDS] FAR;
uint16_t *buffer0_mask[BUFF_WORDS] FAR;
uint16_t *bu...
            
           
          
            
            When using va_start(), va_arg() and va_end() to read parameters passed to a method, is there a way to count how many arguments there are?
According to the man page if you call va_arg() too many times you get "random errors":
  If there is no next argument, or if
  type is not compatible with the type
  of the actual next argument (as
...
            
           
          
            
            In GCC, I'm able to do this:
(CachedPath){ino}
inode->data = (struct Data)DATA_INIT;
where:
struct CachedPath
{
    Ino ino;
};
typedef int8_t Depth;
struct Data
{
    Offset size;
    Blkno root;
    Depth depth;
};
#define DATA_INIT {0, -1, 0}
MSVC gives the following error for these kind of casts:
error C2143: syntax error : m...
            
           
          
            
            I have an application which links to a number of libraries, most of them are available as both static as well as dynamic library on my machine. Below is the output of the ldd command.
linux-gate.so.1 =>  (0xffffe000)
libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0xb782c000)
libc.so.6 => /lib/libc.so.6 (0xb76cc000)
libcrypto.so.0.9.8 => /...
            
           
          
            
            Hi,
   I am loading a DLL from an application and I want the DLL to be able to use a function implemented in the application. The definition of the function is put in a header and is included in the DLL. Can anyone tell me what I am doing wrong here or whether this can't be done? Thanks for any help.
App:
include <API.h>
extern "C" in...
            
           
          
            
            The following little program is very awkward using GCC version 4.2.1 (Apple Inc. build 5664) on a Mac.
#include <stdio.h>
int main(){
        int x = 1 << 32;
        int y = 32;
        int z = 1 << y;
        printf("x:%d, z: %d\n", x, z);
}
The result is x:0, z: 1.
Any idea why the values of x and z are different?
Thanks a lot.
...
            
           
          
            
            Context: I am not certain whether this is my problem or the problem of the server this is running on. I am trying to compile and run a small utility, to become a cron job, that uses the mysql libraries. The program compiles successfully with the following command, no errors or warnings:
gcc my_program.c -o my_program -I /usr/include/mys...
            
           
          
            
            Is it possible to run a compiled program on a shared hosting account?I dont think I have permission to run gcc, but I can compile it elsewhere and download it - would that work?
...
            
           
          
            
            How do I forward declare FILE * in C? I normally do this using struct MyType;, but naturally this doesn't appear to be possible.
If behaviour differs between C standards or compilers and with C++, this is also of interest.
Update0
Why I want to do this aside: What I'm asking is how to forward declare a non-struct/"typedef'd struct" ty...
            
           
          
            
            How can I enable for loop initialization when compiling in c89 or gnu89 mode using GCC and Clang?
...