嘗試構建關於未解析的外部符號的項目時出現錯誤,但是我無法找到問題所在,哪裏有任何想法?感謝無法解析的外部符號,C++
Tball.cpp
#include "Tball.h"
#include <Windows.h>
using namespace std;
Tball::Tball(){
Position = TVector(70,0,70);
Verlocity = TVector(1,0,1);
}
Tball.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" ([email protected]@@[email protected]@A)
1>Tball.obj : error LNK2001: unresolved external symbol "public: static class TVector Tball::Position" ([email protected]@@[email protected]@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 ==========
沒有我試過似乎爲我工作。
你可以編輯你的問題,包括確切的錯誤嗎?你使用的build命令的註釋也非常方便。 – simonc 2013-04-11 12:41:29
Woops,對不起,請務必 – Unknown 2013-04-11 12:42:47
順便它的拼寫「速度」 :) – 2013-04-11 12:43:25