I made a program on visual studio 2005, but when i copy my .exe file on another computer and launch it, then an error masage pop's up something about side by side configuration not being right or something
If you use VC, you are going to need to send the redistributable for it to the other computers so that they can recognize the libraries used by your prog. You could also statically link it but that's a bit higher level.
eh, im not sure what a DLL is, but my program is a simple one that calculates quadratic equation, nothing else.
Well, maybe its just because i got VS 2005, and i made the program on an win xp, but i tryed to run it on an win7, so maybe u cant make programs for win7 with VS2005.
p.s. sorry it took so long to say something, apparently i forgot to subscribe to this topic, so i waited for email, instead to check this topic manualy hehe
Change your configuration from debug to release. Debug requires extra dlls to build debugging information. These dlls are no longer necessary when using release mode.
In vs it is usually in the middle of tool bar that says 'debug', click the arrow and change it to 'release'.
Change your configuration from debug to release. Debug requires extra dlls to build debugging information. These dlls are no longer necessary when using release mode.
In vs it is usually in the middle of tool bar that says 'debug', click the arrow and change it to 'release'.
Aaaaand it works! haha thx man ur the best!
u other guys are great too.
hmmmm.... i copyd my program on a PC with win7 and it works, but my program is 1 that loops till the user says to stop, problem is, after 2 loops, win7 says that the program stopped and get the option to close it or to get online help... anybody know why?
on my XP on which i made the program works perfectly fine
#include<iostream>
#include<cmath>
usingnamespace std;
void main()
{ //ax^2+bx+c=0
double a, b, c, x, d; //variable d is the discriminant
char ponovo; //variable for looping
do{
cout<<"*******************************"<<endl;
cout<<"* Izracun kvadratne jednadzbe *"<<endl;
cout<<"*******************************\n\n";
cout<<"Ovaj program sluzi za provjeru rez."<<endl;
cout<<"Ovaj program sluzi za izrac."<<endl;
cout<<"Ona je ovog oblika:\n\n";
cout<<"*** ax^2+bx+c=0 ***\n\n";
cout<<"Slovo (x) predstavlja nepoznanicu."<<endl;
cout<<"Slovo (a) predstavlja broj koji m."<<endl;
cout<<"Slovo (b) predstavlja broj koji ."<<endl;
cout<<"Slovo (c) predstavlja slobodni clan.\n\n";
cout<<"NAPOMENA: Program radi ispr."<<endl;
cout<<"Unesite SAMO brojeve, ako "<<endl;
cout<<"Unesite broj (a):";
cin>>a;
cout<<"Unesite broj (b):";
cin>>b;
cout<<"Unesite broj (c):";
cin>>c;
cout<<endl;
cout<<"Unijeli ste jednadzbu:\n\n";
cout<<"*** ("<<a<<")x^2+("<<b<<")x+("<<c<<")=0 ***\n\n";
d=pow(b,2.0)-4*a*c; //start of calculation
if(d>0){
cout<<"Diskriminanta jednadzbe je veci od 0"<<endl;
cout<<"To znaci da jednadzba ima 2 rjesenja."<<endl;
x=((-1)*b+d)/(2*a);
cout<<"x1="<<x<<endl;
x=0;
x=((-1)*b-d)/(2*a);
cout<<"x2="<<x<<endl;}
if(d==0){
cout<<"Diskriminanta jednadzbe je jednak 0"<<endl;
cout<<"To znaci da jednadzba ima 1 rjesenje."<<endl;
x=((-1)*b)/(2*a);
cout<<"x="<<x<<endl;}
if(d<0){
cout<<"Diskriminanta jednadzbe je manji od 0"<<endl;
cout<<"To znaci da jednadzba nema realno rjesenje."<<endl;}
cout<<endl;
cout<<"Ako zelite ponoviti unesite slovo 'd' i pritisnite ENTER."<<endl;
cout<<"Ako nezelite ponoviti, unesite bilo koje drug."<<endl;
cout<<"Unesite slovo: ";
ponovo='n'; //prevents endless loop if non-number entered
cin>>ponovo;//user decides to repeat or end
if(ponovo=='d')
cout<<"\n\n";
}while(ponovo=='d'||ponovo=='D');
}
man, i just saw a topic with the same problem as me, and he got it solved the same day as posted, well.... anyway, i solved my problem myself, u see, apperantly using void main() hampers the portabilety, i readed an article about it, so i changed void main() into int main() with a return 0;, and now the program works in win7 w/o any problems and i may loop it as much as i want w/o the program closing.
Anyway, thx 4 the help u gave me
p.s. yes, i noticed in my code that i forgot to square the determinant and i fixed it.
Yes, void main() most definitely is a portability issue, since it is a compiler extension. Port your code elsewhere and the target compiler may not like you, and either fail to compile or do something untoward.
Windows compilers typically transparently convert it to int main() returning zero or whatever you specify with exit() [or the underlying ExitProcess() call].
There have been a lot of threads lately about void main() with wonderful links in them. They are probably all still on the first pages of each forum. void main is illegal in C++, but implementation-defined in C.
Using void main() can not cause any portability issue whatsoever, that's impossible. It's just incorrect to use it.
but im telling u, i just changed void main() into int main() w/ return 0; and now it works w/o problems
and i read in an arcticle a fellow programer posted on this site via link, and there it says that void main() do affect portabillity http://users.aber.ac.uk/auj/voidmain.shtml
Yea this would not be a problem if it weren't for MS and their compiler. Think about how many people use MS Visual C++ on a daily basis, of course if you include a compiler extension which is that silly then people are going to use it. IMO MS should harden the F up and remove from their compilers and force everyone to use the standard, in turn stopping all this bloody confusion for new programmers.
Yes, void main() most definitely is a portability issue, since it is a compiler extension. Port your code elsewhere and the target compiler may not like you, and either fail to compile or do something untoward.
Oh, I assumed he was referring to portability between operating systems or hardware platforms, not compilers. Never mind, then.