1

Hi I am trying to merge two visual studio solution files into one and I have been having a difficult time calling one project to the other.

  • I have Solution X which contains Project A, which is a console application to control camera.
  • I have another solution Y which contains Project B produces a dll for another application to display plots.

After combining these two projects under one solution I made Project A to be a static library for Project B to call functions reside in Project A.

On Project B I added Project A's reference and also added a path to the include files of Project A.

I can build Project A independently, but I cannot build Project B. Visual studio complains as follows:

 Severity   Code    Description Project File    Line    Suppression State
 Error  LNK1120 1 unresolved externals  XOP3    
 C:\Users\xxx\Documents\project\pvcam_project\XOP3\VC\XOP3-64.xop   1   

 Severity   Code    Description Project File    Line    Suppression State
 Warning    LNK4098 defaultlib 'LIBCMT' conflicts with use of other libs; 
 use /NODEFAULTLIB:library  XOP3    
 C:\Users\xxx\Documents\project\pvcam_project\XOP3\VC\LINK  1   

 Severity   Code    Description Project File    Line    Suppression State
 Error  LNK2019 unresolved external symbol pl_pvcam_get_ver referenced in 
 function "void __cdecl DoWave(void * *)" (?DoWave@@YAXPEAPEAX@Z)   XOP3    
 C:\Users\xxx\Documents\project\pvcam_project\XOP3\VC\XOP3.obj  1   

I followed this as an example and was able to build https://msdn.microsoft.com/en-us/library/ms235627(v=vs.90).aspx

I would like to know:

  1. Is it a good idea to have project A as a static library for project B to access ? Should the project A be a dll ?
  2. From Solution Y I added a project A and updated the locations of include files and etc by following (How do I merge two different Visual Studio solutions?) Is this the easiest way to merge two solutions ?
  3. Lastly it is the most important one I am not sure how to resolve the compilation error.

Thank you very much for taking a look at my problem.

user1296153
  • 575
  • 6
  • 23
  • So the compilation error went away by adding a library file for Project A and B, but I still have "1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library". At least this is a warning. – user1296153 Jul 07 '17 at 18:31
  • Instead of adding reference you can simply start by calling the functions that you need From A First. Then add its required Header and .CPP files to your Project B. If the files that you just added to project B calls the other files From A, Then keep adding and compiling them to avoid the Linking errors. – Juniar Jul 07 '17 at 22:50

0 Answers0