开发者

Running a program (written in C) in Linux [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so 开发者_开发知识库it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I'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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜