How to include existing project as library in visual studio 2010 - c++

I am using visual studio 2010.
Problem:
I want to build project A, B and C. Project A and B are independent where C will use both of them as a library. I open three empty c++ projects. I build and compile project A and B with no errors.
Then I build project C with adding the exiting project function, adding additional include directories through Project->Property->C/C++->General->Additional Include Directories.
After that, I finished building project C and then compile, following is the error I got.
Error:
LNK2019, LNK1120
I searched through the web and I belief that there should be some additional setting is need under the Project->Property->Linker...
But I am not sure what they are, anyone can help?

Related

Fatal error “LNK1104: cannot open file 'libCbc.lib'” when I compile a C++ project in Visual Studio 2017?

I've never used VS before.
My friend shared with me his program working and running correctly (she uses VS 2013 and I use 2017 - any compatibility problem?).
I've downloaded it and changed the paths on
Configuration Properties, C and C++, General, Additional Include Directories (picture below)
Configuration Properties, Linker, General, Additional Library Directories
However Im getting one fatal error which does not find this file located in:
Users\Julio\Documents\CPFL\SolverCPP\coin\libdebug
Users\Julio\Documents\CPFL\SolverCPP\coin\lib
How can I solve this path error? Also any tip to share project is welcome,

LNK1104 Cryptopp.lib with CRYPTOPP_DEFAULT_NO_DLL defined in dll project

I'm using Visual Studio 2013, with the 2012 toolset and I'm trying to split an win32 executable project up into an exe that consumes a dll that contains all the program logic. The end goal is to be able to create a seperate project for unit tests that can link against the new dll.
Now the old version of the project compiles absolutely fine and uses cryptlib.lib (thanks SVN!), but once I separated it out in to a dll with the program logic and the same project settings I get the following error when I attempt to build the dll:
Error 546 error LNK1104: cannot open file 'cryptopp.lib'
I have the directory that contains cryptlib.lib in my linker settings and I'm linking against it just as I did in the previous project settings. Based on the documentation it shouldn't be trying to link against cryptopp.lib because CRYPTOPP_DEFAULT_NO_DLL is defined in the preprocessor settings.
I also tried adding the directory that contains cryptopp.lib to the VC++ directory paths and I added cryptopp.lib to my linker settings, and it still gives me the same error. I don't want to use the dll version of cryptopp, but at this point I just need the thing to work.
All the projects are using the 2012 toolsets, and all are being compiled as win32 projects so I'm not sure where to go from here.
Well I figured out what was happening, if not why. For some reason the preprocessor definitions don't seem to be getting applied. If I put CRYPTOPP_DEFAULT_NO_DLL at the top of all the include files it works as expected.

Libpd configuration in Visual C++ 2010

I'm trying to import and run the C++ sample project coming with the libpd API CppTest within a Visual C++ 2010 project.
I imported the C++ API files of libpd, i.e. PdBase, PdReceiver, PdMidiReceiver and PdTypes, with corresponding source files in the case of PdBase and PdTypes. I put as additional include directories the include folder of Pure Data
("C:\pd_installation_folder\include") and the libpd_wrapper folder containing the C code of the libpd wrapper.
When i run the solution of the sample project it doesn't work due to an error during the linking phase, "error LNK2019" with a huge list of unresolved externals.
What's the problem here?
Should I have any libpd additional static library (or .dll) provided to the linker configuration properties of the VC++ project?

Microsoft Visual Studio 2013 Link Error 1104

A while ago I attempted to make make a game using c++ and SDL. I am now taking a class that requires me to program in C++ and I would like to use VS as the IDE. I uninstalled VS 2012 and upgraded to 2013. I am able to compile c# code but when I make a c++ project I get the error
error LNK1104: cannot open file 'SDL.lib'
I went to the project properties -> Configuration Properties -> Linker -> input and made sure that SDL was not referenced there. My Additional Dependencies now has the value %(AdditionalDependencies). The rest of the options are blank. I also made sure that in VC++ Directories the Include Directories did not include anything related to SDL. Having done all of this I still get the same error. Is is somehow inheriting the SDL linker. The project only contains a hello world program which does not include any other libraries. Any help is appreciated.
You can try this:
Right click the project and choose Properties.
Open Configuration Properties --> Linker -->Input.
In the Ignore Specific Default Libraries entry, add SDL.lib.
BTW, whatever you add in your Include Directories cannot cause a linkage error (and neither can any include that you have in your project).

Stepping between managed and unmanaged code in Visual Studio

There are three projects:
project A (my project, WPF .NET 4.5)
project B (managed C++ with CLR (.NET wrapper for the FANN library))
project C (unmanaged project made in C, (FANN library))
In Visual Studio 2012 with project A opened, I can't step into to the project C through the project B.
Project B and C are free and open source and I have already built them successfully.
Project A references project B's DLL and project A won't run if the project C's DLL file cannot be found - so I have copied and pasted the DLL for the project C inside the project and set "Copy always" to the output directory.
When stepping into during debugging, I can get only to the project B's source code. I don't even see the project C loaded in the Modules window which I do not understand at all.
The project wouldn't run without the project C's DLL included and when it's included, it won't load but all the calls are working so it must be loaded somewhere.
I tried to include the project C's PDB file to the project A's output directory but no luck, function calls from project B to project C still get stepped over and never into.
Note that:
Just My Code is disabled
project C is included in the project B's in two ways - a "lib" file (in the linker settings) and its ".h" files in the source code are referenced... I don't know if that is the problem but you might.
I know there must be a way to achieve this, I have all the source code available but I'm no expert in C or C++ code, nor in debugging of it. I have tried including all the various project C's files from the bin directory to the project A but can't get it working.
Thanks for any help or advice!
If you're using Visual Studio, you have to explicitly enable debugging unmanaged code. You can do this from
Solution Explorer -> csproj -> Properties -> Debug -> Enable unmanaged code debugging