Hi All,
Thanks to everyone who has helped me with winelib, so far most things are going really well! However here is an issue I cant solve - iostream and msvcrt. Here is an example file:
// test.cpp module #include <process.h> #include <iostream>
int test() { return 1; }
If I compile it using:
wineg++ -c -mno-cygwin -I/usr/local/include/wine/msvcrt -o test.o test.cpp
or
wineg++ -c -I/usr/local/include/wine/msvcrt -o test.o test.cpp
I get a multitude of errors such as:
In file included from /usr/include/c++/3.3.2/iosfwd:46, from /usr/include/c++/3.3.2/ios:44, from /usr/include/c++/3.3.2/ostream:45, from /usr/include/c++/3.3.2/iostream:45, from test.cpp:2: /usr/include/c++/3.3.2/i386-redhat-linux/bits/c++locale.h:53: error: `uselocale' was not declared in this scope In file included from /usr/include/c++/3.3.2/i386-redhat-linux/bits/c++io.h:35, from /usr/include/c++/3.3.2/bits/fpos.h:44, from /usr/include/c++/3.3.2/iosfwd:49, from /usr/include/c++/3.3.2/ios:44, from /usr/include/c++/3.3.2/ostream:45, from /usr/include/c++/3.3.2/iostream:45, from test.cpp:2: /usr/include/c++/3.3.2/cstdio:167: error: `snprintf' not declared /usr/include/c++/3.3.2/cstdio:168: error: `vfscanf' not declared /usr/include/c++/3.3.2/cstdio:169: error: `vscanf' not declared /usr/include/c++/3.3.2/cstdio:171: error: `vsscanf' not declared
So whats my newbie mistake?
thanks,
Scott.
Using gcc's c++ libraries will not work with msvcrt. If it will compile (which it doesn't) it will not load. (Some circular linking) Your best bet is STLPort. Check it out. What I have done is a special makefiles set with special config.h that compiles and links STLPort over msvcrt. I have written to STLPort if they want my changes as support for another platform but I never got a response from them. Do you need me to dig out the old HD and pack you an STLPort compiled over msvcrt? You might need to make some changes because it is from before winegcc times,. Going strait for gcc. and maybe some wine stuff changed since than.
Scott Snell wrote:
Hi All,
Thanks to everyone who has helped me with winelib, so far most things are going really well! However here is an issue I cant solve - iostream and msvcrt. Here is an example file:
// test.cpp module #include <process.h> #include <iostream>
int test() { return 1; }
If I compile it using:
wineg++ -c -mno-cygwin -I/usr/local/include/wine/msvcrt -o test.o test.cpp
or
wineg++ -c -I/usr/local/include/wine/msvcrt -o test.o test.cpp
I get a multitude of errors such as:
In file included from /usr/include/c++/3.3.2/iosfwd:46, from /usr/include/c++/3.3.2/ios:44, from /usr/include/c++/3.3.2/ostream:45, from /usr/include/c++/3.3.2/iostream:45, from test.cpp:2: /usr/include/c++/3.3.2/i386-redhat-linux/bits/c++locale.h:53: error: `uselocale' was not declared in this scope In file included from /usr/include/c++/3.3.2/i386-redhat-linux/bits/c++io.h:35, from /usr/include/c++/3.3.2/bits/fpos.h:44, from /usr/include/c++/3.3.2/iosfwd:49, from /usr/include/c++/3.3.2/ios:44, from /usr/include/c++/3.3.2/ostream:45, from /usr/include/c++/3.3.2/iostream:45, from test.cpp:2: /usr/include/c++/3.3.2/cstdio:167: error: `snprintf' not declared /usr/include/c++/3.3.2/cstdio:168: error: `vfscanf' not declared /usr/include/c++/3.3.2/cstdio:169: error: `vscanf' not declared /usr/include/c++/3.3.2/cstdio:171: error: `vsscanf' not declared
So whats my newbie mistake?
thanks,
Scott.
Scott Snell wrote:
Hi All,
Thanks to everyone who has helped me with winelib, so far most things are going really well! However here is an issue I cant solve - iostream and msvcrt. Here is an example file:
Why are you trying to use G++ with the MSVCRT (Microsoft Visual C++ runtime) ? That can surely never work: even if the headers were compatible, the ABI used is not.
Mike Hearn wrote:
Why are you trying to use G++ with the MSVCRT (Microsoft Visual C++ runtime) ? That can surely never work: even if the headers were compatible, the ABI used is not.
He meant in a winelib when a winelib links against msvcrt (-nocygwin on the winegcc command line). Only the C symbols and a few C++ (new & delete) are exported from wine's msvcrt.spec so only these get linked. The rest of the C++ symbols are looked for else where. His current problem, though, is Header compatibility. When you don't use "-nocygwin" than lots of Windows originating code (like MFC) does not compile.
Free Life Boaz