I was linking with -mwindows instead of -mconsole, so I was not building a console application and did not have stdout/stderr
My apologies for the noise.
-Xavier
On Sunday, April 21, 2013 8:47:53 PM UTC+2, Xavier Vergés wrote:
Hello
I'm new to cocotron and to objective-c, so please be patient if I'm missing something obvious.
My printf statement is not working on Windows, and I haven't got a clue. Writing to a file does work.
#import <Foundation/Foundation.h>
#import <stdio.h>
int main(int argc, const char * argv[])
{
#ifndef __APPLE__
NSInitializeProcess(argc,argv);
#endif
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
printf("Helloooo!\n");
FILE *ptr_file;
ptr_file =fopen("output.txt", "w");
fprintf(ptr_file,"Hi!\n");
fclose(ptr_file);
[pool release];
return 0;
}
Tried it on Windows 7 - 64 bit and in Windows Vista - 32 bits.
Thanks for any hint.
-Xavier