[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    What are the -l options I should be using to assure I am using the Wine Staging 2.10 versions of the
From:       "Alan W. Irwin" <irwin () beluga ! phys ! uvic ! ca>
Date:       2017-06-28 21:28:29
Message-ID: alpine.DEB.2.11.1706281353510.14068 () enira ! zlyna ! ubzr
[Download RAW message or body]

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
__________________________


["test_rand_s.cxx" (TEXT/x-c++src)]

// crt_rand_s.c  
// This program illustrates how to generate random  
// integer or floating point numbers in a specified range.  
  
// Remembering to define _CRT_RAND_S prior  
// to inclusion statement.  
#define _CRT_RAND_S  
  
#include <stdlib.h>  
#include <stdio.h>  
#include <limits.h>  
  
int main( void )  
{  
    int             i;  
    unsigned int    number;  
    double          max = 100.0;  
    errno_t         err;  
  
    // Display 10 random integers in the range [ 1,10 ].  
    for( i = 0; i < 10;i++ )  
    {  
        err = rand_s( &number );  
        if (err != 0)  
        {  
            printf_s("The rand_s function failed!\n");  
        }  
        printf_s( "  %u\n", (unsigned int) ((double)number /  
                       ((double) UINT_MAX + 1 ) * 10.0) + 1);  
    }  
  
    printf_s("\n");  
  
    // Display 10 random doubles in [0, max).  
    for (i = 0; i < 10;i++ )  
    {  
        err = rand_s( &number );  
        if (err != 0)  
        {  
            printf_s("The rand_s function failed!\n");  
        }  
        printf_s( "  %g\n", (double) number /   
                          ((double) UINT_MAX + 1) * max );  
    }  
}  


[Attachment #4 (text/plain)]




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic