i make a static lib(.lib file) without "Precompiled header". and named project_1.
main.cpp
#include<iostream>
using namespace std;
void display(void);
int main()
{
cout<<"test_main\n";
display();
return 0;
}
display.cpp
#include<iostream>
using namespace std;
void display(void)
{
cout<<"display\n";
}
and build this project("win32 release") and copy .lib file to another project and ok. at now i want use this .lib file. at now make project_2.(show below) and know to compiler test.lib with this:
linker->input->Additional Dependencies->test.lib
and copy test.lib file at same folder with main.cpp(path main.cpp and test.lib is same).
main.cpp
//#include<iostream> // ERROR
using namespace std;
void display(void);
int main()
{
display();
return 0;
}
but when write any #include<...>
(example==> #include<iostream>
) at main.cpp, compiler make ERROR.
also, if remove display();
at main.cpp, compiler make Succeeded.
i use VS2012, and other problem, at VC++6 this problem not!.
what i do?
List of ERROR:
error LNK1319: 2 mismatches detected...
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.ob....
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.obj....