尝试构建有关未解决的外部符号的项目时出现错误,但是我无法找出问题所在,有人有任何想法吗?谢谢
tball.cpp
#include "Tball.h"
#include <Windows.h>
using namespace std;
Tball::Tball(){
Position = TVector(70,0,70);
Verlocity = TVector(1,0,1);
}
球体.h
#ifndef Tball_h
#define Tball_h
#include <iostream>
#include "mathex.h"
#include "tvector.h"
class Tball
{
public:
static TVector Position;
static TVector Verlocity;
Tball();
static void DrawBall(float x, float y, float z);
static TVector MoveBall();
static void init();
static int loadbitmap(char *filename);
static void SurfaceNormalVector();
static double Tball::collision();
static void Tball::pointz();
};
#endif
错误:
1>------ Build started: Project: Breakout Complete, Configuration: Debug Win32 ------
1> Tball.cpp
1> Generating Code...
1>g:\work\second year\c++ breakout complete\breakout complete\tball.cpp(59): warning C4715: 'Tball::MoveBall' : not all control paths return a value
1> Skipping... (no relevant changes detected)
1> Tvector.cpp
1> TdisplayImp.cpp
1> TBricks.cpp
1>Tball.obj : error LNK2001: unresolved external symbol "public: static class TVector Tball::Verlocity" (?Verlocity@Tball@@2VTVector@@A)
1>Tball.obj : error LNK2001: unresolved external symbol "public: static class TVector Tball::Position" (?Position@Tball@@2VTVector@@A)
1>G:\Work\Second year\C++ Breakout Complete\Debug\Breakout Complete.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我尝试过的任何东西似乎都对我有用。