爲什麼我的節目很好,沒有警告編譯當我輸入g++ program_name
但是當我鍵入gcc program_name
我得到了一個未定義引用錯誤的screenfuls ...我是否需要做一些特殊的事情來讓我的C++程序使用gcc進行編譯?
我使用標準庫了不少,這裏是我的包括:
#include<string>
#include<vector>
#include<fstream>
#include<sstream>
#include<iomanip>
#include<iostream>
#include<algorithm>
using namespace std;
我問的原因是我花了所有時間爲codeeval.com challange開發解決方案。它使用g ++編譯時可以很好地工作,但不會用gcc編譯。長篇小說,當codeeval試圖運行我的東西時,雖然我不知道他們是如何進行測試提交的,但得分爲0(!),他們只是說:Your program did not pass all the test cases or there may have been warnings printed out at runtime
。
當然,我不知道他們是如何編譯它......他們說:
You submissions are executed in a *NIX type environment. Assume softwares/shells etc are in their standard locations. Nothing else.
(因爲在他們提交guidlines一個錯字,可能其他的東西,是嗎?)
他們也說他們接受C++ 4.3.4的解決方案。我正在運行cywin,4.3.4是我的gcc版本。
是否有其他人曾經將C++代碼提交給codeeval.com存在問題?
我儘量不超沮喪,但在這一點上,他們似乎更喜歡codeevil.com我...在標準C++庫默認
C++代碼僅用g ++編譯。 gcc是用於C代碼的。 – iammilind
'man gcc'說'gcc - GNU項目C和C++編譯器' – Jimmy
g ++是C++的,並且是gcc之上的。你可以檢查gcc和g ++的工具大小來得出這個結論。 – Arunmu