From: Shadow2531 <sha...@tb...> - 2005-12-04 21:34:06
|
Shadow2531 wrote: > Bronek Kozicki wrote: > >> >>> Can anyone give me a pointer as to where to start? >> >> >> >> Here is sequence of commands that I used to build it: >> >> decompress STLport-5.0.0.tar.gz file somewhere >> optionally update MSYS\1.0\etc\fstab to make this location visible for >> MSYS >> start MSYS >> >> cd stlport/build/lib >> make -f gcc.mak depend >> make -f gcc.mak all >> make -f gcc.mak install-release-shared >> make -f gcc.mak install-release-static >> make -f gcc.mak install-dbg-shared >> make -f gcc.mak install-dbg-static >> make -f gcc.mak install-stldbg-static >> make -f gcc.mak install-stldbg-shared > > > Thanks a lot for this. > > I've been trying to build STLport-4.6.2.tar.gz with mingw 3.4.2 on > winXP, so I could have a little unicode support and it just wasn't > working. (millions of compile errors) > > I noticed from your response that you were using 5.0. I couldn't find a > 5.0 version, so I pulled it off of cvs. > > I was successfully able to build 5.0 cvs with your instructions. > > Now here's the problem for example: > > #define _UNICODE > #include <cstdio> > #include <string> > #include <cwchar> > > using namespace std; > > inline wstring generatePath( const wchar_t* p, const wstring& file) { > const wstring s( p ); > if ( s.find(L"/") != wstring::npos) { > return s.substr( 0, s.rfind( L"/" ) ) + L"/" + file; > } else if ( s.find(L"\\") != wstring::npos ) { > return s.substr( 0, s.rfind( L"\\" ) ) + L"\\" + file; > } else { > return file; > } > } > > int wmain(int argc, wchar_t* argv[] ) { > if (argc < 1) { > return 1; > } > const wstring file( generatePath( argv[0], L"file.txt") ); > FILE* out = _wfopen( file.c_str(), L"wb" ); > fwprintf(out, L"%c", 0xFEFF ); > fwprintf(out, L"%s", L"testing 1, 2 ,3" ); > fclose( out ); > } > > That compiles and works fine under vc++ toolkit 2003 and now that I have > stlport setup, I figured it'd work, but it doesn't compile. > > First, it complains about an undefined reference to winmain16. I can get > rid of this error by just using main(), but will unicode still work with > just main()? It doesn't in vc++ tookit 2003. > > Then, there are these 2 errors: > > .text$_ZNK11stlpmtx_std12_String_baseIwNS_9allocatorIwEEE21_M_throw_out_of_rangeEv[stlpmtx_std::_String_base<wchar_t, > stlpmtx_std::allocator<wchar_t> >::_M_throw_out_of_range() > const]+0xe):file.cpp: undefined reference to > `stlpmtx_std::__stl_throw_out_of_range(char const*) > > .text$_ZNK11stlpmtx_std12_String_baseIwNS_9allocatorIwEEE21_M_throw_length_errorEv[stlpmtx_std::_String_base<wchar_t, > stlpmtx_std::allocator<wchar_t> >::_M_throw_length_error() > const]+0xe):file.cpp: undefined reference to > `stlpmtx_std::__stl_throw_length_error(char const*) > > I'm running a command like this: > > g++ -Wall -Wextra file.cpp -o file "-Ipath_to_stlport_directory" > "-Lpath_to_stlport_lib_directory" -lstlport.5.0 > > The stlport directory and libstlport5.0.a must have been found as there > are no warnings that say otherwise. > > Any help would be appreciated. > > Also, with stlport, will wofstream, wifstream, wcout, wcerr, > wostream_iterator etc. work? Does it provide a wifstream version that > accepts a wchar* t for a file? > > Thanks > > Shadow2531 BTW, one thing I did notice was that I don't see any of the libs generated by the build process with static in the filename. After doing all the make commands above, I have: libstlport.5.0.a libstlport.5.0.dll.a libstlportg.5.0.a libstlportg.5.0.dll.a libstlportstlg.5.0.a libstlportstlg.5.0.dll.a libstlport.5.0.dll libstlportg.5.0.dll libstlportstlg.5.0.dll Which one do I use? I don't want to have to included a dll with the program. I assume -lstlport.5.0 is what I should be doing, but I still get the errors. Thanks Shadow2531 |