dev makefile.win 在 dev c++ 上编译 C++ 时出错
dev makefile.win error while compiling c++ on dev c++
我试图在dev c ++中使用我自己的自定义头文件运行我的代码。
但是当我编译它时得到这个错误:
25 C:UsersaliDesktophw2Makefile.win recipe for target 'tar.exe' failed
它指向makefile.win中的这一行:
$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)
并且我还将我的文件添加到我的项目中:main.cpp&post.cpp&post.h
这是我的代码(仅限邮箱类):
在头文件中:
#include <iostream>
#include <string>
using namespace std;
#ifndef P
#define P
class PostBox{
friend void Send(PostBox);
public:
int getcount();
void Count();
PostBox(string,float,int,Person,Person);
PostBox();
void setID(string);
void setweight(float);
void setsender(Person);
void setreceiver(Person);
void cost();
string getid();
Person getsender();
Person getreceiver();
protected:
static int count;
string id;
float weight;
int price;
Person sender;
Person receiver;
};
#endif
在我的 CPP 文件中:
#include <iostream>
#include "post.h"
using namespace std;
PostBox::PostBox(string id,float weight,int price,Person sender,Person receiver)
{
this->count=0;
this->id=id;
this->weight=weight;
this->price=price;
this->sender=sender;
this->receiver=receiver;
}
您缺少static int ::count
声明。
将这样的东西放入您的 cpp 文件int PostBox::count = 0
.
相关文章:
- 请发现它在 dev 中工作的错误,但在 hackerrank 中不起作用
- 无法在 dev-c++ 上编译程序?
- Dev c++ mingw 不再编译
- 如何在 Windows 上将bcrypt_gensalt与 /dev/urandom 一起使用?
- 我正在使用dev c ++,但收到错误(C++98'array'必须由构造函数初始化)
- dev Wx Dev C++ vs Graphics.h?
- dev如何在C++中比较二进制数
- 在linux中为c++dev配置VSCode
- DEV C++ 第 69 行 [错误] ISO "for" 范围更改了"i"的名称查找 [-允许]
- dev在试图从dev c++mingw 4.8.1中的文件读取时接收分段错误
- 我有一个C++函数,它在Dev C++中编译,但在G++中不编译
- 写入/dev/ttyS0后读取0字节
- 如何将 stderr 重定向到 /dev/null
- 如何创建C++DLL(使用DEV -C++)并在MT4脚本中使用(逐步)
- auto 关键字在 Dev c++ 中不起作用
- 从 win 7 升级到 Win 10 后,出现 Dev-C++ makefile.win 编译错误
- 如何检测 ofstream 是否正在写入 /dev/null
- 如何将 libproxy-dev 链接到现有的 cmake 项目(C++)?
- 在哪里调用主函数(dev c ++)
- mmap with /dev/input/event*