Full code of sequence_test.cpp
(测试调试器驱动程序)
这是头文件代码
#ifndef SEQUENCE_H
#define SEQUENCE_H
#include <cstdlib> // Provides size_t
namespace CISP430_A2
{
class sequence
{
public:
// TYPEDEFS and MEMBER CONSTANTS
typedef double value_type;
typedef size_t size_type;
enum { CAPACITY = 30 };
// CONSTRUCTOR
sequence(size_type entry=CAPACITY )
{
for(int i=0;i<CAPACITY;i++)
data[i]=0;
used=0;
capacity=CAPACITY;
current_index=0;
}
// COPY CONSTRUCTOR
sequence(const sequence& entry);
// Library facilities used: cstdlib
// MODIFICATION MEMBER FUNCTIONS
void start( );
void advance( );
void insert(const value_type& entry);
void attach(const value_type& entry);
void remove_current( );
void resize(size_type new_capacity);
void sequence::operator =(const sequence& entry);
// CONSTANT MEMBER FUNCTIONS
size_type size( ) const;
bool is_item( ) const;
value_type current( ) const;
//Destructor
~sequence(){}
private:
value_type data[CAPACITY];
size_type used;
size_type capacity;
size_type current_index;
};
}
#endif
我目前收到此链接器错误:
sequence_test.obj:错误LNK2019:函数
public: __thiscall CISP430_A2::sequence::sequence(unsigned int)
中引用的未解析的外部符号“_main
”(?? 0序列@ CISP430_A2 @@ QAE @ I @ Z)
答案 0 :(得分:0)
我只是成功地尝试并编译了你的文件,因此它不在你的代码中(至少不在你发布的部分中)
我想,您正在使用Visual Studio?请尝试以下