Quantcast
Channel: OKWAVE 閲覧数の多い質問(C・C++・C#/250)【本日】
Viewing all articles
Browse latest Browse all 50953

fatal error LNK1120: 外部参照 1 が未解決です

$
0
0
またわからないことが・・・ 教えて下さい。 以下をVC++2005でコンパイルすると、 MSVCRTD.lib(crtexew.obj) : error LNK2019: 未解決の外部シンボル _WinMain@16 が関数 ___tmainCRTStartup で参照されました。 C:\Documents and Settings\tomato\My Documents\Visual Studio 2005\Projects\a\Debug\a.exe : fatal error LNK1120: 外部参照 1 が未解決です。 と警告がでて通りません。 何のことでしょうか。 #include<stdio.h> #include<process.h> struct meibo{   char name[20];   char tel[20];   char address[20]; }; void message( void ); void input( FILE *fp, int cnt , struct meibo *a, int *end ); void main( void ) {   struct meibo a[20];   FILE *fp;   int cnt, end;   if( (fp=fopen( "meibo.dat", "w" ) ) == NULL ){     printf( "Can not open the meibo.dat.\n" );     exit( 1 );   }   message();   fprintf( fp, "番号, 名前, TEL, 住所\n" );   fflush( fp );   cnt = 0;   end = 0;   while( end == 0 ){     input( fp, cnt, &a[cnt], &end );     cnt++;     fflush( fp );     if( cnt == 20 ){       printf( "人数が一杯です.終了します.\n" );       end = 1;     }   }   fclose( fp ); } void message( void ) {   printf( "名前, TEL, 住所, endを入力してください.\n" );   printf( "継続の時はend=0," );   printf( "中止の時は,end=1と入力してください.\n" ); } void input( FILE *fp, int cnt, struct meibo *a, int *end ) {   printf( "名前-->" );   scanf( "%s", a->name );   printf( "TEL -->" );   scanf( "%s", a->tel );   printf( "住所-->" );   scanf( "%s", a->address );   printf( "Exit? Continue:0 Exit:1 -->" );   scanf( "%d", end );   printf( "\n" );   fprintf( fp, "%2d, %s, %s, %s\n",     cnt+1, a->name, a->tel, a->address ); }

Viewing all articles
Browse latest Browse all 50953

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>