How do I compile C?
Posted: December 1st, 2015, 4:31 am
How do I compile C code? What programs can I use? I would really like to use dr soon and gfind
There should be no need to compile dr under Cygwin. Since you are using Windows, I think you should get MinGW and compile dr using the GCC compiler.Saka wrote:I have Cygwin and Micro C compiler (mcc) but I cannot compile dr
I know Cygwin is overkill for source compilations like these but much of the Windows ConwayLife users would have Cygwin installed anyway because of compiling apgnano. Personally I do not like it too much as it can be kinda bloated and they say it's slower... but I guess windows users would have to stick with that.Sokwe wrote:There should be no need to compile dr under Cygwin. Since you are using Windows, I think you should get MinGW and compile dr using the GCC compiler.
Thanks! Didn't see that post...Sokwe wrote:There should be no need to compile dr under Cygwin. Since you are using Windows, I think you should get MinGW and compile dr using the GCC compiler.Saka wrote:I have Cygwin and Micro C compiler (mcc) but I cannot compile dr
I included a Windows executable for dr2 in this post (and forgot to include the source code, which is here). Does this executable not work for you?
Keep calm and read on: viewtopic.php?f=9&t=1445#p16606Saka wrote:I tried the example on the thread and it does nothing, I'm confused
I did read that, but I am not sure what it meant, so, in dr, do I inputScorbie wrote:Keep calm and read on: viewtopic.php?f=9&t=1445#p16606Saka wrote:I tried the example on the thread and it does nothing, I'm confused
Both:Saka wrote:I did read that, but I am not sure what it meant, so, in dr, do I inputScorbie wrote:Keep calm and read on: viewtopic.php?f=9&t=1445#p16606Saka wrote:I tried the example on the thread and it does nothing, I'm confused
dr2 > output.txt
And then
dr2 < input.txt
(Or vice versa)?
Code: Select all
dr2 < input.txt > output.txtUmm... Sort of. I guess you tested that. If not, a short test would have let you know.Saka wrote:@dvgrn Does input.txt and output.txt have to be in the same folder as dr2?
Code: Select all
drifter_directory
ㄴdr
ㄴinput.txt
ㄴoutput.txt
You may want to run:
dr < input.txt > output.txt
(You're on windows, right?)
Code: Select all
drifter_directory
ㄴdr
ㄴfiles
ㄴinput.txt
ㄴoutput.txt
You may want to run:
dr < files/input.txt > files/output.txt (The cmd line is in the drifter_directory.)
or maybe:
../dr < input.txt > output.txt (The cmd prompt is in the files directory.)
Code: Select all
some_directory
ㄴdrifter_directory
ㄴdr
ㄴinput.txt
ㄴsome_other_directory
ㄴoutput.txt
You may want to run:
dr < ../input.txt > ../some_other_directory/output.txt
(.. means the parent directory. I haven't tested this on Windows but I think it would work.)
Code: Select all
drifter_directory
ㄴdr
...Completely Unrelated...
C:
ㄴUsers
ㄴSaka
ㄴsome_folder
ㄴinput.txt
You can run:
dr < C:\Users\Saka\some_folder\input.txt (cmd prompt is in the drifter_directory)
LOL guess what my username isSaka wrote:OMG YOU GUESSED MY PC USERNAME!!(Not sure which emoticon to put)
Yep, Take your timeSaka wrote:I have not tried that out, because it's already late night
Scorbie? Scorbic? Not sure. Also, in response to my post in the "New p17 and other billiard tables" thread, you posted the way to compile dr with cygwin, I did not understand what you meant by "your_binary_name"Scorbie wrote:LOL guess what my username isSaka wrote:OMG YOU GUESSED MY PC USERNAME!!(Not sure which emoticon to put)![]()
Code: Select all
gcc -O3 dr.c -o drifterCode: Select all
Bad bit in 'd' or 'D' commandOk, I'll try to retrace:Scorbie wrote:eek... I don't know what's wrong with that and I think the dr2 thread would be a better place for that (maybe there isn't a dr2 thread?)
Code: Select all
c50
h15
w15
rot90symm
v127 1
d2 36 36 44 44
r36 36
444344o.4
....o.o.4
oooo.oo.4
4.o...o.3
4o.....o4
3.o...o.4
4.oo.oooo
4.o.o....
4.o443444!
d0 37 36 37 39
d0 38 36 38 38
d0 p39 37
skipstable
skipfizzle
Code: Select all
dr2 < input.txt > output.txt