私はC++の初心者で、いくつかの初心者コードを実行しようとしています。私は、コードを修正するためにどのようにこの単純なC++プログラムの実行方法は?
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
、私はコマンドg++ myTest.cpp -o myTest.out
を使ってMac OSでの端末から実行しようとすると
myTest.h
////////
#ifndef __myTest_h__
#define __myTest_h__
#include <string>
using std::string;
class myTest{
public:
int main(int, char const**);
};
#endif // __myArray_h__
myTest.cpp
//////////
#include<iostream>
#include<string>
#include "myTest.h"
using namespace std;
int myTest::main(int argc, char const *argv[])
{
std::cout<< "Hello World/n";
return 0;
}
が、私はターミナルで次のエラーを取得するには、次のファイルを持っていますC++を使い始めるには?私はより多くの情報を-v
コマンドを使用して提供することができます、私に必要な場合は教えてください。
C++は、これは助けになるはずですJavaの – datenwolf
ではありません。http://stackoverflow.com/questions/388242/c-book-guide-and-list – user2079303