Chromium Embedded Framework VS2013 strings error - c++

I am converting a project which uses CEF, from VS2010 Express to VS2013 Express. I recompiled libcef_d.lib and libcef_dll_wrapper_d.lib with VS2013 just fine. But now I have problems when I try to link the libs in my main project. How can I resolve this?
WebBrowser_Handler.obj : error LNK2001: unresolved external symbol _cef_string_utf16_clear
WebBrowserManager.obj : error LNK2001: unresolved external symbol _cef_string_utf16_clear
libcef_dll_wrapper_d.lib(browser_ctocpp.obj) : error LNK2001: unresolved external symbol __imp__cef_string_list_alloc
libcef_dll_wrapper_d.lib(cookie_manager_ctocpp.obj) : error LNK2001: unresolved external symbol __imp__cef_string_list_alloc
libcef_dll_wrapper_d.lib(drag_data_ctocpp.obj) : error LNK2001: unresolved external symbol __imp__cef_string_list_alloc

First, make sure that libcef_dll_wrapper uses the same runtime library as your project: http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx.
Second, if you build CEF from source code and you'd changed something in CEF include folder, you need to run the translator tool:
cd x:\path\to\cef\tool
translator.bat

Related

How should I deal with "Fatal error LNK1120" when I tried to compile Ipopt-3.9.3 in Windows 10 & Visual C++ 2010

all.
I’m compiling Ipopt-3.9.3 in Windows 10 & Visual C++ 2010 Express.
I’ve built the projects of libCoinBlas, libConHSL, libCoinLapack as well as libIpopt, and generated libCoinBlas.lib, libCoinHSL.lib, libCoinLapack.lib as well as libIpopt.lib in the correct paths but with some warnings.
While when I tried to build the projects of IpoptAmplSolver and hs071_cpp, there exists the following fatal errors.
5>  Generating Code...
5> Creating library Release\IpoptAmplSolver.lib and object Release\IpoptAmplSolver.exp
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlr_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlr_
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlc_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlc_
5>dlascl.obj : error LNK2019: unresolved external symbol _disnan_ referenced in function _dlascl_
5>dpotf2.obj : error LNK2001: unresolved external symbol _disnan_
5>Release\IpoptAmplSolver.exe : fatal error LNK1120: 3 unresolved externals
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========
5>------ Rebuild All started: Project: hs071_cpp, Configuration: Release Win32 ------
5>  hs071_main.cpp
5>  hs071_nlp.cpp
5>  Generating Code...
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlr_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlr_
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlc_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlc_
5>dlascl.obj : error LNK2019: unresolved external symbol _disnan_ referenced in function _dlascl_
5>dpotf2.obj : error LNK2001: unresolved external symbol _disnan_
5>LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain#16 referenced in function ___tmainCRTStartup
5>Release\hs071_cpp.exe : fatal error LNK1120: 4 unresolved externals
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========
Is there anyone who can kindly tell me how should I deal with it?
Thank you very much for your attention, and I’m looking forward to your kind aid.
Finally, I've solved this problem which is due to the undefined functions. I think my case is about a released software package rather than some specific procedure code, hence, it's a little different and relative simple.
Without knowing the specifics of the libraries you are using, I recommend that you try the following to deal with this error:
The error tells you that the linker is missing code for some function calls. This probably means that a library file is not found. Make sure that the linker can find all needed lib files. Check the property pages. Under the Linker->General->Additional library directories, make sure that the directories where your lib-files are located are present and under Linker->Input->Additional dependencies, make sure that the the lib-files are listed. Also make sure that the parameters are present for the different Configurations.
If this still does not help, check if your libraries depend on other libraries. These should be mentioned in the documentation of the libraries you are using.
I've not built this, but here's what I would try from the start. From what you've said, you've compiled the .lib files that it links against and it's failing during linking.
So here are your options...
1) You've either missed a .lib file in the input list for the linker.
2) The actual .lib file doesn't contain the symbol that the linker needs (you can check this by dumping the symbols of the .lib file)
3) Your .lib file is compiled with either the wrong platform than what you're linking with or with the wrong type ie. release/debug.
4) The symbols in your lib are decorated because you're compiling as C++ instead of C, or visa-versa.
If you go through the above steps above, I'm pretty sure you'll find your problem, but you've not really given enough information to properly answer your question. Personally, I'd have a guess that you're compiling C as C++ or you've got the wrong platform type set for one of your lib files.
Thank you all very much for your patient and detailed advices that inspired me, and I finally find out that I should add some C files which define the necessary functions into my project. The detailed solution is as follows.
For example, I want to eliminate
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlr_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlr_
Step 1: Run
f2c iladlr.f
In the Visual Stuido Command Prompt and generate iladlr.c.
Step 2: Add iladlr.c to my project.
Step 3: Rebuild.
Finally, everything goes well.

Errors compling sample source code from open-gltutorial.org

I've tried and tried to compile source from the site listed. Specifically the second one involving a triangle. So here's a list of my lib includes:
opengl32.lib
glfw3.lib
glu32.lib
glfw3dll.lib
glew32.lib
glew32s.lib
freeglut.lib
I'm on windows 7 x64, IDE is VS2010 express C++ registered, all my includes and libs are for x86, here are my errors. I did get CMake to make the project files for me and then I got the tutorials to build too.
1>glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__TrackMouseEvent#4
1>glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__TranslateMessage#4
1>glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__DispatchMessageW#4
1>glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__PeekMessageW#20
1>glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__GetMessageTime#0
There's like 50 more like that too. They all start with the glfw3.lib too. Makes me think I didn't have the right library files there but I've tried every lib file I've got, tried the binarys prebuilt for windows and everything. The includes for the project file from the tutorial websites are as follows:
// these are already included by VS 2010.
kernel32.lib //
user32.lib//
gdi32.lib//
winspool.lib//
shell32.lib//
ole32.lib//
oleaut32.lib//
uuid.lib//
comdlg32.lib//
advapi32.lib//
glu32.lib
opengl32.lib
external\glfw-3.0.3\src\Release\glfw3.lib
external\Release\GLEW_190.lib

Unresolved external symbols in C++ project

This is my situation (I am very new to C++ MFC coding and I am trying to debug an existing application project)
I use this line in my code (in a visual studio 2012 MFC project)
CoCreateInstance(CLSID_PortableDeviceValues, NULL,
CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&x));
While I run the project, i get a linker error like this
error LNK2001: unresolved external symbol _CLSID_PortableDeviceValues
This happens for all the CLSID values that I am referring to in the code. Like this
error LNK2001: unresolved external symbol
_CLSID_PortableDeviceKeyCollection
error LNK2001: unresolved external symbol _IID_IPortableDeviceEventCallback
error LNK2001: unresolved external symbol _CLSID_PortableDeviceManager
error LNK2001: unresolved external symbol _CLSID_PortableDeviceServiceFTM
I checked for the declaration of "CLSID_PortableDeviceValues" and it was found in "PortableDeviceTypes.h" and I have imported that library as well.
I do not get any compiler error, but run into the linker errors mentioned above..
Can someone please help me out here. I could not resolve this ..
You will need to add PortableDeviceGUIDs.lib to your project.
(Look up the section "Requirements" in the MSDN documentation for IPortableDeviceValues)
When the linker builds your project, it is looking for the implementation data that is behind the identifier CLSID_PortableDeviceValues. This data is in the library PortableDeviceGUIDs.lib, and the linker has to be told to use this library.
The header file you included in your source code only declares the symbol "CLSID_PortableDeviceValues", without importing its implementation.

'LIBCMT' conflicts with use of other libs + unresolved external symbols

I have a program using OpenGL 3.2(+libs) and FreeType2. Then an other program with Boost and OpenSSL. The OpenGL side was to make sure text could be rendered and the boost/openssl program is to do a secure login/game server.
Both programs work fine by them selfs.
However adding Boost and OpenSSL to the game(GL + freetype) project caused it to fail to link.
I have linked the following libs as well as including there includes folder.
glimg.lib
glutil.lib
glfw.lib
opengl32.lib
freetype.lib
glew32.lib
user32.lib
libeay32.lib
ssleay32.lib
The linker error is.
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol __imp__DeregisterEventSource#4
1>libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol __imp__ReportEventA#36
1>libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol __imp__RegisterEventSourceA#8
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__DeleteDC#4
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__DeleteObject#4
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__GetBitmapBits#12
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__BitBlt#36
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__GetObjectA#12
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__SelectObject#8
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__CreateCompatibleBitmap#12
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__GetDeviceCaps#8
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__CreateCompatibleDC#4
1>libeay32.lib(rand_win.obj) : error LNK2001: unresolved external symbol __imp__CreateDCA#16
1>.\BasicTexture.exe : fatal error LNK1120: 13 unresolved externals
Runtime Library is set to Multi-threaded DLL (/MD)
I have no idea what to do I would really appreciate any help.
You are trying to compile with /MD, which is probably the right choice, but some code (probably one of the libraries) was built with /MT, and you can't have it both ways in the same program. You need to figure out which library was built with /MT and rebuild it with /MD.
Unresolved external error messages are produced when the compiler generates code referencing externally defined objects or functions and the linker fails to find those. To generate code invoking a function call the compiler only needs a declaration:
extern "C" BOOL DeregisterEventSource ( HANDLE hEventLog );
This is enough information to produce a call instruction (except for the target address). The extern keyword informs the compiler that the implementation is defined elsewhere. Consequently it cannot know the target address which has to be filled in later. When the compiler is done it is the linker's job to connect the pieces together. It uses the information gathered from the import libraries to look up the required offsets.
Windows API calls are easily spotted in the error log. They have an __imp__ prefix and sometimes an A or W postfix followed by #<n> where <n> indicates the number of bytes required for the arguments. In the case of a Windows API call you can then look up the function in the MSDN (like DeregisterEventSource). Towards the bottom are the Requirements where you can find the import library name.
The conflict warning indicates that not all of the modules use the same runtime library. Even though this is just a warning it is a serious issue and should be resolved. You get this warning if you mix /MD and /MT compiler switches, but also, if you mix release and debug runtime libraries (like /MD and /MDd). To diagnose this message you can use the /VERBOSE:LIB linker switch to determine which libraries the linker is searching. Additional information on this warning can be found at this MSDN link.

OpenGL compiling issues

I am using Visual Studio C++ and GLEW. The Project Settings are all set (Includes/Libs).
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewUseProgramObjectARB
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewLinkProgramARB
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewAttachObjectARB
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewCompileShader
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewShaderSource
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewCreateShader
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewCreateProgramObjectARB
These are the only Messages I get. Everything worked fine until I tried to implement a Shader.
The Problem is I am working within a VM, so my question is: Does GLEW need opengl32.lib as a dependency? Because if I dont add the opengl32.lib to the Linker I get even more errors. And if so could the Problem be caused by the opengl32.lib? Because I think the opengl32.lib is the standard windows opengl32.lib, that would mean it's only opengl 1.1, and therefor it can't link...
So what is the issue about these errors?
Make sure to #define GLEW_STATIC in the project before including GLEW in Windows. Then you can just include the entire source code in your project files. Otherwise, you need to have the proper GLEW DLL file in with your executable.