ubuntu 平台 codeblocks 编译多文件项目时出现error: ld returned 1 exit status 的问题

/*******a.h*******/
#ifndef A_H_INCLUDE
#define A_H_INCLUDE

void test();

#endif

/***********a.cpp***********/
#include
#include "a.h"
using namespace std;

void test(){
cout<<"hello"<<endl;
}

/*********main.cpp************/
#include "a.h"

int main()
{
test();
return 0;
}

用codeblocks 编译的时候怎么都无法编译过。一直提示error:ld returned 1 exit status.

a.h里面
void test();
修改为
extern void test();

a.cpp里面
去掉
#include "a.h"