no headers?

Questions about Wine on Linux
Locked
bburk
Level 2
Level 2
Posts: 11
Joined: Tue Mar 31, 2020 9:36 am

no headers?

Post by bburk »

I had a version of Wine installed previously and it was giving me a development environment that I could use to attempt to port some Windows programs. Various reasons why, but it wasn't going to cut it. Version 6 seems like it might have what I need, so We set back up a linux system (ubuntu 20.04) and have installed winehq-devel as per the faq instructions.

winegcc is present, but when I try to compile my first C file I get an error about including windows.h. If I create one (for giggles) then it complains at no such file for winapifamily.h.

So, either the install didn't give me development headers, or the package/paths/etc isn't pointing to the files I need. I can't find any obvious windows header files on the system. Any pointers??
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: no headers?

Post by jkfloris »

"windows.h" and "winapifamily.h" are available in the package wine-<branch>-dev.
For example: wine-stable-dev
bburk
Level 2
Level 2
Posts: 11
Joined: Tue Mar 31, 2020 9:36 am

Re: no headers?

Post by bburk »

Thanks for taking the time to answer my question.

I needed winehq install for the newer build as the stock ubuntu one was version 5. I installed "sudo apt install --install-recommends winehq-devel"

winehq-devel-dev doesn't exist, nor does winehq-stable-dev. If winehq-devel installs headers I have no idea where. Can I install the ubuntu version 5 dev branch and not get horrible compatibility issues?

I had given up on the precompiled and started trying to compile them myself, and went down a rabbit hole of new things I needed to install, and to compile wine 6.18 I needed to install gcc-mingw. Once I installed mingw, I found windows header files and added that folder to my includes in the makefile, and my project is able to compile now. (actually compiling wine hasn't happened yet... stuck in configuring)

HOWEVER, now I have a new problem... wrc, processing an RC file using windows.h ultimately includes /usr/x86_64-w64-mingw32/include/vadefs.h and wrc spits this error back at me: #error directive: 'VARARGS not implemented for this compiler'

This wasn't the case the last time I tried to use Wine (or last time, the headers were better?) and I'm flummoxed as to how to proceed.. I either need a new wrc or different header files that don't use varargs.

I tried using the include folder I found with the wine source, but it's not finding files. Might be the folder structure isn't what is expected, I don't know.
bburk
Level 2
Level 2
Posts: 11
Joined: Tue Mar 31, 2020 9:36 am

Re: no headers?

Post by bburk »

Barring the WRC issue, I decided to skip past that to linking while I consider the problem.

$(CC) $(ALL_OBJ) -o $(TARGETDIR)/$(TARGETNAME)

All looks good, but just get a generic message about winebuild not being able to create the output file (intermediate file, not final file). Same problem if I do this directly with a single file and don't specify an output directory.

winegcc Debug/WINETEST.o

*sigh* things seemed to have regressed with ease-of-use and documentation.
invisible kid
Level 5
Level 5
Posts: 352
Joined: Tue Dec 24, 2019 3:23 pm

Re: no headers?

Post by invisible kid »

Sometimes I share your frustration. Just a regular user here. If it is all possible to get going with the right repositories and apt-whatever I would do that. If you can't or choose to go the compiling route, I would concentrate on just getting the recommended build process working, the basic configure, make, make install stuff. Feel free to discard, maybe a better answer will come your way. Either way, good luck!
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: no headers?

Post by jkfloris »

winehq-devel-dev doesn't exist, nor does winehq-stable-dev.
That's because the packages are called: wine-stable-dev, wine-devel-dev or wine-staging-dev
You should be able to install the packages with apt or download the desired version directly from:
https://dl.winehq.org/wine-builds/ubunt ... ary-amd64/
bburk
Level 2
Level 2
Posts: 11
Joined: Tue Mar 31, 2020 9:36 am

Re: no headers?

Post by bburk »

Ah.. Thank you. Someone needs to update their web page. When I first installed wine-devel-dev, it came from ubuntu and was only version 5. the wiki's page says to use winehq versions


https://wiki.winehq.org/Ubuntu
Then install one of the following packages:

Stable branch
sudo apt install --install-recommends winehq-stable
Development branch
sudo apt install --install-recommends winehq-devel
Staging branch
sudo apt install --install-recommends winehq-staging

Will have to see if I can force it to download version 6 from winehq or manually download and install the packaged. Looks like I need https://dl.winehq.org/wine-builds/ubunt ... _amd64.deb
bburk
Level 2
Level 2
Posts: 11
Joined: Tue Mar 31, 2020 9:36 am

Re: no headers?

Post by bburk »

Thanks again, jkfloris. Now that winehq is in my repository it looks like wine-devel and wine-devel-dev install and update to 6.18 as I had hoped. Header files work automatically and better (so don't need to path to the
mingw headers" and wrc is not giving me that error any longer... different error, but it's progress!)
bburk
Level 2
Level 2
Posts: 11
Joined: Tue Mar 31, 2020 9:36 am

Re: no headers?

Post by bburk »

So next problems... of the same sort, I think.

wrc and winegcc (which involves winebuild) are giving me permissions errors. Now, winegcc when compiling c files into the same folder has no problem.

It feels like a working directory problem... that the output folder/file isn't relative to the invoking path, but to the executable, or similar.
wrc -foDebug/WINETEST.res WINETEST.RC
Error: Could not open Debug/WINETEST.res.t1MGXW for input : Permission denied
So first, the error seems non-sensical since the .res file is the output, not the input. I've tried explicitly setting the input file by arguement, using --output, etc. I've swapped files names around (and overwrite a file)



Similarly, if I skip the resource and just try to use winegcc to link the object files I have then I get this. I notice that my pathing isn't in the verbose output. That said, my invoking folder should be readable and writable by all users so not sure why that would be a problem either way. One note, is that this folder is on a Samba share from another system /mnt/yadayada if that seems relevant at all. Doesn't seem like it should matter, but I'll throw it out there as another data point.
eps in localsource : make
winegcc -o Debug/winetest.exe -v Debug/WINETEST.o Debug/SERVICE.o Debug/USERCODE.o Debug/CLIENT.o Debug/linux.olnx

/opt/wine-devel/bin/winebuild -v -fno-asynchronous-unwind-tables "--cc-cmd=/usr/bin/gcc -m64" --ld-cmd=/usr/bin/ld -fPIC --exe -o winetest.exe-AyMWLf.spec.o -F winetest.exe --subsystem console -L/opt/wine-devel/bin/../lib64/wine/x86_64-unix -L/opt/wine-devel/bin/../lib64 -- Debug/WINETEST.o Debug/SERVICE.o Debug/USERCODE.o Debug/CLIENT.o /opt/wine-devel/bin/../lib64/wine/x86_64-unix/libadvapi32.def /opt/wine-devel/bin/../lib64/wine/x86_64-unix/libuser32.def /opt/wine-devel/bin/../lib64/wine/x86_64-unix/libwinecrt0.a /opt/wine-devel/bin/../lib64/wine/x86_64-unix/libkernel32.def /opt/wine-devel/bin/../lib64/wine/x86_64-unix/libntdll.def
winebuild: Unable to create output file 'winetest.dC6YXe.s'
winegcc: /opt/wine-devel/bin/winebuild failed
make: *** [Makefile:87: all] Error 2
This seems to be the relevant source code. File doesn't currently exist, so not the first one (errno should be ENOENT) doesn't seem quite right either as this is referencing a .s file, not the final output file which is either an .exe or without extension I've tried both, and even a .o extension.. same results.
case 'o':
{
char *ext = strrchr( optarg, '.' );

if (unlink( optarg ) == -1 && errno != ENOENT)
fatal_error( "Unable to create output file '%s'\n", optarg );
if (ext && !strcmp( ext, ".o" ))
{
output_file_source_name = get_temp_file_name( optarg, ".s" );
if (!(output_file = fopen( output_file_source_name, "w" )))
fatal_error( "Unable to create output file '%s'\n", optarg );
}
else
{
if (!(output_file = fopen( optarg, "w" )))
fatal_error( "Unable to create output file '%s'\n", optarg );
}
output_file_name = xstrdup(optarg);
atexit( cleanup ); /* make sure we remove the output file on exit */
}
break;

Any pointers would be appreciated.
Locked