This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: this simple program doesn't compile :-(


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

open vi, press "G" (shift-G), press "A" (shift-A), press RETURN, press
ESC, press ":", press "w", press "q", press RETURN.

Now you are done, there is missing a newline at the end of the file. (as
the error message tells you.

	HTH
	Alexander

Andre Kirchner wrote:
| Hi,
|
| I'm trying to compile this simple program with the
| command "gcc ./main.c -lpcap"
|
| #include <pcap.h>
| #include <stdio.h>
|
| int main( int argc, char * argv[] )
| {
|   char *dev;
|   char errbuf[ PCAP_ERRBUF_SIZE ];
|
|   dev = pcap_lookupdev( errbuf );
|   if( dev == NULL )
|   {
|    printf( "%s\n", errbuf );
|    exit( 1 );
|   }
|
|   return( 0 );
| }
|
| but it doesn't work and I get the following error
| message "main.c:17:2: warning: no newline at end of
| file"
|
| Does anyone have any idea about what is wrong?
|
| Thanks a lot,
|
| Andre
|
|
|
| __________________________________________________
| Do you Yahoo!?
| Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
| http://mailplus.yahoo.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+KwENdcrm1qkhaakRAig2AJ9wehyM0CKqHe/EvIf+Q2nwMXsxIACfeCWU
LykIrcsiW/w68zRni/xj5Og=
=zIPz
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]