Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unexpected end of file found

Status
Not open for further replies.

Jimirillo

Technical User
Joined
Jul 7, 2003
Messages
2
Location
GB
Hi,
I've just started learning Visual c++ 6, and i'm trying to compile a prog to send smtp messages. I've downloaded the code for this, and a few other examples, but they all give various errors. The only one they have in common is the 'unexpected end of file found'. I'm sure its a setting but i cant find anything in my documentation thats relevent. The header that im trying at the moment is :
#pragma once

__gc class CSendEmail
{
public:
CSendEmail(String * Server);
bool SendEmail( String * From,
String * To,
String * Subject,
String * Body);

private:
String * m_sServer;

unsigned char ConvertToChar ( String * str) __gc[];
};

and i'm getting
error C2143: syntax error : missing ';' before '<class-head>'
error C2501: '__gc' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found
fatal error C1021: invalid preprocessor command 'using'

I have checked paths etc and googled for the errors to no avail. Any help would be greatly appreciated.

James.
 
Problem here is __gc - You yse GNU - source. Convert GNU to VC++ is not too easy, better way is - use VC++ code samples from msdn.
&quot;String&quot; is also not very good for VC++.
If You really wish to learn VC++, take easier sample first (not many peoples in the world really understand smtp).
If You need only SMTP-messaging, compile it with gcc.
 
Looks like you have more than one problem here.

First is the _gc thing.

Second is Unexpected end of file found. This is normally something to do with precompiled headers. Try switching off precompiled headers.
 
>I've just started learning Visual c++ 6
Maybe the steps you try are a little to high
Try easier samples, vc++ isnot to be learned in a short time.
And you should decide whether you like to use vc++ (so try vc++ -samples) or any other c++ (use that samples)
The differences are different classes and different headerfiles you have to use.
these are very specific to the versions of Compiler, OS and maybe hardware.

as xwb and tchouch told you, String is a little unusual for mvc++ (you couild use CString instead) and some headers probably dont match.

Good luck
(-:
:-)


Greetings Andreas
 
I used to program in bordland c and c++ about 8 years ago and only in dos, i figured visual c++ was the best thing to learn to get back into it, not much point programming dos apps these days.

cheers for the advice

James.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top