I am trying to compile PDCurses, but when it attempts to compile pdcscrn.c it gives the error message
../wincon/pdcscrn.c:93:5: error: unknown type name 'PCONSOLE_SCREEN_BUFFER_INFOEX'; did you mean 'PCONSOLE_SCREEN_BUFFER_INFO'?
PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PCONSOLE_SCREEN_BUFFER_INFO
../wincon/pdcscrn.c:95:5: error: unknown type name 'PCONSOLE_SCREEN_BUFFER_INFOEX'; did you mean 'PCONSOLE_SCREEN_BUFFER_INFO'?
PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PCONSOLE_SCREEN_BUFFER_INFO
../wincon/pdcscrn.c:97:8: error: unknown type name 'SetConsoleScreenBufferInfoExFn'
static SetConsoleScreenBufferInfoExFn pSetConsoleScreenBufferInfoEx = NULL;
and there are also a lot more lines, but that is the first part. I am using GCC 8.2.0, and I compiling the wincon directory because I am on windows 10. Thanks.
This is addressed in wincon/README.md:
If your build stops with errors about PCONSOLE_SCREEN_BUFFER_INFOEX,
add the parameter "INFOEX=N" to your make command line and try again.
(This will happen with older compile environments.)
BTW, you should specify the exact toolset you're using, since AFAIK there's no such thing as raw GCC for Windows -- it'll be something like MinGW or Cygwin.
Related
I'm trying to compile an android kernel using clang and I'm getting warnings that I don’t care about. For compilation I use the command make -j3 CC=clang O=output, so I cannot just add the -Wno-everything argument as if I were using the command clang file.c. As I understand it, I can disable some warnings by adding #pragma to the file that causes the error. But also I have one strange error that does not reference any file:
warning: unknown warning option '-Wno-vectorizer-no-neon' [-Wunknown-warning-option]
How can I turn off all warnings? Or at least this one.
PS: Sorry for my English.
The solution was to add the -Wno-everything argument to the ARCH_CPPFLAGS parameter in the Makefile.
I am a beginner and I use Gcc compiler. At least, I used, because it suddenly stopped working giving me this error
cc1: fatal error: cannot open '/c/Users/UTENTE~1/AppData/Local/Temp/cc8t2W16.s' for writing: No such file or directory
where "UTENTE" means "USER" and the .s file changes every time. This result is given to every code I tried to compile, the command was
gcc filename.c
and my OS is Windows. Can anyone help me? Maybe in really simple language, because I am very new...
I am new to C and I am trying to compile a code that uses am external library. Therefore, I am following these steps for linking a library. But at the very first one
gcc -c -Wall -Werror -fpic PICASO_SERIAL_4DLIBRARY.C
I get this
PICASO_SERIAL_4DLIBRARY.C:1:0: error: -fpic ignored for target (all code is position independent) [-Werror]
#include <windows.h>
cc1plus.exe: all warning being treated as errors
additionally undder # there is a arrow above. I tried googling it but I could only find out that this is a Linux problem and not a Windows one (I am developing on Windows now) and the I followed these steps to install gcc. an compiling other small projects work, too.
Anyone any idea, why this doesn't work?
The mention of #include <windows.h> is incidental. That just happens to be the first line of code.
The compiler tries to associate a line of code with the error to help you find the problem. But in this case the code is irrelevant. The error is in the command line and you will get a failure no matter what the code is. But because the compiler is coded to always associate a line of code with an error, it decides, arbitrarily, to point the finger at the first line of code.
Because you use -Werror, warnings are treated as errors. The compiler therefore converts a warning about an ignored option to emit position independent code into an error. The error message states this very clearly:
PICASO_SERIAL_4DLIBRARY.C:1:0: error: -fpic ignored for target (all code is position independent) [-Werror]
I suspect you glazed over when reading the error message, and turned your attention to the line of code that was highlighted. Always read error messages carefully!
To resolve the error, remove the -fpic option from your command line.
Try to compile without -fpic. This flag is inappropriate for the mingw-w64 target.
I am running Linux Mint. When I try to compile a program in C using gpp from command line, I get this output, and my program does not compile.
$ gpp snake.cpp -o snake
features.h:384: warning: Extra argument to #endif ignored
features.h:396: error: #define/#defeval requires an identifier or a single macro call
I'm not sure why I would ever be getting an error for a standard library that I haven't even touched.
Im trying to compile z/lib on z/OS USS(thats right a mainframe). ive got gmake and the c89 compiler (which im assuming is c89 standards compliant) and USS is supposed to be POSIX compliant.
But zlib seems to be tripping up on
struct internal_state FAR *state; /* not visible by applications */
with the following error(s)
c89 -O3 -DUSE_MMAP -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_SOURCE -c -o example.o example.c
ERROR CCN3277 ./zlib.h:92 Syntax error: possible missing ';' or ','?
ERROR CCN3007 ./zlib.h:92 "struct internal_state" is undefined.
ERROR CCN3166 ./zlib.h:103 Definition of function FAR requires parentheses.
ERROR CCN3276 ./zlib.h:103 Syntax error: possible missing '{'?
ERROR CCN3273 ./zlib.h:124 Missing type in declaration of gz_header.
ERROR CCN3166 ./zlib.h:126 Definition of function gz_header requires parentheses.
ERROR CCN3276 ./zlib.h:126 Syntax error: possible missing '{'?
WARNING CCN3137 ./zlib.h:1346 Declaration must declare at least one declarator, tag, or the members of an enumeration.
ERROR CCN3275 ./zlib.h:1350 Unexpected text z encountered.
ERROR CCN3282 ./zlib.h:1350 The type of the parameters must be specified in a prototype.
ERROR CCN3275 ./example.c:95 Unexpected text file encountered.
ERROR CCN3045 ./example.c:95 Undeclared identifier gzFile.
ERROR CCN3046 ./example.c:96 Syntax error.
ERROR CCN3045 ./example.c:98 Undeclared identifier file.
ERROR CCN3019 ./example.c:523 Expecting an array or a pointer to object type.
ERROR CCN3280 ./example.c:527 Function argument assignment between types "const char*" and "int" is not allowed.
CCN0793(I) Compilation failed for file ./example.c. Object file not created.
FSUM3065 The COMPILE step ended with return code 12.
FSUM3017 Could not compile example.c. Correct the errors and try again.
gmake: *** [example.o] Error 3
when i progressively take out the FAR * (i think its a far pointer but im really not that sure) the errors go away. But as this is a library, im not sure what other artifacts are going to be produced by removing this.
has anybody got any ideas?
any old mainframe heads out there?
it turns out there is a previous version of zlib that compiles on USS, version 1.1.4 or close to that. Its a back level, but i presume this works because it is before the implementation of the FAR pointer in the latest code. So atm i think ive got it to work.
thanks for all your help.
Regards
Mark.
FAR is not a C89 keyword, it is a Microsoft/Intelism and is probably #defined somewhere. If not, you need to define it as nothing:
#define FAR
However, this will probably only fix one of many problems. I would guess that the library uses some form of conditional compilation to handle things like FAR pointers - you need to read the docs to find which configuration is most suitabkle for your platform.
I'd use xlc instead of c89 since xlc is your system default compiler but you'll still probably have issues. I'd subscribe to the MVS-OE email list, the people on it are quite helpful. The link to info about the list appears to be down now so send email to
LISTSERV#VM.MARIST.EDU
with the message: INFO MVS-OE
FWIW, IBM provides a prebuilt version of zlib that includes support for the compression hardware (so-called zEDC) available on recent-vintage mainframes. See zlib for zEnterprise Data Compression