Rock's cpp truck.

Rock's cpp truck.

Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
sprinkles said:
OS doesn't matter. What matters is that I am missing the "Microsoft.VC90.DebugCRT" assembly.

That'd make sense considering that the .exe came out of my debug folder. Is there a way I can generate a proper executable? With VB they always worked straight outta the debug folder, but I guess thats not the case now.


Down Rodeo said:
If you are going to keep this up, PLEASE, FOR THE LOVE OF ALL THAT IS HOLY, type either "you are" or "you're" when you mean "you are". I'm not going to put up with "your" any longer, it is hurting my head. AaronJer or Superjer will of course nuke this post but I don't care, you're getting on my tits.

And yes, Visual Studio + errors = XML vomit. Have fun

Most of this was written at about 10:30 last night, and I was pretty tired. Also I didn't proofread any of the text part... Since this really isn't an important program, I'm not gonna go through it and fix spelling, but I'll keep it in mind for the future. It actually bugs me too, so I'll try and be more of a hardass on myself when it comes to grammer
 
 
 
2010 Apr 27 at 01:10 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Rockbomb said:
sprinkles said:
OS doesn't matter. What matters is that I am missing the "Microsoft.VC90.DebugCRT" assembly.

That'd make sense considering that the .exe came out of my debug folder. Is there a way I can generate a proper executable? With VB they always worked straight outta the debug folder, but I guess thats not the case now.



The CodeProject said:
Is it Related Project Settings?

We have to check if it is possible to resolve with project settings because EXE will run in debug build and fails to start in release build. Change your project settings to not use the runtime library, but this will make the output EXE bigger. (Project Properties -> C/C++ -> Code Generation -> Runtime Library -> use/MT or /MTd depends on your current configuration.) This may work, but it is not the solution for this issue.


 
 
 
2010 Apr 27 at 01:13 UTC — Ed. 2010 Apr 27 at 01:13 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
sprinkles said:

The CodeProject said:
Is it Related Project Settings?

We have to check if it is possible to resolve with project settings because EXE will run in debug build and fails to start in release build. Change your project settings to not use the runtime library, but this will make the output EXE bigger. (Project Properties -> C/C++ -> Code Generation -> Runtime Library -> use/MT or /MTd depends on your current configuration.) This may work, but it is not the solution for this issue.



Well, I changed it to mt and mtd and tried both, but now it won't build.
Using mtd I get the error
code
mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\noMoreMeth.exe.embed.manifest". The parameter is incorrect.



and using mt I get
code
1>Linking...
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>noMoreMeth.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "protected: virtual char const * __thiscall std::ctype<char>::_Do_widen_s(char const *,char const *,char *,unsigned int)const " (?_Do_widen_s@?$ctype@D@std@@MBEPBDPBD0PADI@Z)
1>libcpmtd.lib(cin.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __malloc_dbg
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __free_dbg
1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol __calloc_dbg referenced in function __Getctype
1>C:\Users\DJ\Documents\Visual Studio 2008\Projects\noMoreMeth\Debug\noMoreMeth.exe : fatal error LNK1120: 4 unresolved externals
 
 
 
2010 Apr 27 at 01:22 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
sprinkles said:
OS doesn't matter. What matters is that I am missing the "Microsoft.VC90.DebugCRT" assembly, which is these DLLs:
msvcr100.dll
msvcp100.dll
msvcm100.dll

Welcome to reason 3 why I don't bother with MSVS any more. If I wanted to compile programs that required all kinds of libraries that don't come with Windows, I'd use Java or something.
 
 
 
2010 Apr 27 at 01:23 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
Rockbomb said:
Well, I changed it to mt and mtd and tried both, but now it won't build.

Can't you just compile the Release version by clicking the little dropdown where it says Debug?
 
 
 
2010 Apr 27 at 01:26 UTC — Ed. 2010 Apr 27 at 01:27 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
superjer said:
Rockbomb said:
Well, I changed it to mt and mtd and tried both, but now it won't build.

Can't you just compile the Release version by clicking the little dropdown where it says Debug?

Here is what my debug dropdown looks like. I've never had to do this (like I said, I normally use the .exe in my debug folder), so honestly I'm not sure what I need to do to make a release version.
 
 
 
2010 Apr 27 at 01:33 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
No not that one! The one behind that.
 
 
 
2010 Apr 27 at 01:37 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
You are using CLR aren't you?

That is a stupid question, because I know you are.

You are in C++, don't use CLR!
 
 
 
2010 Apr 27 at 01:44 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
superjer said:
No not that one! The one behind that.

AHA! I FOUND IT!
I was clicking 'Build Solution' instead of 'Build noMoreMeth'. I'll upload the release version here in just a sec...

Edit: How does THIS work for ya sprinkles? If it works I'll update the first link with this url.
 
 
 
2010 Apr 27 at 01:44 UTC — Ed. 2010 Apr 27 at 01:46 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Yes it does.
 
 
 
2010 Apr 27 at 01:48 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
sprinkles said:
Yes it does.

*Raises both eyebrows twice*
 
 
 
2010 Apr 27 at 01:49 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Rockbomb said:
sprinkles said:
Yes it does.

*Raises both eyebrows twice*



You're still using MS CLR.
 
 
 
2010 Apr 27 at 01:52 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
sprinkles said:
Rockbomb said:
sprinkles said:
Yes it does.

*Raises both eyebrows twice*



You're still using MS CLR.

Give me a good alternative and I'd be glad to switch it out ;)
I'm also using ms pause, but I chose to use the because I like how it puts "Press Any Key To Continue", and I just sit here and hope that nectar guy decides to run my program and posts back saying "GUYS HELP! I CAN'T FIND THE ANY KEY!"
 
 
 
2010 Apr 27 at 01:57 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Rockbomb said:
sprinkles said:
Rockbomb said:
sprinkles said:
Yes it does.

*Raises both eyebrows twice*



You're still using MS CLR.

Give me a good alternative and I'd be glad to switch it out ;)
I'm also using ms pause, but I chose to use the because I like how it puts "Press Any Key To Continue", and I just sit here and hope that nectar guy decides to run my program and posts back saying "GUYS HELP! I CAN'T FIND THE ANY KEY!"



I am going to expand this little project.

As soon as a finish that Splatter Mario trailer/title scene I have been talking about.
 
 
 
2010 Apr 27 at 02:27 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
Here's a pretty simple way to make your program work on *nix systems as well as Windows:

c++ code
#ifdef unix
#define CLEAR_CMD "clear"
#else
#define CLEAR_CMD "cls"
#endif

#define PAUSE() {cout<<"Press enter to continue\n"; cin.ignore(1000,'\n');}


Then use system(CLEAR_CMD) and PAUSE() instead of what you have now.
 
 
 
2010 Apr 27 at 02:56 UTC — Ed. 2010 Apr 27 at 02:57 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
superjer said:
Here's a pretty simple way to make your program work on *nix systems as well as Windows:

c++ code
#ifdef unix
#define CLEAR_CMD "clear"
#else
#define CLEAR_CMD "cls"
#endif

#define PAUSE() {cout<<"Press enter to continue\n"; cin.ignore(1000,'\n');}


Then use system(CLEAR_CMD) and PAUSE() instead of what you have now.

Ah, nifty. I'll have to do a little research on that stuff so I know exactly what it all means, but its cool to know there's an easy solution to making the pause and clear statements cross-platform compatible.

Also on almost every site I saw while looking up the pause statement they recommended using 'cin.get();', is that a good option? They were saying it should work on any platform pretty much.
 
 
 
2010 Apr 27 at 03:03 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
The problem with cin.get() is that it only reads one character. If the user hits multiple keys, they get buffered and then each cin.get() will read one at a time.

This is usually not what you want.
 
 
 
2010 Apr 27 at 07:30 UTC
phoenix_r

2009 May 13 • 905
17 ₧
BACK ON TOPIC: while nested if's work, in most cases I prefer case statements for human readability. Then again, any excuse for nesting...

BOO
 
 
 
2010 Apr 29 at 00:06 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
Nested if's huh?
 
 
 
2010 Apr 29 at 00:31 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Rockbomb said:
Nested if's huh?



Would of been nicer if you used After Effects.
 
 
 
2010 Apr 29 at 00:34 UTC
Down Rodeo
Cap'n Moth of the Firehouse

Find the Hole II Participation Medal
2007 Oct 19 • 5486
57,583 ₧
Only problem with switch/case is it often doesn't allow for complex statements or logical expressions, necessitating nested ifs. I can kind of see why most languages do that - for starters, it's easier; secondly the ifs give you so much more control.
 
 
 
2010 Apr 29 at 00:39 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
If you have this:

c code
if(x==A) a();
else if(x==B) b();
else if(x==C) c();
else if(x==D) d();
else if(x==E) e();
//...
else something_else();


...then you get to use a switch. Most of the time you won't be that lucky.
 
 
 
2010 Apr 29 at 01:40 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
Ok, I'm working on this program that uses the rand function and the system clock to generate a random number, and one part of it is this line...
c++ code
int numberPicked = rand() % 100 + 1;


I don't really get what its doing. I know % is the modulus operator, but I just don't really understand this line.
The way I see it, it takes the value generated by rand (which hasn't been declared yet in the program, so that doesn't make much sense to me), then takes the remainder of that divided by 100, and adds one to that number. But that would make no sense at all, so I guess I'm reading it wrong...
 
 
 
2010 May 1 at 01:23 UTC
Mate de Vita
Kelli

2008 Oct 4 • 2453
159 ₧
Rockbomb said:
Ok, I'm working on this program that uses the rand function and the system clock to generate a random number, and one part of it is this line...
c++ code
int numberPicked = rand() % 100 + 1;


I don't really get what its doing. I know % is the modulus operator, but I just don't really understand this line.
The way I see it, it takes the value generated by rand (which hasn't been declared yet in the program, so that doesn't make much sense to me), then takes the remainder of that divided by 100, and adds one to that number. But that would make no sense at all, so I guess I'm reading it wrong...

Your statement (or whatever this is called) will choose a random number from 1 to 100.

The rand() will give a completely random number.
This number when divided by 100 will give you a modulus, which will be something between 0 and 99 (depending on what the last two digits of the random number were).
This modulo is used simply to find the last two digits of the number picked by rand().

Since you want a value from 1 to 100, not from 0 to 99, you add 1 at the end.

Note that this is only me guessing here, you should wait for someone who knows C++ to confirm this.
In pascal iirc the rand() would give you a random value between inclusive 0 and exclusive 1 so something like this would've been different.
...and that's the bottom line because Mate de Vita said so.
 
 
 
2010 May 1 at 08:37 UTC — Ed. 2010 May 1 at 08:38 UTC
SRAW
Rocket Man

2007 Nov 6 • 2525
601 ₧
mate is right, it gets a random number under 100, and if your having problem i think you need to srand it...
Free Steam Games
 
 
 
2010 May 1 at 10:07 UTC
Page 1 [2] 3 4