Ok i am having a problem. I am using the documentation guide and am on output section i typed the i/o example in the guide in dev C++ but it ownt work. DEV C++ was working for me yesterday but now it wont work. I odnt know if it has anything to do with installing microsoft Virtual C++ 2008 but this is firts time ive tried to use it after installing that and it wont work. I get this message at bottom. Also i was getting this meesage in vC++ also. i first encountered problem when using anpother guide and was on arrays. That code is
#include <iostream>
usingnamespace std;
int main(){
int myArray[3];
cout << "Enter a number: ";
cin >> myArray[0];
cout << "Enter a second number: ";
cin >> myArray[1];
myArray[2] = myArray[0]+myArray[1];
cout << "The sum is: " << myArray[2];
system("pause");
}
also when i used vc++ and i compiled it as console program with premade header then added the code it worked but i dont want to do that cus i dont understand weverthing it was doing. B4 i could just type code into dev C++ and it would run or give me error telling me where error was but now it doesnt do anyof that.
here is msg i was getting.
[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status
here is code that was entered
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// i/o example
#include <iostream>
usingnamespace std;
int main ()
{
int i;
cout << "Please enter an integer value: ";
cin >> i;
cout << "The value you entered is " << i;
cout << " and its double is " << i*2 << ".\n";
system("pause")
return 0;
}
Out of curiousity do you have any APIs in use, such as SDL? I saw this problem a while back but can't completely recall what the origin was. I think it was fixed by reinstallation of the compilers and APIs.
well no i dont think i use any api's considering i do not know what that is and unless it came with dev or vc++ no i dont use it. also even programs i wrote and worked b4 wont work now. DOes anyone know what to do to fix this.
I would try uninstalling DevC++ to start with and see if you get the same error in VC++. You should make the leap to VC++ anyway :). As Grey Wolf mentioned it is probably a clash with the two compilers.
ok i uninstalled devc++ and finally figured out how to get a console program done in vc++. what i was doing was using precompile header or i was checking empty project but i finally unchecked precompiled header and then i typed the code and it ran
thank you very much
You could check where the libraries are in Dev C++ (Tools->Compiler Options->Directories->Libraries [I think]) you may find that it is picking up the VC libraries again the Dev C++ headers or vice versa. If they are listed as a PATH environment variable, instead of a directory that can be a problem.
Edit:
It is perfectly feasible to have more than one compiler installed, you just have to be careful about where and how it finds the headers and libraries.