unresolved external symbol error when use ICE in Visual Studio - ice

I used ICE(www.zeroc.com/ice.html) in visual studio 2010, had already included the "include" and "lib" directories, however failed to build the project.
errors like these:
error LNK2019: unresolved external symbol.
fatal error LNK1120: 111 unresolved externals.
Any suggestions and help?

Related

error LNK2019: unresolved external symbol static library

I'm trying to link my C++ VS 2015 executable with tbarcode library 8. This library consists of header files, a lib file, and a dll file.
I keep on getting errors LNK 2019, for example LNK2019: unresolved external symbol __imp_BCAlloc
I'm building in debug mode, I've added the lib to "Additional Depdencies" settings, its directory to "Additional Library Directories" and the path to the directory of the dll to the PATH environment variable.
Here are the results of dumpbin *which shows mangled names):
dumpbin /all TBarCode8.lib | findstr /c:"BCAlloc"
B8B2 _BCAlloc#4
B8B2 __imp__BCAlloc#4
7 _BCAlloc#4
7 __imp__BCAlloc#4
Symbol name : _BCAlloc#4
Name : BCAlloc
_BCAlloc#4
dumpbin /all TBarCode8.dll | findstr /c:"BCAlloc"
2 0 000247D9 BCAlloc
Questions: What does the suffix #4 mean in the mangled name? And how to solve this error LNK 2019?
I found the solution: the dll of tbarcode I was provided is 32 bit, and I tried building my app in 64 bit. Building my app in 32 bit solved the problem.

Error with G++ while compiling

I got this error when trying to compile a cpp code
c:\mingw\bin>g++ hello.cpp
g++: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found
compilation terminated
what is going wrong?
you have (or the build-system has) specified the flag -fuse-linker-plugin which requires the dynamic library file liblto_plugin-0.dll to be in your library search path, but the linker cannot find it.
btw, you could have discovered that by carefully reading the error message you got.

building mono's System.Configuration project failed with error "ProjectReference corlib-net not found"

I want to make some bugfix in mono.
I have mono installed on my openSuse and download mono source code from github.
Then i want build System.Configuration project with this command:
xbuild System.Configuration-net_4_5.sln
and recieve 31 Errors, most of them like this
error CS0518: The predefined type 'System.Object' is not defined or imported
Also i recieve following warning:
warning : ProjectReference '..\corlib\corlib-net_4_5.csproj' not found, neither by guid 'some guid' nor by project file name 'path to project'
This project does exist in this location.
What's wrong?
Thanks.
You have to make the code change and then recompile the whole Mono following the instructions on how to compile Mono from source code. You cannot build individual projects, as the referenced projects cannot be resolved by 'xbuild' correctly.

Linking lots of .libs to make a DLL: unresolved external symbol _DllMainCRTStartup

I'm performing the (terrifying) task of building LLVM 3.3 on windows and I have got to the stage where I have a load of LLVM*.lib files. I want to link them together to one huge shared DLL but am struggling (this is my first time linking stuff on windows). I've tried:
link /DLL /MACHINE:X64 /OUT:LLVM3.3.dll LLVM*.lib
but to no avail. It errors with:
LINK : warning LNK4001: no object files specified; libraries used
LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup
LLVM3.3.dll : fatal error LNK1120: 1 unresolved externals
The internet suggested adding the /DEFAULTLIB:corelib switch, so I did that but again it has problems:
> link /DLL /MACHINE:X64 /DEFAULTLIB:corelibc /OUT:LLVM3.3.dll LLVM*.lib
LINK : warning LNK4001: no object files specified; libraries used
LINK : fatal error LNK1104: cannot open file 'corelibc.lib'
How do I do this?
EDIT: I managed to fix the above problem, by implementing an empty DllMain and making an EmptyDllMain.obj from it:
#include <windows.h>
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
and then trying:
link /DLL /OUT:LLVM3.3.dll LLVM*.lib EmptyDllMain.obj
but the DLL I get out is just 8kb - it seems to have missed out the many megabytes of LLVM libraries! How do I get them included?
EDIT2: I solved the LLVM compilation on Windows problem, take a look at this document on github.
I had this once while linking one lib with a wrong platform set together (X86 to X64). Make sure all the LLVM*.lib are build and linked with the correct toolchain:
[...]\Microsoft visual Studio 10.0\VC\bin\amd64\ cl.exe and link.exe
which you get by calling
"%PROGRAMFILES(X86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
Also I had similar problems when mixing MT and MD CRTs, I recommend you stick to
/MD (or /MDd for debug)
when compiling the objects for any of the LLVM*.lib (and any other objects from other external libraries you link into these).
[edit]
And kick out that ugly EmptyDllMain.obj !
[/edit]
If you manually entered the _DllMainCRTStartup, be sure you spelled it (watch case) correctly. I had _DLLMainCRTStartup and took a while to catch why I still received the linker error. For Windows CE, the required link lib is corelibc.lib.
remove lib files from "ignore specific default libraries" from "Linker->Input" on project properties

CMake was unable to find a build program corresponding to "Visual Studio 11 Win64"

I get with CMake 2.8.9 the following error:
CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 11 Win64". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Could not find cmake module file:H:/ogredeps/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Could not find cmake module file:H:/ogredeps/CMakeFiles/CMakeCXXCompiler.cmake
Configuring incomplete, errors occurred!
I am using Visual C++ 2012 Express on Windows 7 64.
What am I doing wrong?
I think you are facing this bug: http://www.cmake.org/Bug/view.php?id=13348
You might have a luck with CMake 2.8.10-RC1