Framework and References - visual-studio-2010

I used to use the VS2010. And there exists an option:
"Project "X" -> Properties -> Common Properties -> Framework and References"
And then I can add a bunch of references and set a few properties:
"Build Prop.. Project Reference.. etc"
In VS2015 I can't find this "properties path" or the properties in them. I also have googled and found nothing. It happens that I need to change some of that properties. Any suggestion?
Project description:
addon (principal); DLL to run nodejs addon (c++ with node.h and v8.h) (dependes on all)
g2pproj - static lib to convert phonemes and graphemes (c++)
libjulius - static lib with julius speech recognizer options (c) (dependes on libsent)
libsent - static lib with low level features (C)
Another libs:
ws2_32.lib - win sockets
portaudio.lib - link
The error is in portaudio (only one):
error LNK2001: unresolved external symbol __snwprintf
I already link and add all the additional dependencies.
In VS2010 I can compile this project without problems, and not in 2015. I want to use 2015, because is new and has the thread features

Related

What is __CxxFrameHandler4 and what does linker error "unresolved external symbol __CxxFrameHandler4" mean, exactly?

I'm using several libraries built through vcpkg (such as civet-web and prometheus-cpp), against my Visual C++ projects. When building x86 all is perfect, in x64 I get a bunch of linker errors:
error LNK2001: unresolved external symbol __CxxFrameHandler4
Searching online all references to this symbol/error are about specific projects, I cannot find what __CxxFrameHandler4 is and what problem this error is highlighting. I don't know if it's a problem with the way vcpkg is building the library, or a problem in my project or how to start looking for a solution.
I did find this blog article but it is in reference to a preview of VS2019, I cannot find any settings related to it: https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/
If anyone can explain what this is all about it would be a big help.
I faced the same issues when trying to install and use cpr with vcpkg. I wanted to use cpr library in a VS2015 project.
Reason: I had VS2019 installed. vcpkg uses latest version of toolset Visual Studio.
Resolution: Add your own triplet or change existing such a way that your specified toolset is used. Adding did not work in my case so I changed existing "triplet" files in triplet folder in vcpkg. I wanted vcpkg to use toolset that comes with VS2015 (It's V140)
Content of x86-windows.cmake file
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PLATFORM_TOOLSET "v140")
set(VCPKG_DEP_INFO_OVERRIDE_VARS "v140")
Content of x64-windows.cmake file
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PLATFORM_TOOLSET "v140")
set(VCPKG_DEP_INFO_OVERRIDE_VARS "v140")
A more general answer is that this happens if you are mixing objects that were built with different platform toolsets, e.g.,
Visual C++ 2015 (v140)
Visual C++ 2017 (v141)
Typically, you (or someone else) may have built a dependency of your project with a different compiler version (platform toolset), and the fix it to change the platform toolset of either your project or the dependency (or use the correct build of the dependency, if you used a pre-built package)
I think you pointed out the right article which is
https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/
I faced a similar issue in linking 64-bit library built with VC143 toolset with a 64-bit Application built with VC141 toolset.
After adding the following properties to VC143 built static library project, I was able to build the application. This disables the new feature mentioned in the above article (Exception Handling Smaller)
VS2019->Properties->C/C++->Command Line add '-d2FH4-'
VS2019->Properties->Linker->Command Line add '-d2:-FH4-'

Include c++ project in another c++ project from different solution in Visual Studio 2015

I have 2 c++ projects in different solutions. When I built the project B solution's it generated a .dll, .exp, .exe, and .lib files.
How I have to reference the project B in the project A?. I've tried rigth click -> add -> reference -> B.dll.
But it shows me a window error with the following message:
could not add a reference to B.dll for one of the following reasons:
Targets a higher version of the .NET Framework
Not a .NET assembly
Not a registered ActiveX control
I've never worked with visual studio,I'm a little bit lost
Thank you and sorry for my english

Linkage error with glui32.lib and libcd.lib on Visual Studio

I am trying to port a (very) old project of mine from Visual Studio 6 to Visual Studio 2010.
The project is an OpenGL application, and as such, it uses the following libraries (amongst others):
glu32.lib
glui32.lib
glut32.lib
opengl32.lib
The glui32.lib library links the libcd.lib library, which is not supported on Visual Studio 2010.
So I need to find a version of the glui32.lib library, which links the libcmtd.lib library instead.
My questions are:
Is there any such version of the glui32.lib library?
If yes - where can I download it?
If no - can I use the libcd.lib library on Visual Studio 2010?
If yes - where can I download it?
If no - is there any other way for me to solve this linkage error?
UPDATE
I'm leaving the answer below as the accepted one, but here is a workaround for porting an OpenGL project from Visual Studio 6 to Visual Studio 2010 (after creating the project in Visual Studio 2010):
Right click the project and choose Properties.
Open Configuration Properties --> C/C++ --> Preprocessor.
In the Preprocessor Definitions entry, add GLUT_BUILDING_LIB.
In the Runtime Library entry, choose Multi-threaded (/MT) or Multi-threaded Debug (/MTd).
Open Configuration Properties --> Linker -->Input.
In the Additional Dependencies entry, add glu32.lib;glui32.lib;glut32.lib;opengl32.lib.
In the Ignore Specific Default Libraries entry, add libcd.lib.
You can rebuild GLUI. The MSVS project they ship converts without issue to VS2010.
You will have to point it at your GLUT build though.

Cannot include a static library in the project

I am developing a subproject in a solution in MS Visual Studio 2005. The subproject is a Windows CE 6.0 service (as DLL) and it is included in the Windows CE 6.0 OS Project. In the subproject I need to use some functions from "ceosutil.lib" (svsutil.hxx is the header), but I cannot link it to my subproject. When building, I get the following type of errors: "error LNK2019: unresolved external symbol".
What is interesting, when I switch the project type to a static library, it compiles without problems. If I start a new DLL project (standalone one, not as subproject), it also works (the "ceosutil.lib" is already listed in the Additional Dependencies of the project and all configurations).
Please help!
I have found the answer to my own question. The solution is to add the name of the library ("ceosutil.lib", after a space) to Additional Libraries field in the Link tab of the subproject properties:
In MS Visual Studio 2005:
Right Mouse Click on subproject name -> Properties -> Link tab -> Additional Libraries.
default value was: $(_PROJECTROOT)\cesysgen\sdk\lib\$(_CPUINDPATH)\coredll.lib
new value: $(_PROJECTROOT)\cesysgen\sdk\lib\$(_CPUINDPATH)\coredll.lib ceosutil.lib
Update:
It is even easier to open the subproject (right mouse btn -> open) and paste the path to the library in the TARGETLIBS section. The result will be exactly the same:
TARGETLIBS= \
$(_PROJECTROOT)\cesysgen\sdk\lib\$(_CPUINDPATH)\coredll.lib \

Linkage Error LNK1104 in Visual C++ 2010

Today I fired up Visual Studio 2010 (Visual C++) and started working on a project. The solution contains two projects. One is a static library I am writing, the other is a test application containing unit tests for the library.
Without changing anything from yesterday, the executable no longer links:
LINK : fatal error LNK1104: cannot open file 'mylib.lib'
The static library compiles and links fine. I have not changed the project settings in around a week, and it was linking just fine yesterday.
If I go into the executable project's settings and add a library directory for $(SolutionDir)\debug, I instead get the following link error:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
I am not sure what the problem is. I have tried cleaning, rebuilding, and even rebooting my machine. Google turned up some bugs in ancient Visual C++ versions (but I'm using 2010), as well as the possibility that the program is already running. However, it is not running, and a reboot confirms this.
What would cause the linker not to find core libraries such as kernel32.lib, or for that matter, the output directory for my solution?
This is old-fashioned C++, a cross-platform library, not that managed stuff Microsoft added.
I had to check "Inherit from parent or project defaults" in the "Library Directories" dialog. Once I did that, the linker could find all the necessary libraries. I still had to include $(SolutionDir)\debug though.
Include the microsoft SDK directory in project->properties->linker->general->additional library directories.
on my computer it is
D:\Program Files\Microsoft SDKs\Windows\v7.1\Lib
I fixed this problem by disabling "Enable .NET Framework source stepping" (see: "Menu bar / Tools / Options / Debugging / General / Enable .NET Framework source stepping"). Apparently this is a bug in Visual Studio.

Resources