Search code examples
c++visual-studioeclipse-cdt

VS 2015 linker error, precompiled headers


I am using eclipse cdt with the visual studio 2015 toolchain. After a lot of tinkering with all the different options and such i have got it almost working with precompiled headers now. In a prebuild step i create the precompiled header from stdafx.cpp and use it in other files. Compiling works well, but when it comes to linking i get the following error: Logger.obj : error LNK2011: precompiled object not linked in; image may not run

Logger.obj is created from Logger.cpp which is one of my own files and gets compiled in the process. I figured its probably because the entire Logger class is a template and there is no real code in Logger.cpp, but even trying to use stuff thats included from stdafx.h does not change this.

Does anyone maybe know what the error actually means? I saw some postings when having several libraries, but in my case its actually one of my own files, not from a library. I would appreciate any hint!


Solution

  • You need to include stdafx.obj in the list of files to link (from my comment).