I am using Eclipse Juno, and Cygwin C++ compiler (latest version). I wanted to declare shared_ptr (haven't worked with this pointer before) as..
Included the memory header file. int main(){
std::shared_ptr pointer;
return 0; }
but the compiler cannot resolve shared_ptr. To solve this problem I have done the following steps:
- properties->c/c++ build->settings->tool settings->Miscellaneous-> other flags-> -c -fmessage-length=0 -std=c++11
- properties->c/c++ build->settings->tool settings-> Cygwin C++ linker-> libraries(-l)-> add (-pthread)
- C/c++ General->path and symbols->Symbols-> Add- GXX_EXPERIMENTAL_CXX0X into "Name" and left "Value" blank.
- C/c++ General -> Preprocessor include Paths, Macros->Entries-> CDT user setting entries->Add-> Preprocessor Macro (from dropdown manue)-> Name: __cplusplus, Value:201103L-> Apply
- Index-> Rebuild
- Restart Eclipse
Unfortunately, could not solve the problem. It would so nice of you if I get help. Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire