title: Compiling a dll with functions defined in other dll / lib
body: <p>I am attempting to write a C dll file, which includes some functions derived from other dll, and also my own created function. I have no way to look into how the functions are defined in other dll, as they are not open sources code.
  In my simple example here, the function derived from other dll is getlibraryversion() and the function i defined is PowerOf2. </p>
  
  <p>Then, I want to compile this in the source code to obtain a new dll, which wraps the function derived from the other dll. Despite many hours of attempt, I tried to resolve the error, I am still getting this error.</p>
  
  <p>Error LNK2019 unresolved external symbol _printf referenced in function _getlibraryversion  MyDll   c:\Users\G11\documents\visual studio 2017\Projects\MyDll\MyDll\MyDll.obj    1   </p>
  
  <p>This error typically means that the library is not correctly referenced. So I tried:
  Under properties, LINKER>INPUT>additional dependencies, I inserted the lib 
  C/C++>GENERAL>Additional Include directories> I included the folder which contains this lib.</p>
  
  <p>QUESTION: Is what I am doing considered as impossible?  Otherwise, what are the alternative approaches?</p>
  
  <p>This link can find how to create and call C dll: <a href="http://www.zealfortechnology.com/2013/08/create-c-program-dynamic-link-library-dll-visual-studio-2012-implicit.html" rel="nofollow noreferrer">http://www.zealfortechnology.com/2013/08/create-c-program-dynamic-link-library-dll-visual-studio-2012-implicit.html</a></p>
  
  <p>Header file:</p>
  
  <pre><code>#ifdef MYDLL_EXPORTS
  #define MYDLL_API __declspec(dllexport) 
  #else
  #define MYDLL_API __declspec(dllimport) 
  #endif
  #define PI 3.1415
  MYDLL_API double PowerOf2(double UserNumber);
  MYDLL_API void getlibraryversion();
  </code></pre>
  
  <p>Source code:</p>
  
  <pre><code>#include "MYDLL.h"
  double PowerOf2(double UserNumber){
  
  return UserNumber * UserNumber;}
  
  
  
  void getlibraryversion() {
  char LIB_Version[8];
  
  TH260_GetLibraryVersion(LIB_Version);
  printf("\nLibrary version is %s\n", LIB_Version);}
  </code></pre>