vendredi 2 mars 2018

stucked using multiple projects inside same solution

i had problem using function from another project file to main project file inside same solution.i am doing it in visual studio 2017.

//1st project name:game(configuration type:.exe)

// 2nd project:engine(configuration type:static library,.lib)i made type to // .exe but also not solved the issue.

//main.cpp

#include <iostream>
#include "../../engine/src/engine.h"
int main()
    {
      a::test();
      std::cin.get();
    }

//engine.h

#include <iostream>
#include "../../engine/src/engine.h"
int main()
   {
a::test();
std::cin.get();
   }

//engine.cpp

#include <iostream>
#include "engine.h"
namespace a
    {
  void test()
      {
       std::cout << "hi" << std::endl;
      } 
   }

i tried to build above code. i know we can do this another way by using static ibrary linking. can you help me out? why this code didn't run? can you point out the reason? hope i get the answer. Thank you.

Aucun commentaire:

Enregistrer un commentaire