What are the -l options I should be using to assure I am using the Wine Staging 2.10 versions of the standard system libraries?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Jun 28 16:28:29 CDT 2017


In the past (in the Wine 1.6 era) I used an old snapshot (4.7.2) of
MinGW/MSYS on wine to build applications with success, and I would
like to stick with that snapshot for Wine Staging 2.10 since I
have found in the past later versions of MinGW/MSYS were not as reliable
as 4.7.2.

However, since that snapshot was initially installed with Wine 1.6 (or
maybe even earlier) I assume its default header locations and library locations
refer to some old wine version, and the general question is how do I override those to refer to
the equivalent Wine Staging 2.10 locations.

I have a simple test programme (attached) that illustrates the problem:

bash.exe-3.1$ g++ /z/home/wine/wine_staging/test_rand_s.cxx
z:/home/wine/wine_staging/test_rand_s.cxx: In function 'int main()':
z:/home/wine/wine_staging/test_rand_s.cxx:18:5: error: 'errno_t' was not declared in this scope
z:/home/wine/wine_staging/test_rand_s.cxx:18:21: error: expected ';' before 'err'
z:/home/wine/wine_staging/test_rand_s.cxx:23:9: error: 'err' was not declared in this scope
z:/home/wine/wine_staging/test_rand_s.cxx:23:31: error: 'rand_s' was not declared in this scope
z:/home/wine/wine_staging/test_rand_s.cxx:26:53: error: 'printf_s' was not declared in this scope
z:/home/wine/wine_staging/test_rand_s.cxx:29:60: error: 'printf_s' was not declared in this scope
z:/home/wine/wine_staging/test_rand_s.cxx:32:18: error: 'printf_s' was not declared in this scope
z:/home/wine/wine_staging/test_rand_s.cxx:37:9: error: 'err' was not declared in this scope
z:/home/wine/wine_staging/test_rand_s.cxx:37:31: error: 'rand_s' was not declared in this scope

(I presume those errors are due to those functions not being defined
by Wine way back when).  That compile issue is solved as follows:

bash.exe-3.1$ g++ /z/home/wine/wine_staging/test_rand_s.cxx -I/z/opt/wine-staging/include/wine/msvcrt -I/z/opt/wine-staging/in
clude/wine/windows 
C:\users\wine\Temp\cckTYgsp.o:test_rand_s.cxx:(.text+0x35): undefined reference to `rand_s'
C:\users\wine\Temp\cckTYgsp.o:test_rand_s.cxx:(.text+0x4c): undefined reference to `printf_s'
C:\users\wine\Temp\cckTYgsp.o:test_rand_s.cxx:(.text+0xa6): undefined reference to `printf_s'
C:\users\wine\Temp\cckTYgsp.o:test_rand_s.cxx:(.text+0xc6): undefined reference to `printf_s'
C:\users\wine\Temp\cckTYgsp.o:test_rand_s.cxx:(.text+0xdc): undefined reference to `rand_s'
C:\users\wine\Temp\cckTYgsp.o:test_rand_s.cxx:(.text+0xf3): undefined reference to `printf_s'
C:\users\wine\Temp\cckTYgsp.o:test_rand_s.cxx:(.text+0x124): undefined reference to `printf_s'
z:/home/wine/wine_staging/mingw-4.7.2/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: C:\users\wine\Temp\cckTYgsp
.o: bad reloc address 0x13 in section `.eh_frame'
z:/home/wine/wine_staging/mingw-4.7.2/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: final link failed: Invalid
operation
collect2.exe: error: ld returned 1 exit status

However, that compile fix obviously leaves the above link issue which I attempted to solve
by appending the options -L/z/opt/wine-staging/lib/wine -lmsvcrt
which worked (in the sense that that library was found) but apparently
that particular library does not implement rand_s and printf_s since the
same link errors occurred as above.

So what are the -l options I should be using to assure I am using the Wine
Staging 2.10 versions of the standard system libraries?

N.B. I realize this issue would likely be taken care of automatically
if I installed the latest version of MinGW/MSYS on the Wine Staging
2.10 platform.  But I have my reasons explained above why I would
prefer to use the 4.7.2 snapshot of MinGW/MSYS instead.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_rand_s.cxx
Type: text/x-c++src
Size: 1242 bytes
Desc: Test code demonstrating compile and link issues
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20170628/f611170a/attachment-0001.cxx>


More information about the wine-devel mailing list