我在编译我编写的程序时遇到问题。我有两个不同的文件具有相同的包括但只有一个生成时使用g ++标准x86_64库中的编译问题
/usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../../../lib/crt1.o: In function `_start':
/build/buildd/eglibc-2.10.1/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
collect2: ld returned 1 exit status
编译下面的错误,我包括我的头中的文件如下:
#include <google/sparse_hash_map>
using google::sparse_hash_map;
#include <ext/hash_map>
#include <math.h>
#include <iostream>
#include <queue>
#include <vector>
#include <stack>
using std::priority_queue;
using std::stack;
using std::vector;
using __gnu_cxx::hash_map;
using __gnu_cxx::hash;
using namespace std;
在网上搜索这两条线没有任何帮助我的东西。我会非常感谢任何建议。谢谢
你可以给我们提供完整的源代码,或者至少在main()之前的几行文件中编译失败吗? – ivans 2010-05-25 20:11:13
嗨,谢谢你的提示。我遵循了你的一些建议,并意识到我不了解我编程的主要需求。以为我可以编译为一个函数。似乎我有很多东西要学。 – user350282 2010-05-25 20:44:25