Здравствуйте comer, Вы писали:
C>Здравствуйте Corvin, Вы писали:
C>>А в МСДН"е написано про возможность возникновения такого и сказано, что нужно, вроде как выключить инлайнинг, но где и как его выключить ниче не сказано...
C>А как написано? Просто не хочу ковырять MSDN. C>И все таки, надеюсь, что это проблема с проектом, то ли в каком то файле есть что вроде #include "threads.cpp", то ли еще какая нибудь ерунда.
Пишут такое:
Linker Tools Error LNK2001
A project that uses function inlining yet defines the functions in a .CPP file rather than in the header file can cause LNK2001.
или если посмотреть в Function Inlining Problems:
If you are using function inlining make sure that you
Have the inline functions implemented in the header file you are going to include in other files
Have inlining turned ON in the header file.
If you are using the #pragma inline_depth compiler directive, make sure you have a value of 2 or greater set. A value of zero will turn off inlining. Also make sure you are using the /Ob1 or /Ob2 compiler options. These are available in the Project Settings dialog box. (See the "Optimizations" category on the C/C++ tab.)
Mixing inline and non-inline compile options on different modules can sometimes cause problems. If a C++ library is created with function inlining turned on (/Ob1 or /Ob2) but the corresponding header file describing the functions has inlining turned off (no option), you will get error LNK2001. The functions do not get inlined into the code from the header file, but since they are not in the library file there is no address to resolve the reference.
Similarly, a project that uses function inlining yet defines the functions in a .CPP file rather than in the header file will also get error LNK2001. The header file is included everywhere deemed appropriate, but the functions are only inlined when the .CPP file passes through the compiler. Therefore the linker sees the functions as unresolved externals when used in other modules.