|
Post by D-Type on Jan 23, 2021 7:30:33 GMT -5
Quite a few of the repositories on github are C source only, you have to compile them yourself.
Last time I used Turbo C was in the early 90s. (Which was really nice to use.)
What's a good way now of getting a compiler onto my Windows 10 64-bit PC that can compile this stuff?
A few of the repos come with Visual Studio project files, is it a necessity to use VS for those?
I don't really want an 800MB compiler on my machine to compile a 50k assembler, is there something small I can use?
|
|
|
Post by Malban on Jan 23, 2021 9:40:02 GMT -5
Well you COULD download Vide... and delete everything but the "C" directory... and there keep only the binaries (for you OS) and the include files.
That should leave you with a working gcc setup and will be a size (depending on your OS, for OSX is): 10Mb
Of course you would have to create your own makefiles, since Vide isn't there anymore to compile. But the toolchain in itself is complete.
Malban
|
|
|
Post by Peer on Jan 23, 2021 10:03:40 GMT -5
D-Type , are you asking for a Vectrex-C-compiler, or is this a general "I want to compile some C for Windows" question?
If you are looking for a Vectrex-C-compiler, then just do what Malban suggested. I can give you an additional "make-script" for use with the Windows command console (it is not a true makefile, but a Windows batch script) which will then do all the compile-work for you.
Cheers, Peer
|
|
|
Post by D-Type on Jan 23, 2021 10:23:48 GMT -5
Sorry, I guess I wasn't totally clear.
"I want to compile some C for Windows"
I do of course already have VIDE :-)
I'm looking to recompile some Windows utilities, for working on Vectrex related projects of course!
|
|
|
Post by D-Type on Jan 23, 2021 15:52:46 GMT -5
I decided to be brave and used Chocolatey GUI to install MinGW-64...which broke my git, probably because it also appears to be an instance of MinGW-64.
Maybe git comes with gcc? Either way, I need take a few steps back. I knew this would be problematic :-(
|
|
|
Post by Malban on Jan 24, 2021 6:05:39 GMT -5
Well since you use windows - you could just use Microsoft Visual Studio free edition. Of course that is not really "gcc like".
Rather then get a GCC version running under windows (which I did a couple of times - but is always a pain in the ...).
If you just need some tools to do something... I by now have an emulator running which provides me with different OS.
I have an emulator setup for Windows, for Linux even for Mac. If you just want to do some "C" in a safe environment... you could emulate an Ubuntu or Debian system. Than you have all you need to do "C" and also an always "clean" environment.
|
|
|
Post by D-Type on Jan 24, 2021 17:18:16 GMT -5
Thanks for the extra thoughts. I've searched a bit to try and understand how to integrate GCC into MinGW-64 and I'm getting nowhere. I'm shocked at how undiscoverable it all is, this is what keeps Microsoft in business, whilst I don't want to download Visual Studio, at least I know it'll be relatively easy to get to work. As I would only want to build executables to run on Windows, I don't really want to install virtual machines, I guess I need something native. So I'm abandoning my GCC idea, from the alternatives I've found, I think my options would appear to be TCC or Visual Studio or nothing. TCC is about 500k, which is perhaps 100x bigger than my Vectrex Forth compiler, but I guess I could live with that, so that's probably up first. I can't quite get my head around what VS might be
|
|
|
Post by D-Type on Jan 24, 2021 17:31:30 GMT -5
Wow, I just found a Conway's Life program I wrote in C in 1995. Not only is it in C, but it's a Windows program using WM_ handlers and everything. I had no idea I'd forgotten so much! Doesn't run under Windows 10 x64 though :-(
|
|
|
Post by Peer on Jan 25, 2021 2:41:33 GMT -5
Sorry for the late reply. As Malban already said (and he used a more appropriate phrase), compiling C sources under Windows is, to put it politely, sometimes not that easy.
I am using Min_GW_64 and gcc, which works fine. Gcc already came as part of the Min_GW installer, and then worked (almost) right out of the box. I will check which installer file I used and then tell you. The created binaries will then probably require the Min_GW environment (libraries) to run properly.
I am also using Visual Studio (though it is not my preferred choice). It is huge, but when installing it, you can just de-select all other programming languages and modules other than the raw C/C++ compiler. That will reduce the required space on the hard drive.
Cheers, Peer
|
|
|
Post by Peer on Jan 25, 2021 3:51:06 GMT -5
If I remember correctly, I used this installer:
I should offer you a list of packages to install, and gcc should be among the (preselected?) packages. You will probably have to set your PATH environment variable accordingly, so that Windows will automatically find the binaries. It could very well be that the installer offers to set the PATH for you. It has been a while since I installed this stuff, and right now I do not have a Windoes 10 machine at hand to check the procedure.
Cheers, Peer
|
|
|
Post by D-Type on Jan 26, 2021 11:49:14 GMT -5
Thanks Peer for your thoughts.
Firstly, I tried tcc and for the basic C programs it seems to work fine. However, there are also some C++ programs I would like to try, so I need something else.
It seems C++ is a bit more commercially supported, there are a number of products listed on isocpp.org, which I assume would probably compile C also.
I found a C++ compiler from Digital Mars that has a basic package that's a 3MB download, I'll try that first.
If that doesn't work out, then maybe I'll try mingw or Visual Studio and filter out the stuff I don't need. I used to have no issue with complexity, but things are much worse these days.
Regarding path setup, now that is something I can handle!
|
|
|
Post by gtoal on Feb 10, 2021 16:21:14 GMT -5
|
|
|
Post by D-Type on Feb 15, 2021 16:43:09 GMT -5
Thanks for the link, Graham, tcc seems to work OK for me with the limited testing I've done, but lcc seems to have a good tutorial and support files. It's always good to have some alternatives.
I'm perplexed at these C compilers, it would appear there are the big standard compilers, GCC, CLang, Embarcadero, Microsoft, which are huge, but then you get these small ones that look like they're built by someone in their shed.
C has had various standards revisions over the years so I can't understand how the all of these compilers all stay compatible with one another and will still compile. What is missing from the small compilers that is not missing from the bigger ones?
What happens when a compiler doesn't compile your code correctly, but another compiler does? This situation also exists with Forth if you divert from the standard - and the language encourages you to do so, so everyone's Forth is different - but you can resolve it by changing the compiler, because the whole thing is the compiler, it's sort of expected. With C, hacking the compiler to make your code work seems somewhat undesirable!
I found some more of my old forgotten C code from 1996, I was even using x86 code to implement com port ring buffers. How did I forget that? I love my serial ports :-)
void interrupt Com1IntHandler(__CPPARGS) // Interrupt service routine { // for Com1 asm { MOV DX,COM1_DATA // DX = data port address IN AL,DX // Read the character MOV BX,WORD PTR Com1BufInPtr // Get buffer pointer MOV [BYTE PTR Com1Buffer+BX],AL // Store char in buffer INC BX // Bump bointer CMP BX,COM1_BUFF_SIZE // Time to wrap? JNE Com1NoWrap // No, skip reset XOR BX,BX // Reset pointer }
Com1NoWrap: asm { MOV WORD PTR Com1BufInPtr, BX // Store updated pointer STI // Re-enable interrupts MOV AL,0x20 // Send EOI to 8259 OUT PIC_EOI, AL } }
|
|