Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since it's Christmas time and I see that you're using MSVS, here are steps that I did to try your library:</p> <p><strong>Step 1</strong>: I have created new solution called XmasTest with new Win32 project in it called XmasLib.</p> <p><strong>Step 2</strong>: I have added your source files in that project, just a simple example-appropriate modification. I have even let that evil <code>using namespace std;</code> line in the header file.</p> <p>Util.h</p> <pre><code>#ifndef UTIL_H_ #define UTIL_H_ #include &lt;string&gt; #include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;stdlib.h&gt; using namespace std; namespace Kaczmarz { class Util { public: Util(); static void print(); virtual ~Util(); }; } /* namespace Kaczmarz */ #endif </code></pre> <p>Util.cpp</p> <pre><code>#include "Util.h" using namespace std; namespace Kaczmarz { Util::Util() { // TODO Auto-generated constructor stub } void Util::print() { cout &lt;&lt; "Util::print() works! yay!" &lt;&lt; endl; } Util::~Util() { } } /* namespace Kaczmarz */ </code></pre> <p><strong>Step 3</strong>: I have created new Win32 Console application called XmasLibTestApp with following code in it:</p> <pre><code>#include &lt;iostream&gt; #include "../XmasLib/Util.h" using namespace std; using namespace Kaczmarz; int main(){ Util u; u.print(); return 0; } </code></pre> <p><strong>Step 4</strong>: Since these are 2 projects within 1 solution, I have handled the dependency in the following way:</p> <ol> <li>Linker->General->Additional Library Directories: $(OutDir)</li> <li>Linker->Input->Additional Dependencies: XmasLib.lib</li> <li>Solution Properties->ProjectDependencies: App depends on lib</li> </ol> <p><strong>Step 5</strong>: Build Solution and run app. Output: <code>Util::print() works! yay!</code></p> <p>And that's it. End of the story, everything works, developer rejoices with his IDE.</p> <p>Happy Xmas! :D</p> <hr> <p>PS: Questions that are worth to have a look at:<br> <a href="https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-a-bad-practice-in-c">Why is &quot;using namespace std&quot; considered bad practice?</a><br> <a href="https://stackoverflow.com/questions/2218140/what-requires-me-to-declare-using-namespace-std">What requires me to declare &quot;using namespace std;&quot;?</a><br> <a href="https://stackoverflow.com/questions/6474756/where-to-put-using-namespace-std">where to put using namespace std;</a> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload