C++ Eclipse:自动生成makefile不工作?

C++ Eclipse:自动生成makefile不工作?,c++,eclipse,makefile,C++,Eclipse,Makefile,在下图的控制台中,您可以看到自动链接可能无法正常工作。我需要做什么?下面是我正在使用的代码。我还进行了刷新、清理和重建,但错误仍然存在 /* * Fibonacci.h * * Created on: Apr 2, 2014 * Author: rose */ #ifndef FIBONACCI_H_ #define FIBONACCI_H_ unsigned int Fibonacci(unsigned int n); #endif /* FIBONACCI_H

在下图的控制台中,您可以看到自动链接可能无法正常工作。我需要做什么?下面是我正在使用的代码。我还进行了刷新、清理和重建,但错误仍然存在

/*
 * Fibonacci.h
 *
 *  Created on: Apr 2, 2014
 *      Author: rose
 */

#ifndef FIBONACCI_H_
#define FIBONACCI_H_


unsigned int Fibonacci(unsigned int n);


#endif /* FIBONACCI_H_ */



/*
 * Fibonacci.cpp
 *
 *  Created on: Apr 2, 2014
 *      Author: rose
 */


#include "Fibonacci.h"

unsigned int Fibonacci(unsigned int n)
{
    if (n==1) {
        return 1;
    } else if (n == 0) {
        return 0;
    }

    return Fibonacci(n-2) + Fibonacci(n-1);
}



/*
 * main.cpp
 *
 *  Created on: Apr 2, 2014
 *      Author: rose
 */

#include <iostream>
#include "Fibonacci.h"

int main(int argc, char *argv[])
{
    std::cout << "Fibonacci(10) = " << Fibonacci(10) << std::endl;
}

/*
*斐波那契
*
*创建日期:2014年4月2日
*作者:罗斯
*/
#ifndef斐波那契H_
#定义斐波那契函数_
无符号整数Fibonacci(无符号整数n);
#endif/*斐波那契*/
/*
*斐波那契
*
*创建日期:2014年4月2日
*作者:罗斯
*/
#包括“Fibonacci.h”
无符号整数斐波那契(无符号整数n)
{
如果(n==1){
返回1;
}else如果(n==0){
返回0;
}
返回斐波那契(n-2)+斐波那契(n-1);
}
/*
*main.cpp
*
*创建日期:2014年4月2日
*作者:罗斯
*/
#包括
#包括“Fibonacci.h”
int main(int argc,char*argv[])
{

std::cout这不是链接器的问题,而是编译器的问题。您需要在
main.cpp
中包含
Fibonacci.h
,这是编译时错误,与链接器设置无关。请确保
Fibonacci.h
包含在
#include
中,是正确的文件,并且包含
Fi的声明博纳奇
。我把代码抄错了。你可以在图中看到,这个include确实存在。