tags:

views:

522

answers:

1

I'm new to Visual Studio Express 2008. I succeeded in executing the C++ compiler from command line on my single cpp file, after i had to add some path in the %include% to .. .NET\console\Templates\1033 for the stdafx.h definition file (why do i need to do that, i would have thought the installer would put everything i need... ??) and it worked, but now i get the error C3861 for 'printf', 'sprintf', 'fopen'... and also error C2065 for 'FILE', 'fpIndex', 'fpData'... Both errors seem to be associated with a namespace problem! I have no idea on what to do about a namespace, when i tried the command suggested for these errors on MS website using namespace std; i got one more error saying "a namespace with this name does not exist" ?

i only have these few includes and the code

#include "stdafx.h"
#include <windows.h>
#include <time.h>
#include <process.h>
#include <stdlib.h>
#include <malloc.h>
+1  A: 

You're missing a library you need for those functions. Try adding #include < stdio.h>

Mark
He will need this for some of the functions listed but that won't solve his namespace error
Sam Post
it worked ... thanks a lot Mark, it seems my memory is failing me, but hey, i've not touched C or CPP for like 15 years !as for namespace i didn't keep the 'using' command and now all is ok.. probably not a problem finally, after all i have nothing older then Visual Studio Express 2008 in my stuff and the changes to namespace are said to have occured in 2005 so its probably just me misreading the information on MS website... thanks all
Zigomar