gpt4 book ai didi

Mac 上的 C++ : linker command failed with exit code 1 (use -v to see invocation)

转载 作者:行者123 更新时间:2023-11-30 01:51:50 27 4
gpt4 key购买 nike

Ld /Users/rahulshrestha/Library/Developer/Xcode/DerivedData/101-bdjjlwlibkuaakgjcxqoslsirofh/Build/Products/Debug/101 normal x86_64
cd /Users/rahulshrestha/Dropbox/C++/101
export MACOSX_DEPLOYMENT_TARGET=10.9
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/rahulshrestha/Library/Developer/Xcode/DerivedData/101-bdjjlwlibkuaakgjcxqoslsirofh/Build/Products/Debug -F/Users/rahulshrestha/Library/Developer/Xcode/DerivedData/101-bdjjlwlibkuaakgjcxqoslsirofh/Build/Products/Debug -filelist /Users/rahulshrestha/Library/Developer/Xcode/DerivedData/101-bdjjlwlibkuaakgjcxqoslsirofh/Build/Intermediates/101.build/Debug/101.build/Objects-normal/x86_64/101.LinkFileList -mmacosx-version-min=10.9 -stdlib=libc++ -Xlinker -dependency_info -Xlinker /Users/rahulshrestha/Library/Developer/Xcode/DerivedData/101-bdjjlwlibkuaakgjcxqoslsirofh/Build/Intermediates/101.build/Debug/101.build/Objects-normal/x86_64/101_dependency_info.dat -o /Users/rahulshrestha/Library/Developer/Xcode/DerivedData/101-bdjjlwlibkuaakgjcxqoslsirofh/Build/Products/Debug/101

duplicate symbol _main in:
/Users/rahulshrestha/Library/Developer/Xcode/DerivedData/101-bdjjlwlibkuaakgjcxqoslsirofh/Build/Intermediates/101.build/Debug/101.build/Objects-normal/x86_64/main.o
/Users/rahulshrestha/Library/Developer/Xcode/DerivedData/101-bdjjlwlibkuaakgjcxqoslsirofh/Build/Intermediates/101.build/Debug/101.build/Objects-normal/x86_64/praca.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


#include <iostream>
using namespace std;

int main() {
double radius, circumference, area; // Declare 3 floating-point variables
const double PI = 3.14159265; // Declare and define PI

cout << "Enter the radius: "; // Prompting message
cin >> radius; // Read input into variable radius

// Compute area and circumference
area = radius * radius * PI;
circumference = 2.0 * radius * PI;

// Print the results
cout << "The radius is: " << radius << endl;
cout << "The area is: " << area << endl;
cout << "The circumference is: " << circumference << endl;

return 0;
}

最佳答案

您只能有一个 main() - 您决定需要保留哪一个以及需要删除哪一个。只保留一页,使用 main() 方法。

关于Mac 上的 C++ : linker command failed with exit code 1 (use -v to see invocation),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25596021/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com