我不知道这是什么,现在已经找了一段时间。这里是C ++的新手。任何想法,非常感谢!我甚至不确定是否需要为你们提供更多信息来帮助,但是请告诉我,我会提供。
谢谢!
不确定此文本使用何种格式,但这里是错误输出:
Ld /Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Products/Debug/Map normal x86_64
cd /Users/tobydammit/Documents/Map
export MACOSX_DEPLOYMENT_TARGET=10.9
/Applications/Xcode6-Beta7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode6-Beta7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Products/Debug -F/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Products/Debug -filelist /Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map.LinkFileList -mmacosx-version-min=10.9 -stdlib=libc++ -Xlinker -dependency_info -Xlinker /Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map_dependency_info.dat -o /Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Products/Debug/Map
duplicate symbol __ZN4Map1C2Ev in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZN4Map1C1Ev in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZN4Map18setWidthEi in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZN4Map19setHeightEi in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZN4Map111setEntranceENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZN4Map17setExitENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZN4Map17setPathENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZNK4Map18getWidthEv in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZNK4Map19getHeightEv in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZNK4Map111getEntranceEv in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZNK4Map17getExitEv in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
duplicate symbol __ZNK4Map17getPathEv in:
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/Map1.o
/Users/tobydammit/Library/Developer/Xcode/DerivedData/Map-avxsuohepeftazcaavamzzjpovrz/Build/Intermediates/Map.build/Debug/Map.build/Objects-normal/x86_64/main.o
ld: 12 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@WhozCraig:这是.h文件。
另外,抱歉发布截图!
#ifndef Map_Map1_h
#define Map_Map1_h
#include <iostream>
#include <string>
using namespace std;
class Map1 {
public:
Map1();
void setWidth(int);
void setHeight(int);
void setEntrance(string);
void setExit(string);
void setPath(string);
void drawMap();
int getWidth()const;
int getHeight() const;
string getEntrance() const;
string getExit() const;
string getPath() const;
private:
int width;
int height;
string entry;
string exit;
string path;
};
#endif