[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Mystisk parse error, eller ?



Hej Jakob -- jeg har prøvet at genskabe fejlen -- og det lykkedes!

Jakob Goldbach wrote:

> Jeg får en parse error når jeg gcc'er følgende lille program stump.
> Men det virker fint med g++
>
> Er der nogen der kan forklare mig hvorfor ?
>
> #include<arpa/inet.h>
>
> int main()
> {
>   struct sockaddr_in myaddr;
>   myaddr.sin_family = AF_INET;
>
>   int a;
>
>   return(0);
> }

De øvrige svar omkring ANSI C skal jeg ikke kunne tage stilling til men
ved at ændre mime/type fra .c til .cc (f.eks. vha. mv) vil du kunne
compile ovenstående selv via gcc (jeg har ikke dog ikke prøvet med .C)!

Skulle jeg compilere via g++ ville jeg skrive min sourcecode som
ekstern "C" {
#include <arpa/inet.h>
}
ekstern "C++" {
    int main()
    ...
}

Dette virker ikke under gcc.c-mime/type tilgengæld virker det under g++


For at sætte diskussionen i relief: givet C++
burde det endog være være muligt:
extern "Pascal"{
    ...
}
Dette er har jeg dog ikke testet!

Nils Åke Ljunggren
personlig tror jeg dog at extern "Language" på sigt vil blive en del af
extern "C".




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *