PCem on Slackware Linux host

Support and general discussion.
Post Reply
dracolich
Posts: 4
Joined: Fri 19 Jan, 2018 11:11 pm

PCem on Slackware Linux host

Post by dracolich »

Greetings all, this is my first post here. I have been using PCem on Windows hosts since V9, and I love PCem. I would like to share a recent experience I encountered while installing it in Linux and how I worked around it. My primary OS at home is Slackware Linux 14.2 32-bit fully up to date and running kernel 4.14.14, and since the release of PCem 13.1 I decided to finally try building it in Slackware. During the make process I encountered the following error

Code: Select all

<command-line>:0:10: error: conflicting types for 'fseek'
In file included from esdi_at.c:5:0:
/usr/include/stdio.h:749:12: note: previous declaration of 'fseek' was here
 extern int fseek (FILE *__stream, long int __off, int __whence);
            ^
<command-line>:0:10: error: conflicting types for 'ftell'
In file included from esdi_at.c:5:0:
/usr/include/stdio.h:754:17: note: previous declaration of 'ftell' was here
 extern long int ftell (FILE *__stream) __wur;
I searched around these forums and Google and the only place I found that mentions this error is a reddit post, and the solution mentioned there didn't work for me. Investigating on my own I found a line in the Makefile was trying to set fseek and ftell, but they were already set by my system's stdio.h included at the top of esdi_at.c, causing the conflict. The line in Makefile specifically reads

Code: Select all

am__append_15 = -Doff64_t=off_t -Dfopen64=fopen -Dfseeko64=fseek -Dftello64=ftell
I simply commented this line, then did make again and it completed successfully. The resulting pcem binary is working perfectly so far recreating configs using my existing virtual disks. I hope this might help some other Linux users.

Thanks for this great project and keep up the good work. I love the new window launcher window that opens when starting the exe. On a Linux host, is there a way to have a menu bar at the top of the guest machine window, like on a Windows host? Otherwise, how to change floppy and CD images while the guest is running?
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: PCem on Slackware Linux host

Post by SarahWalker »

dracolich wrote: Mon 22 Jan, 2018 7:24 pmI searched around these forums and Google and the only place I found that mentions this error is a reddit post, and the solution mentioned there didn't work for me. Investigating on my own I found a line in the Makefile was trying to set fseek and ftell, but they were already set by my system's stdio.h included at the top of esdi_at.c, causing the conflict. The line in Makefile specifically reads

Code: Select all

am__append_15 = -Doff64_t=off_t -Dfopen64=fopen -Dfseeko64=fseek -Dftello64=ftell
Ah yes, I remember this one. PCem needs to use 64-bit file calls to support >4GB hard drives, and they seem to be implemented differently on some systems. Obviously yours is one of the ones that didn't need this! Glad to hear you got it working.
On a Linux host, is there a way to have a menu bar at the top of the guest machine window, like on a Windows host? Otherwise, how to change floppy and CD images while the guest is running?
No - some combination of GTK, wxWidgets and SDL (I forget which is to blame! Possibly all of them) doesn't allow a proper menu bar on the main window. Linux instead has a popup menu - just right click in the main window when the mouse isn't captured.
dracolich
Posts: 4
Joined: Fri 19 Jan, 2018 11:11 pm

Re: PCem on Slackware Linux host

Post by dracolich »

Thanks for the quick replies, and the great explanations! Cheers!
Post Reply