redhat 6.0 编译mysql 和 gtk

When I first time compile the gtk programs, it occurred many errors.


It said that many functions undefined. You must know that the compiler can't find the  defines of them.
Then you should add the correct path for the compiler manually, next you will succeed compiled.

But how does it works?
Use the command like this: $:gcc -o filename filename.c `pkg-config --cflags --libs gtk+-2.0`.
Behind the filename.c we use "the Backward apostrophe"-below the esc key.

<This method is used for the default installation at OS installation. If you install gtk yourself, maybe it can't be work using this way.>


MYSQL was also made me confused when I began to compile it.
Actually, the Linux operating system was designed by the best hackers in the world. So it designed by a  purpose that is user are best programmer.

That means users must configure everything themselves. So you find many errors when using the linux OS, but please don't scare because it can make become a good hacker.

OK, we turn back. In order to compile the programs contained mysql functions, just add the parameter
$(mysql_config --cflags --libs). This is a environment variable, you can use command "echo $(mysql_config --cflags --libs)" to check what it is.
eg:
        $: gcc filename.c $(mysql_config --cflags --libs) -o filename 


As a Linux programmer, what you do is doing everything yourself. But I don't say Linux is hard to learn.
In fact, it is easy to learn.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值