Running a program (written in C) in Linux [closed]
Want to improve this question? Update the question so 开发者_开发知识库it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionI'm using Ubuntu.
I wrote a program in C which interacts with a Mysql Database
The compilation process goes smoothly (excepts several warnings) and I get the executable.
How do I run it in Ubuntu?
I mean, I use this command :
gcc -o magazzino main_magazzino.c -L/usr/include/mysql -lmysqlclient
How do I run magazzino?
if it is in the current directory, run ./magazzino
Usually:
./magazzino
The dot and slash are to tell the shell that you mean the executable in this current directory - otherwise it would search for the program in its $PATH and probably not find it. (Although it's possible to have the current directory in your PATH, this is a bad idea and not recommended for security reasons.)
Just use
/path/to/magazzino
And if your current_folder is same with where magazzino stored use
./magazzino
In the directory type in,
./magazzino
精彩评论