User forums > Using Code::Blocks

How to use STLPort510 ?

(1/3) > >>

zyd:
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.

zyd:
By the way, STLPort510 need Multithread support, but how to do it in codeblocks ?

stahta01:
I think it is -mthreads added to compiler others options.

Tim S

zyd:
Yeah, I'm successful. 3ku stahta01.

But now, I have new question:
how to output widechar , I mean that like Chinese charactor, not English charactor.
This is my code:
//==========================
#include <iostream>

int main()
{
   std::wcout << L"中国" << std::endl;
   return 0;
}
//==========================
Error info like this:
C:\Temp\CB\Unicode\main.cpp:7: converting to execution character set: Illegal byte sequence
:: === 生成结束: 1个错误, 0个警告 ===

stahta01:
What format is your cpp file in? I suggest UTF-8 as the best one to try at first.
It runs for me in-side of codeblocks but it only displays ab.
I have no idea if this is correct since I have no idea on how to make a dos window display another language.
Tim S

Navigation

[0] Message Index

[#] Next page

Go to full version