#4 paperbak.h can not compile on GCC

Closed
opened 3 years ago by scuti · 2 comments
scuti commented 3 years ago

Has defines from windows and some others.

Without windows.h

paperbak.h:39:8: error: unknown type name ‘HINSTANCE’
 unique HINSTANCE hinst;                // Application's instance
        ^
paperbak.h:40:8: error: unknown type name ‘HWND’
 unique HWND      hwmain;               // Handle of the main window
        ^
paperbak.h:63:11: error: missing binary operator before token "("
 #if sizeof(t_data)!=128
           ^
paperbak.h:78:3: error: unknown type name ‘FILETIME’
   FILETIME       modified;             // Time of last file modification
   ^
paperbak.h:85:11: error: missing binary operator before token "("
 #if sizeof(t_superdata)!=sizeof(t_data)
           ^
paperbak.h:102:3: error: unknown type name ‘FILETIME’
   FILETIME       modified;             // Time of last file modification
   ^
paperbak.h:130:25: error: ‘MAXPATH’ undeclared here (not in a function)
   char           infile[MAXPATH];      // Name of input file
                         ^
paperbak.h:132:3: error: unknown type name ‘HANDLE’
   HANDLE         hfile;                // Handle of input file
   ^
paperbak.h:133:3: error: unknown type name ‘FILETIME’
   FILETIME       modified;             // Time of last file modification
   ^
paperbak.h:148:3: error: unknown type name ‘bz_stream’
   bz_stream      bzstream;             // Compression control structure
   ^
paperbak.h:151:3: error: unknown type name ‘HDC’
   HDC            dc;                   // Printer device context
   ^
paperbak.h:158:3: error: unknown type name ‘HFONT’
   HFONT          hfont6;               // Font 1/6 inch high
   ^
paperbak.h:159:3: error: unknown type name ‘HFONT’
   HFONT          hfont10;              // Font 1/10 inch high
   ^
paperbak.h:171:3: error: unknown type name ‘HBITMAP’
   HBITMAP        hbmp;                 // Handle of memory bitmap
   ^
paperbak.h:174:29: error: ‘BITMAPINFO’ undeclared here (not in a function)
   uchar          bmi[sizeof(BITMAPINFO)+256*sizeof(RGBQUAD)]; // Bitmap info
                             ^
paperbak.h:174:52: error: ‘RGBQUAD’ undeclared here (not in a function)
   uchar          bmi[sizeof(BITMAPINFO)+256*sizeof(RGBQUAD)]; // Bitmap info
                                                    ^
paperbak.h:179:8: error: unknown type name ‘PAGESETUPDLG’
 unique PAGESETUPDLG pagesetup;         // Structure with printer page settings
        ^
paperbak.h:256:3: error: unknown type name ‘FILETIME’
   FILETIME       modified;             // Time of last file modification
   ^
paperbak.h:301:27: error: unknown type name ‘MSG’
 int    PassmessagetoTWAIN(MSG *msg);
                           ^
paperbak.h:325:8: error: unknown type name ‘HBRUSH’
 unique HBRUSH    graybrush;            // Button face brush (usually gray)
        ^
paperbak.h:336:29: error: unknown type name ‘WPARAM’
 int    Changeblockselection(WPARAM wp);
                             ^
paperbak.h:344:23: error: unknown type name ‘FILETIME’
 int    Filetimetotext(FILETIME *fttime,char *s,int n);

With windows.h

paperbak.h:65:11: error: missing binary operator before token "("
#if sizeof(t_data)!=128
       ^
paperbak.h:87:11: error: missing binary operator before token "("
#if sizeof(t_superdata)!=sizeof(t_data)
       ^
paperbak.h:132:25: error: ‘MAXPATH’ undeclared here (not in a function)
char           infile[MAXPATH];      // Name of input file
                     ^
paperbak.h:150:3: error: unknown type name ‘bz_stream’
bz_stream      bzstream;             // Compression control structure

Some of these aren’t needed since the GUI will be scrapped. An easy first step will be to address the unknown type errors.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx

Has defines from windows and some others. Without windows.h paperbak.h:39:8: error: unknown type name ‘HINSTANCE’ unique HINSTANCE hinst; // Application's instance ^ paperbak.h:40:8: error: unknown type name ‘HWND’ unique HWND hwmain; // Handle of the main window ^ paperbak.h:63:11: error: missing binary operator before token "(" #if sizeof(t_data)!=128 ^ paperbak.h:78:3: error: unknown type name ‘FILETIME’ FILETIME modified; // Time of last file modification ^ paperbak.h:85:11: error: missing binary operator before token "(" #if sizeof(t_superdata)!=sizeof(t_data) ^ paperbak.h:102:3: error: unknown type name ‘FILETIME’ FILETIME modified; // Time of last file modification ^ paperbak.h:130:25: error: ‘MAXPATH’ undeclared here (not in a function) char infile[MAXPATH]; // Name of input file ^ paperbak.h:132:3: error: unknown type name ‘HANDLE’ HANDLE hfile; // Handle of input file ^ paperbak.h:133:3: error: unknown type name ‘FILETIME’ FILETIME modified; // Time of last file modification ^ paperbak.h:148:3: error: unknown type name ‘bz_stream’ bz_stream bzstream; // Compression control structure ^ paperbak.h:151:3: error: unknown type name ‘HDC’ HDC dc; // Printer device context ^ paperbak.h:158:3: error: unknown type name ‘HFONT’ HFONT hfont6; // Font 1/6 inch high ^ paperbak.h:159:3: error: unknown type name ‘HFONT’ HFONT hfont10; // Font 1/10 inch high ^ paperbak.h:171:3: error: unknown type name ‘HBITMAP’ HBITMAP hbmp; // Handle of memory bitmap ^ paperbak.h:174:29: error: ‘BITMAPINFO’ undeclared here (not in a function) uchar bmi[sizeof(BITMAPINFO)+256*sizeof(RGBQUAD)]; // Bitmap info ^ paperbak.h:174:52: error: ‘RGBQUAD’ undeclared here (not in a function) uchar bmi[sizeof(BITMAPINFO)+256*sizeof(RGBQUAD)]; // Bitmap info ^ paperbak.h:179:8: error: unknown type name ‘PAGESETUPDLG’ unique PAGESETUPDLG pagesetup; // Structure with printer page settings ^ paperbak.h:256:3: error: unknown type name ‘FILETIME’ FILETIME modified; // Time of last file modification ^ paperbak.h:301:27: error: unknown type name ‘MSG’ int PassmessagetoTWAIN(MSG *msg); ^ paperbak.h:325:8: error: unknown type name ‘HBRUSH’ unique HBRUSH graybrush; // Button face brush (usually gray) ^ paperbak.h:336:29: error: unknown type name ‘WPARAM’ int Changeblockselection(WPARAM wp); ^ paperbak.h:344:23: error: unknown type name ‘FILETIME’ int Filetimetotext(FILETIME *fttime,char *s,int n); With windows.h paperbak.h:65:11: error: missing binary operator before token "(" #if sizeof(t_data)!=128 ^ paperbak.h:87:11: error: missing binary operator before token "(" #if sizeof(t_superdata)!=sizeof(t_data) ^ paperbak.h:132:25: error: ‘MAXPATH’ undeclared here (not in a function) char infile[MAXPATH]; // Name of input file ^ paperbak.h:150:3: error: unknown type name ‘bz_stream’ bz_stream bzstream; // Compression control structure Some of these aren't needed since the GUI will be scrapped. An easy first step will be to address the unknown type errors. https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx
scuti added the
bug
label 3 years ago
suhrke commented 3 years ago
Collaborator

We can get a files modified time (time_t) from stat but that’s POSIX only so we still need FILETIME for Windows. We’ll need the preprocessor to get the relevant structs into Global.h, Fileproc.cpp, and probably others.

We can get a files modified time (time_t) from stat but that's POSIX only so we still need FILETIME for Windows. We'll need the preprocessor to get the relevant structs into Global.h, Fileproc.cpp, and probably others.
scuti commented 3 years ago
Owner

This was scrapped entirely and instead each component has its own header.

This was scrapped entirely and instead each component has its own header.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.