I use codeblocks+mingw32+STLPort510, OS is Win2000. STLPort510 at: C:\STLPort510
My command for compiling STLPort510:
configure -c gcc
mingw32-make -f gcc.mak clean all
mingw32-make -f gcc.mak install
In my codeblocks, I do this: settings-->complier and debugger-->Search directoryis:
"Compiler":add "C:\STLPort510\stlport",
"Linker": add "C:\STLPort510\lib",
"Resource compiler": add "C:\STLPort510\stlport",
and all is before MinGW's directory.
Now, in my project, my code is:
//================================
#include <iostream>
int main()
{
char sz[] = "ab";
std::cout<< sz<< std::endl;
return 0;
}
//================================
but, get errors, :
//===================================================================
//error location, from c:\STLPort510\stlport\stl\file _ios.h
public: // Members from clause 27.4.4.2
basic_ostream<_CharT, _Traits>* tie() const {
return _M_tied_ostream;
}
//===================================================================
:: === Unicode, Debug ===
C:\STLPort5.1.0\stlport\stl\_ios.h:62: undefined reference to `_imp___ZN11stlpmtx_std4coutE'
C:\STLPort5.1.0\stlport\stl\_ios.h:62: undefined reference to `_imp___ZN11stlpmtx_std8ios_base16_M_throw_failureEv'
:: === Build finished: 2 errors, 0 warnings ===
-------------- Build: Debug in Unicode ---------------
mingw32-g++.exe -Wall -g -IC:\STLPort5.1.0\stlport -IC:\MinGW\include -c C:\Temp\CB\Unicode\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\STLPort5.1.0\lib -LC:\MinGW\lib -o .\Unicode.exe obj\Debug\main.o
obj\Debug\main.o: In function `ZNK11stlpmtx_std9basic_iosIcNS_11char_traitsIcEEE3tieEv':
C:/STLPort5.1.0/stlport/stl/_ios.h:62: undefined reference to `_imp___ZN11stlpmtx_std4coutE'
C:/STLPort5.1.0/stlport/stl/_ios.h:62: undefined reference to `_imp___ZN11stlpmtx_std8ios_base16_M_throw_failureEv'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
2 errors, 0 warnings
How I do? Help me.