0

I would like to run my server.cpp and client.cpp in my ubuntu server, someone can guide me in this ? I try ls(list) in my user in ubuntu server and it is empty. I want to import those files and execute the cpps. THankss !

2

1 Answer 1

3

You can’t run .cpp files the way they are. You have to compile them. You can use g++. It can be installed using apt on the package with the same name. If you’re not sure how to use it then see this question: What is a command to compile and run C++ programs?

From your question it sounds like your code was written on a different machine than the server. So you should get the files onto the server. If you physically can access it, use a USB drive or other storage medium. If you have a cloud instance or some other type of remote server, normally you should be able to ssh into it. So you can use scp to copy your files. The syntax is:

scp -P <port> file-to-copy user@server:/where/to/put

Afterwards you should be able to run your code.

If you’re still a bit confused about scp you can try looking at this article: https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/

Hope this helps!

Not the answer you're looking for? Browse other questions tagged .