Compile an external C file to an executable

BlitzMax Forums/BlitzMax Programming/Compile an external C file to an executable

Pineapple(Posted 2010) [#1]
How can it be done? I wrote a program that compiles BrainF*ck to C code, but it's not so useful if it can't compile the C to an executable. How can I do this through blitzmax?


TomToad(Posted 2010) [#2]
I believe the command is System_()? You would basically call a c compiler and pass it your C code, but then you would need to have a c compiler installed on your computer.

System_("CCompiler MyProject.c")

But why did you convert to C? Why not convert to BMax? Then you could just call the BMK compiler and not have to worry about having a c compiler installed.


Azathoth(Posted 2010) [#3]
Nilium had made a TinyCC module but I can't find a working link.


GW(Posted 2010) [#4]
Actually you can comment out the Main function from the tcc source and import the c code directly. But the system_ is better if you just want to call the compiler.