From: someproblems <oko...@ex...> - 2007-10-28 21:49:26
|
Very good news: a large part of my problems are fixed. As John Brown pointed out: why am I using the D:\ drive? Answer: I'm not. Not knowing the proper g++ syntax, I copied commands off the net from people who were using different drive letters than I am, assuming the usage of the drive letters was part of the commands. It seems ridiculous in retrospect that I didn't realize -- and I did notice, but I just sort of assumed that -ID:\Mingw\etc defaulted to the base drive, then MinGW from there. Looking back, it's imbecilic, but I saw a couple different people using it, I assumed the -I: variant was for GCC only, not MinGW, and the usage stuck. I thought D stood for directory. Ah well. So -ID commands becomes -I and the -LD become -L. I was really hoping that would be the end of it, but there are two further incidents. My current command line, by the way: g++ test.cpp -o test -Wall -mthreads -IC:\STLport\stlport -LC:\STLport\lib -lstlport.5.1 First of all, running test.exe produces this error message box: "This application has failed to start because libstlport.5.1.dll was not found." I managed to fix that by one of two methods: copying libstlport.5.1.dll into the MinGW\bin directory, or by adding C:\STLport\bin to my PATH. According to the INSTALL file, this indicates that I'm using the shared library. Does that mean I have to heft this 600KB DLL file around with every copy of my program? Second incident. Once the DLL has been moved, very very bizarre things happen with wcout. wfstream works fine, cout works fine. But quite simply, what happens is that regardless of where they were sent, wcout messages only show up at the end of the program, just before the return, after everything else but in the order in which they were sent. The first wcout message will have its first character sent in the proper place, but the rest of the message will only appear later. It's crazy. Here's the C++ file. #include <iostream> #include <string> #include <cstdio> using std::cout; using std::wcout; using std::string; using std::wstring; using std::wfstream; using std::ios; int main(int argc, char *argv[]) { cout << "\n1)Initial cout.\n"; cout << ">>"; wcout << L"2)First wcout"; cout << "<<\n"; wstring wstringTest = L"3)First wstring.\n"; wcout << wstringTest; string stringTest = "4)First string.\n"; cout << stringTest; wcout << L"5)Second wcout.\n"; wstring wstringTest2 = L"6)Second wstring.\n"; wcout << wstringTest2; string stringTest2 = "7)Second string.\n"; cout << stringTest2; cout << "......End of program.\n"; getchar(); return 0; } Here's the command line extract (I'm running the program from the command line, so the window won't close after I finish running it; you'll see why in a second). C:\MinGW\bin>g++ test.cpp -o test -Wall -mthreads -IC:\STLport\stlport -LC:\STLport\lib -lstlport.5.1 C:\MinGW\bin>test 1)Initial cout. >>2<< 4)First string. 7)Second string. ......End of program. (I'm typing this from the command line to end getchar().) )First wcout3)First wstring. 5)Second wcout. 6)Second wstring. As you can see, the "2" of the first wcout is flanked by >> << symbols, while the rest of the string appears only later minus the 2. The rest of the wcouts just appear at the end of the program in chronological order. I can only conclude that there's something horribly wrong here. A couple answers to previous questions: John Brown wrote: > > Did you copy-and-paste this command? Not that it really matters, but you > are running g++ in C:\MinGW\bin, but you are adding D:\MinGW\include > and D:\MinGW\lib to your search paths. You asked for 5.1 but it tells you > that it cannot find 5.0. > Yeah, copy and paste. I didn't realize that mistake until after I sent the message. Vincent Torri-2 wrote: > > why did you put test.cpp in the bin dir ? I would put it in the HOME dir. > No reason in particular. As you can see from the latest command line entry, I ended up moving it to the MinGW\bin dir after all. -- View this message in context: http://www.nabble.com/Building-STLport-on-MinGW-tf4699301.html#a13458330 Sent from the MinGW - User mailing list archive at Nabble.com. |