How to hide the linker warning start with AL (ALINK) - c++

I got this warning while compiling the VC++ project.
1>ALINK : warning AL1073: Referenced assembly 'mscorlib.dll' targets a different processor
I think it is safe to hide this in my situation (concluded). How to ignore the linking ALINK errors.
/ignore:1073 or /ignore:AL1073 doesn't work. It gives me this error
1>LINK : fatal error LNK1147: invalid number specified with option '/ignore:1073'

Related

Error compiling Google Protocol Buffer Output (C++)

Update #2: Issue closed, but curious about all the error messages.
I got it to compile after including #define PROTOBUF_USE_DLLS. After the build, the Error List still shows 398 errors and the output window lists a lot of warnings, but it still compiled. Why is that?
I downloaded the Google Protocol Buffer source and was able to compile it without issues on Visual Studio 2015. However, the Google Protocol Buffer compiler generates C++ output that has a lot of compile errors. Is the compiler output below compatible with Visual Studio 2015 (C++14, I think)? Looks like a later standard of C++. If it's not, does anyone familiar with Google Protocol Buffer for C++ know how to make it output VS2015-friendly output? I downloaded from here: https://github.com/protocolbuffers/protobuf/releases
Update: Here's the compiler output:
1> Creating library C:\DEV\Visual Studio 2015\Projects\DEV\VSSolution\x64\Debug\Monitor.lib and object C:\DEV\Visual Studio 2015\Projects\DEV\VSSolution\x64\Debug\Monitor.exp
1>msgcore.pb.obj : error LNK2001: unresolved external symbol "class google::protobuf::internal::ExplicitlyConstructed<class std::basic_string<char,struct std::char_traits,class std::allocator >,8> google::protobuf::internal::fixed_address_empty_string" (?fixed_address_empty_string#internal#protobuf#google##3V?$ExplicitlyConstructed#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##$07#123#A)
1>C:\DEV\Visual Studio 2015\Projects\DEV\VSSolution\x64\Debug\Monitor.dll : fatal error LNK1120: 1 unresolved externals
Strange, I see 510 compiler errors under the Error List tab of Visual Studio, but under the compiler output, I only see the one unresolved externals error above. That's a linking error implying that it already compiled? How come I don't see the compiler errors high-lighted in the screenshot below and on the Error List in the Output window?
The errors turned out to be Visual Studio Intellisense errors and not "actual" compile errors. For the one linking error, the issue was resolved by adding #define PROTOBUF_USE_DLLS to the protoc-generated C++ output.

How can I fix "error LNK2019: libifcoremdd.lib(for_main.obj)" in intel visual Fortran

I tried to use a library about date time conversion in this website. However, when compiling it, errors occur:
ERROR 1 error LNK2019: mod_datetime.obj
ERROR 2 error LNK2019: libifcoremdd.lib(for_main.obj)
ERROR 3 fatal error LNK1120: 2 x64\Debug\datetime.exe
There are some similar questions (this or this), but they seems not about this "libifcoremdd.lib" problem. I find libifcoremdd.lib in my computer(C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32 and C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\intel64), why the link process failed?
Expanding on a comment I gave above - the quoted error text omits crucial pieces of information, that being the names of the symbols the linker was unable to find. (LNK2019 is "unresolved reference"). While it's unclear what ERROR 1 is referring to, ERROR 2 is due to your taking the library sources and building them in an executable project type. This causes the linker to look for a symbol _MAIN__ (for 32-bit) that is the Fortran main program. If there is none, then you'll get a LNK2019 error naming for_main.obj in the Intel Fortran run-time library.
The solution is to create a new project in Visual Studio of the "Fortran Static Library" type, so that a main program is not expected.

Error C4996 on using boost example

I have installed Boost 1.58.0 following their instructions and the examples they give in the installation guide work fine using VS2012. I also have OpenCV3.0.0 included in my properties. I want to check out an example of some graphing functions, so I copied this code: http://www.boost.org/doc/libs/1_58_0/libs/graph/example/astar_maze.cpp , and included stdafx.h on the top.
When compiling, I get
error C4996: 'std::_Fill_n': Function call with parameters that may be unsafe
Other people suggest either using
#pragma warning( disable : 4996 )
which doesn't seem to change anything, or turning off SDL checks via properties, which turns the error into a warning, but gives me many more errors, mostly LNK2005.
Any ideas how to get the code running?
Additional info:
Types of error when turning off SDL checks are (my project is BoostExample):
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in BoostExample.obj
error LNK2005: "public: __thiscall std::_Container_base12::_Container_base12(void)" (??0_Container_base12#std##QAE#XZ) already defined in opencv_ts300d.lib(ts_perf.obj)
error LNK2005: ___crtSetUnhandledExceptionFilter already defined in MSVCRTD.lib(MSVCR110D.dll)
and finally
fatal error LNK1169: one or more multiply defined symbols found
I guess this means that Boost is interacting with OpenCV and other DLLs by redefining something. Is it possible that I installed the wrong boost version? I just grabbed the main one.
The linker error tells basically the boost and the OpenCV were compiled off using different runtime settings, one for static lib and the other for DLL, and cannot be mixed used. you need to rebuild your boost and OpenCV to use same runtime setting.

Linker errors (LNK2001) when library compiles fine

I am trying to compile a small 2D engine I am working on. So far this has gone well, but ever since I included GLEW (as I wanted to start working on some fragment shaders) the test program refuses to build. To clarify, I build the engine as a static library (Mage2D.lib), and then build a test program that uses the library.
This is the error I am getting:
1>Link:
1> libpng15.lib(pngget.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Mage2D_D.lib(root.obj) : error LNK2001: unresolved external symbol __imp__glewIsSupported#4
1>Mage2D_D.lib(root.obj) : error LNK2001: unresolved external symbol __imp__glewInit#0
1>C:\Users\Jesse\Documents\Visual Studio 2010\Projects\Rose\Debug\MageTest.exe : fatal error LNK1120: 2 unresolved externals
1>
1>Build FAILED.
Now normally I realize this means I'm not including the right library into my test program (glew32.lib). But that's impossibly the case here, as I build glew.c into Mage2D.lib. GLEW is literally part of the source code of Mage2D as it seemed convenient to do that with a program that is four files and integral part of the engine anyway.
I followed GLEW's instructions on their website to the letter on how to build GLEW and include it into my project, but I keep getting this error.
What the hell is going on?
I've checked glew.h and I'm quite sure you need to add GLEW_STATIC define just before including glew.h:
#define GLEW_STATIC
#include "GL/glew.h"

Internal linker error using comsupp.lib

I've searched around here and a few other sites and still the linker error I'm having doesn't seem to be in there or my reading comprehension is failing me today.
The errors VS2010 is giving me are as follows:
Error 10 error LNK2001: unresolved external symbol "void __stdcall
_com_issue_error(long)" (?_com_issue_error##$$FYGXJ#Z)
Error 11 error LNK1120: 1 unresolved externals
I cannot seem to find anywhere what function is missing its external so I know what I should be importing or at the very least including in the linker so debugging it is proving a little hard.
Didn't even think to add this, but when I try and add comsupp to my linker I get the following errors (also my link.exe actually crashes and asks me if I want to send a debug report to Microsoft):
Error 15 error C1001: An internal error has occurred in the compiler.
Error 16 error LNK1000: Internal error during IMAGE::BuildImage
Do include comdef.h, but don't include comutil.h
Project Property ->Linker -> Input ->Additional Dependencies.
Add comsuppd.lib (or comsuppwd.lib) if it's debug mode.
Add comsupp.lib (or comsuppw.lib) if it's release mode.