|
Hi There.
I am using sone 3rd party libraries and am able to successfully Debug build my application.
Now, when I try to Release build the same piece of code, I am getting below error messages. Let me list few of them...
error C2146: syntax error : missing ';' before identifier 'HOPTIONSET'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2065: 'VWCALLBACKPROC' : undeclared identifier
......................................
......................................
......................................So On....
Please provide some pointers/suggestions for the same.
Thanks
PanB
|
|
|
|
|
Make sure that your project options are the same for debug and release (concerning the include directories, the lib directories, additional dependencies, ...). In brief: everything you changed in the configuration for debug mode should also be done for the release mode.
|
|
|
|
|
I have crossed checked them, they are absolutely similar to each other. Any other pointer/suggestion will be really helpful. Thanks.
|
|
|
|
|
Then look through the headers, looking for lines like:
#ifdef DEBUG
struct _some_struct_that_the_compiler_can't_find_in_release_
{
int evil;
};
#endif
I hope that made the point.
Don't read the whole thing by eye - get the computer to search for terms from the error messages, and then read up from there.
Hope that helps,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Thanks for the reply guys.
BAD NEWS>
I have cross checked project settings - Debug/Release i.e.,
(a)C/C++ > Additional Include Directories
(b)Linker > General > Additional Library Directories
Linker > Input > Additional Dependencies
Should I need to check some other property apart from mentioned above?
Also, I am not able to find DEBUG in my full code/solution.
Just want to know, I am using same 3rd party dlls/libs for Debug/Release mode. Can they create this type of problem?
Thanks
PanB
|
|
|
|
|
Guys just an update >>>>
If I copy Preprocessor Defn and Runtime Library settings from Debug and copy them for Release, then I got success with Release Build but at the time execution my application just blow up....
Any clues, What I can do at the minimal level to make my Release build a success and also can execute my Release type application.
Thanks
PanB
|
|
|
|
|
Check the whole code out and look for uninitialized variables (specially local ones). For example you may have such a thing somewhere in your code:
CString strVariable ;
instead of:
CString strVariable = _T("");
|
|
|
|
|
I must admit the title is NOT clear at all.
As you know, using spy++ you can inspect messages sent to a specific widow in a human-favor manner. Now suppose you have a program being debugged and there's a variable representing a few properties. See the following variable contains BOLD, ITALIC and UNDERLINE status of a character:
DWORD dwFlags;
...
if (dwFlags & BOLD)
{
}
...
dwFlags |= ITALIC;
...
But my problem is this variable looks like some thing like 0x2F284A08 in the debug window and it's difficult to say which flags are set at the moment. Could you show a better way to consider this kind of variables?
Thank you masters!
|
|
|
|
|
I have been working on this program problem for days. I am not good at this infact I am almost illiterate to the subject. I am taking a c++ class as a requirement for my math ed degree. However,I have gotten lost on the past few assignmetns and only have a couple more to go. This is the last and only Programming class that I need. Can someone please help me with this one?
Thanks in advance and havea blessed day!
///*****************************************************************
//This program will converts your weight on the sister planets!
//*****************************************************************
#include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;
int choice;
float Weight;
namespace planet
bool dataok;
{
int main();
planet =0;
cout <<"Please enter your weight in pounds" <<
cin << Weight;
cout << "Please enter the case number of the planet you wish to find your weight on">> endl;
cin << "planet"<< endl;
planet == "Mercury 1" || planet == "Venus 2" || planet == "Earth 3" || planet == "Moon 4" ||
planet == "Mars 5" || planet == "Jupiter 6" || planet == "Saturn 7" ||
planet == "Uranus 8" || planet == "Neptune 9" || planet == "Pluto 10")
switch(choice)
case 1: planet = "Mercury";
multiplier = .4155;
break;
case 2: planet = "Venus";
multiplier = .8975;
break;
case 3: planet = "Earth";
multiplier = 1;
break;
case 4: planet = "Moon";
multiplier = .166;
break;
case 5: planet = "Mars";
multiplier = .3507;
break;
case 6: planet = "Jupiter";
multiplier = 2.5374;
break;
case 7: planet = "Saturn";
multiplier = 1.0677;
break;
case 8: planet = "Uranus";
multiplier = .8947;
break;
case 9: planet = "Neptune";
multiplier = 1.1794;
break;
case 10: planet = "Pluto";
multiplier = .0899;
break;
system ("pause");
return 0;
endl;
}
|
|
|
|
|
angel.monkey wrote: cin >> "planet"<< endl;
panet must be an array of type char.
angel.monkey wrote: {
int main();
int main()
{
...
}
angel.monkey wrote: planet == "Mercury 1"
you can not compare strings in this way
angel.monkey wrote: switch(choice)
case
switch(...)
{
and thousands more ...
Thank you masters!
|
|
|
|
|
Thanks but I still do not understand. I am very lost when it comes to things like this. Thank you anyway and have a wonderful night!
|
|
|
|
|
Jusef has already coverted many points in your software. I'll point to just one:
{
int main();
I can easily imagine making this sort of silly mistake when writing the code - I've made soft daft ones in the last few days. But it really should not need external assistance to solve this problem.
OK, two problems:
switch(choice)
case 1:
If your teacher is in any way competent, you will have been shown working programs you can look to see how to start a console program - or to define any function at all. Similarly, if you haven't seen a switch statement before you probably don't need to use it to solve your homework.
If you've done past assignments, surely you must have handed them in for assessment. You do say you got lost - but didn't your teacher show you the way? Or couldn't you ask one of your fellow students to help you?
The compiler itself will help you, as long as your program makes a small amount of sense. It can produce very helpful error messages. At the moment it probably just says: ERROR1: HUH?
I think most people could go through your program and give you a working version but:
a/ This would not help you learn - only your efforts and one to one time with your teacher or a student getting better marks will. Bribe them with a beer for their time! (Or some other not-really-a-bribe-but-shows-thanks thing)
b/ If you've been that badly lost that you can't even start a function in your previous assignments, and you suddenly produced a working program, I bet your teacger would want to know why. Your teacher can use the internet too... And I bet you found codeproject somewhere...
c/ If you were lucky, and it helped you pass without fully understanding what you were doing, I'd feel sorry for any future employer relying on your programming skills. I know you're doing a math degree - and I also know a lot of modern math relies on software. This is a skill you need. You don't need to be expert - you do need to be competent.
4/ Buy a basic book! Go to the library and borrow one... Visit a friend and sneak a peek at theirs!
5/ If your teacher is so bad that all of the class is at this level by the end of the course, and they're unapproachable to help, then speak to their boss.
6/ Lastly, and you won't like this... If you've spent a semester going to class, and you really need help with this program, and the teacher has been slightly OK, then maybe you *should* fail this class. When you join the real world, people will expect you to deliver, or in the end you starve.
I can see three possibilities:
a) You can redo this class another time, but this time you'll pay more attention to the examples and code shown in the early days of the class, so you will get great marks in your class and move on with some humility
b) You doing pretty well in your other classes. You can't resit this class, but it's only a minor part of your overall degree. Move on, and work extra hard in other areas of your study. Don't mention programming skills on your CV.
c) You are doing badly in your other classes, and failing this will be enough to tip your grades over the edge. This will not come as a surprise to you. In which case, why on earth are you leaving it till this late in your course to ask for help, and why not someone closer?
I'm sorry if this ended up a bit rant-y, but this forum isn't really the place to get your answers - you need someone a lot more local and interactive - someone who can use pend and paper and refer to the material you should have already learnt.
I wish you success though!
Iain.
ps, If it makes you feel better, I still remember thinking that:
switch (Planet)
{
case "Earth":
planetnum = 3;
break;
should have worked! I've long since worked out why not, but we all started once!
Modified: Added harsh point 6.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Since you say you've been trying it for days, I'll give you a solution. But try and understand where you've gone wrong.
#include <iostream>
using namespace std;
#define PLANET_MERCURY 1
#define PLANET_VENUS 2
int main (void)
{
float fMultiplier = 1, fWeight = 1;
unsigned int nPlanet = 0;
cout<<"Please enter your weight"<<endl;
cin>>fWeight;
cout<<"Please choose a planet from the following (enter corresponding number)"<<endl;
cout<<"1. Mercury"<<endl<<"2. Venus"<<endl;
cin>>nPlanet;
switch(nPlanet)
{
case PLANET_MERCURY: fMultiplier = 0.4155;
cout<<"Your weight in Mercury is: ";
cout<<fWeight*fMultiplier<<endl;
break;
case PLANET_VENUS: fMultiplier = 0.8975;
cout<<"You weight in Venus is: ";
cout<<fWeight*fMultiplier<<endl;
break;
default: cout<<"Invalid choice!"<<endl;
break;
}
return 0;
}
Try to understand how the program works and then you can do it for the rest of the planets. You're still just beginning and you can very well read up a book. Master the fundamentals well and now. Or, you'll have trouble later.
Not the usage of >> with cin and << with cout . Note the switch cases enclosed in braces { } and can have a default case handler too.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
You're a gentler person than I am... See my reply[^] for a harsher take.
If it was one or two daft mistakes, I'd have joined your camp.
Happy weekend,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
I actually was reading your reply when you've replied to me (when I was typing out my reply to the OP, your reply wasn't there). I would say you're right, but I see the OP is a school kid and has been trying this out for days. I'm not exactly a gentle person, but I'm rather in a good mood.
Happy weekend too!
PS: How is the process of relocation going? Found a job there yet?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
OP wrote: math ed degree
If it was a school project, I'd have been a lot gentler too. University isn't the big bad world - but it's getting closer...
Relocation is going smoothly - just two weeks left at my current work. I haven't found an actual job yet, but I do have a few mini-contracts to keep the wolf from the door. Just not having to go back and forth between countries will ease both our outgoing costs! I'll be a kept man, whose only duty is to greet his lady at the door with a cocktail, apron and nothing else...
Expect to see even more of me next month!
So, why the good mood?
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Iain Clarke wrote: If it was a school project, I'd have been a lot gentler too. University isn't the big bad world - but it's getting closer...
Bah! I missed that one. I took that him for a school kid.
Iain Clarke wrote: I haven't found an actual job yet, but I do have a few mini-contracts ... I'll be a kept man, whose only duty is to greet his lady at the door with a cocktail, apron and nothing else...
My best wishes for finding a new job and for your love life.
Iain Clarke wrote: So, why the good mood?
The clients are impressed with our work, especially given that we are a very small team. We had been spending sleepless nights writing code and it is paying us back now.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks guys I really appreciate your comments. I am never going to use this class. I am not in a traditional classroom but online instead and other than Microsoft Office this is my only other computer class. I would not be here asking for help had I not been in and out of the hospital due to seizures this entire semester. Occassionally people make judgement on people that they truely have no clue about and remember that it is not our please to judge. WE are ALL here on barrowed time! It is just a requirement for becoming a math teacher not a computer programer. And speaking of harsh, TEACHING High School students Algebra will almost always be a much more rewarding carreer than what you do including the door and cocktail deal that you claim to be such a great life! I am a single mother due to domestic violence and a dead beat dad who owes us $52,000 in back child support I am only trying to better our lives because he also thouht that meeting me at the door with more than a cocktail was the high light of my day lol......so maybe being harsh is not the best way to be. What if it was your mom trying to graduate college before you graduate high school, because she knew that it was the only way to give you a better future? Just something to think about next time before you post a comment like the one you posted last night!!!
Thanks and have a very blessed day!
modified on Saturday, April 4, 2009 4:29 PM
|
|
|
|
|
I apologise if I was over-harsh. I know I wasn't in fluffy bunny land.
Given your personal circumstances (which do sound very dramatic!), then it is probably worth getting in touch with the Online University and seeing if there is anything they can do - maybe they could pretend this semester never happened, and you could resit the class.
I wish you every luck with your health and future success in teaching. It's a path I considered, but I'm aware of my deficiencies. Tolerating 15 year olds who didn't want to be there would be something I'd fail at. Probably get arrested for "Assault with projectile chalk"...
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Rajesh, you realise you've just doomed her to fail if her lecturer comes along and finds this? Not to mention you're perpetuating the attitude that this forum is a place for students to come have their assignments done for them? I know it was hard to resist because it probably took you less than 2 minutes to write that slab of code, but you haven't taught her anything in the process! That's just basic C++ syntax which either A) a decent C++ resource, or B) her compiler could have taught her!
In future, please only give hints to people looking for help with their homework. Her main problem was trying to compare char arrays in a switch statement. You could have simply told her to look into enum's (and kindly linked her to an article about them). Always keep in mind that the more you "help" these people by giving them a slab of code they can copy and paste to make their grade, the more likely you will one day end up working with them, having to debug their terrible code.
modified on Saturday, April 4, 2009 11:08 PM
|
|
|
|
|
I agree with you. But I see the OP was struggling with more than a week and wasn't able to make anything out, so I gave a working solution and also asked to see how it works. I will refrain from providing complete solutions to such posts in the future though.
Thanks for your comments.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi All
How can i get USB COnnected Drive information?Plz help me
|
|
|
|
|
Have look at my article: Detecting when drives are added or removed[^]. Hopefully it can help a bit!
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Hi,
I have a process where the name of a function is in a file text. I Read this file and i whould like to call a function associated with a Execute=[] parameter.
Is it possible ?
|
|
|
|
|
Hi SNArruda,
This is possible if function you want to call is of dll.
You can use GetProcAddress [^] along with LoadLibrary[^]
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|