I downloaded the source code and wanted to compile the file of scanner. It produces this error:
And I tried to use different complier to compile it, but it appeared different errors.
My os is 3.0-ARCH, I don't know why this happened. How do I fix the error?
Eric Leschinski
93.5k4040 gold badges336336 silver badges288288 bronze badges
MeepoMeepo
4 Answers
C90 does not support the boolean data type.
C99 does include it with this include:
M.M
108k1212 gold badges126126 silver badges249249 bronze badges
user978122user978122
2,74566 gold badges2727 silver badges4040 bronze badges
C99 does, if you have
If the compiler does not support C99, you can define it yourself:
(but note that this definition changes ABI for yugr
bool type so linking against external libraries which were compiled with properly defined bool may cause hard-to-diagnose runtime errors).
7,98522 gold badges1717 silver badges4747 bronze badges
ThomasThomas
Somewhere in your code there is a line
#include <string> . This by itself tells you that the program is written in C++. So using g++ is better than gcc .
Avs all products activator. For the missing library: you should look around in the file system if you can find a file called
libl.so . Use the locate command, try /usr/lib , /usr/local/lib , /opt/flex/lib , or use the brute-force find / | grep /libl .
Once you have found the file, you have to add the directory to the compiler command line, for example:
Roland IlligRoland Illig
31.9k1010 gold badges6464 silver badges9393 bronze badges
legoscia
30.6k1111 gold badges8787 silver badges120120 bronze badges
M.HefnyM.Hefny
2,08311 gold badge1717 silver badges1818 bronze badges
Not the answer you're looking for? Browse other questions tagged cgcclex or ask your own question.Join GitHub todayC Unknown Type Name File Online
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking âSign up for GitHubâ, you agree to our terms of service and privacy statement. Weâll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commentscommented Mar 31, 2014
commented Apr 1, 2014
commented Apr 1, 2014
commented Feb 7, 2016
referenced this issue Jun 7, 2016MergedInclude select.h to fix unknown type name 'fd_set' compile error in ae_select (MSYS2) #3303commented Jan 4, 2019
commented Jan 7, 2019
commented May 21, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
I am making a function which is just writes 'hello' to a file. I have put it in a different file and included its header in the program.But gcc is giving an error namely: error: unknown type name âFILEâ.The code is given below
app.c:
write_hello.h:
write_hello.c:
when compiling by gcc the following occurs:
Sorry for any mistakes.I am a beginner.
Harsh DaveHarsh Dave
1 Answer
FILE is defined in stdio.h and you need to include it in each file that uses it. So write_hello.h and write_hello.c should both include it, and write_hello.c should also include write_hello.h (since it implements the function defined in write_hello.h).
Also note that it is standard practice for every header file to define a macro of the same name (IN CAPS), and enclose the entire header between #ifndef, #endif. In C, this prevents a header from getting #included twice. This is known as the 'internal include guard' (with thanks to Story Teller for pointing that out). All system headers such as stdio.h include an internal include guard. All user defined headers should also include an internal include guard as shown in the example below.
write_hello.h
write_hello.c
ScottKScottK
1,10911 gold badge88 silver badges1818 bronze badges
Got a question that you canât ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged cgcc or ask your own question.Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking âSign up for GitHubâ, you agree to our terms of service and privacy statement. Weâll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commentscommented Aug 1, 2014
commented Aug 1, 2014
commented Aug 1, 2014
commented Aug 1, 2014
commented Aug 1, 2014C Unknown Type Name File Search
commented Aug 1, 2014
commented Aug 1, 2014
commented Aug 1, 2014
commented Aug 1, 2014
commented Aug 1, 2014
Unknown Type Name Bool
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |