How to compile and run C program imported from GitHub
Hi, I've just imported my own C program from my GitHub repo, when I try to press the Run button, it asks me to configure run from repl.it files. What should I do for it to compile and run?
PattanAhmed
@moderndaymage Hi,
So, for your question:-
In .replit file
Try this:-
So, for your question:-
In .replit file
Try this:-
language = "c" run = "C ./arknights_pulls_simulation.c"
That's it
Thanks!
Hope this helps
CodeLongAndPros
@PattanAhmed Uh do you know how C works? It’s a compiled language for one.
PattanAhmed
@CodeLongAndPros LoL!
Yes I know...
Yes I know...
Coder100
Something like:
run="g++ -std=c++0x *.cpp -o example_program"
I always use the gcc compiler, so I'd personally create a makefile:
Then, within the
.replit
file, put:To me personally this is the easiest way to fully compile the project. I always use gcc and makefiles to compile my projects
makefile:9: *** mising operator. Stop.
Here is the link: https://github.com/ARACADERISE/Jang/blob/master/Makefile
in this Makefile, I put
src/*.c
andsrc/*.h
, you can adjust the file to fit your project.Also, that error is still very confusing to me. I don't understand why the makefile doesn't compile, so just copy and paste the makefile I linked above to your Makefile and adjust the file to fit your needs
Also be aware that the Makefile I linked above has a few other ideals to it such like Memory checking with valgrind.
Ping me if you have any more questions or need help!