Create a static library
Write your question here.
I want to create a static library. Can you tell what's wrong in my code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#pragma once
namespace MyFuncs
{
class MyClass
{
public:
static void func();
};
}
#include "MathFuncsLib.h"
#include <stdexcept>
#include <iostream>
#include <cstdlib>
#include <cctype>
using namespace std;
namespace MyFuncs
{
void MyClass::func() {
int ix = 0;
char character, str[] = "Test String.n";
while (str[ix])
{
character = str[ix];
std::cout << (char)toupper(character);
ix++;
}
}
}
#include "stdafx.h"
#include "MathFuncsLib.h"
#include <iostream>
#include <cstdlib>
#include <cctype>
using namespace std;
int main()
{
MyFuncs:: MyСlass c; - here is written:the namespace "MyFuncs" does not contain member "MyClass"
c.func();
return 0;
}
|
It works for me on VS 2013 CE. Try to do a complete rebuild.
BTW. You call static functions like that MyFuncs::MyClass::func ();
Thank you very much, you helped me a lot. I have used your other tip:MyFuncs::MyClass::func ();
Topic archived. No new replies allowed.