Compile a .cpp file on linux server
Posted: Mon Oct 31, 2005 11:03 am
I have a file called inmap.cpp that I need to compile on the server, this creates another file called a.out, anyone any ideas how I might do this?
1# I placed the inmap.cpp file in the public_html folder
2# I logged into the server from terminal with ssh
3# I ran gcc -lm inmap.cpp
The output is as follows:
root@ms1 [~]# gcc -lm inmap.cpp
gcc: inmap.cpp: No such file or directory
root@ms1 [~]#
I tried moving it into the main directory also, the one that is called by my ip address and contains the folders: public_html. .cpanel-datastore, mail, tmp, public_ftp etc. and did the same from there but got the same result. I guess this is because I need to get to another directory, like the one the file is in but how do I get there, I am not much up on working with command lines.
I ssh'd to the domain where the file was placed and then logged in using root and the root password for the server.
Would someone mind explaining 'step by step' as to how I would compile this file?
Thanks
1# I placed the inmap.cpp file in the public_html folder
2# I logged into the server from terminal with ssh
3# I ran gcc -lm inmap.cpp
The output is as follows:
root@ms1 [~]# gcc -lm inmap.cpp
gcc: inmap.cpp: No such file or directory
root@ms1 [~]#
I tried moving it into the main directory also, the one that is called by my ip address and contains the folders: public_html. .cpanel-datastore, mail, tmp, public_ftp etc. and did the same from there but got the same result. I guess this is because I need to get to another directory, like the one the file is in but how do I get there, I am not much up on working with command lines.
I ssh'd to the domain where the file was placed and then logged in using root and the root password for the server.
Would someone mind explaining 'step by step' as to how I would compile this file?
Thanks