linux qt 动态链接库 静态链接库 学习笔记
http://hi.baidu.com/codeworkman/blog/item/32b6ccce51bf3622f9dc6141.ht
ml
====hello.h====
#ifndef HELLO_H
#define HELLO_H
extern "C" void hello(const char *name);
#endif
====hello.c====
#include <stdio.h>
#include "hello.h"
void hello(const char *name)
{
printf("Hello %s!", name);
}
====main.c====
#include "hello.h"
int main()
{
hello("everyone");
return 1;
}
[方案 0]
gcc hello.c main.c
gcc hello.c main.c -o hello
[方案 1]
gcc -c hello.c
gcc -c main.c
gcc hello.o main.o -o hello
评论0
最新资源