online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> // This is the header file utest.h #ifndef UTEST #define UTEST namespace Builder { class Worker { public: static const unsigned int SKILL = 10; }; } // end namespace Builder #endif // main.cpp //#include "utest.h" #include <iostream> #include <memory> int main() { // I can compile this line just fine with -O0 std::cout << "SKILL is: " << Builder::Worker::SKILL << "\n"; // Compiling the following line with -O0 I get 'undefined reference to Builder::Worker::SKILL' but not with -O1 or -O2 for example... why? const std::shared_ptr<unsigned int> myPtr = std::make_shared<unsigned int>(Builder::Worker::SKILL); }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text



Program is not being debugged. Click "Debug" button to start program in debug mode.