Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] Quick Noob Compile Question
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Fri May 23, 2008 4:43 am    Post subject: [C++] Quick Noob Compile Question Reply with quote

Hey Guys,
I'm new to C++ and have learnt quite abit so far, the question is how do i build the .exe of the code i've written in Microsoft Visual C++ 2008 Express heres the build log
Code:
------ Build started: Project: C++ Vid Tut Project, Configuration: Release Win32 ------
Embedding manifest...
[b]mt.exe : general error c10100b1: Failed to load file "..\Release\C++ Vid Tut Project.exe". The system cannot find the path specified.[/b]
Build log was saved at "file://c:\Program Files\C++\Projects\Tutorial Projects\C++ Vid Tut Project\C++ Vid Tut Project\Release\BuildLog.htm"
C++ Vid Tut Project - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
If anyone knows how to do what i have asked in this compiler please do reply as soon as possible Very Happy
~ Much Appreciated, MuSSii

_________________
Back to top
View user's profile Send private message AIM Address
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Fri May 23, 2008 6:11 am    Post subject: Reply with quote

Googled the error and it apparently has to do with the location of your source files (.cpp/.c) try moving them to the correct folder if they aren't there already.

Sources:
http://www.cplusplus.com/forum/beginner/20/

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Fri May 23, 2008 9:02 pm    Post subject: Reply with quote

Thanks Alot Wic.
1 More Thing, In VC++ TuT ive been "Watching" ( Vid TuT ) And the main code is
Code:
void main ()
{
*Main Code*
}

But when i try to compile it in Dev-CPP 4.9.9.2 its mean't to be
Code:
int main ()
{
*Main Code*
}
And also in this TuT i was watching it doesn't use
Code:
using namespace std;
Like Dev-CPP 4.9.9.2 has to?
_________________
Back to top
View user's profile Send private message AIM Address
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Fri May 23, 2008 9:25 pm    Post subject: Reply with quote

void main() isn't standard and is bad practice in my opinion.
void just means no return.

use int main() and return a value.

using namespace std; just allows you to directly access that namespace without having to put "std::" before the functions within that namespace like cout, cin, etc.

_________________
Back to top
View user's profile Send private message
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Fri May 23, 2008 11:28 pm    Post subject: Reply with quote

Thanks Lurc,
Do any of you know a GOOD C++ Vid TuT if not a REALLY good C++ beginner TuT or something close to really good
~ Thanks, MuSSii

_________________
Back to top
View user's profile Send private message AIM Address
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Sat May 24, 2008 5:00 am    Post subject: Reply with quote

Firstly, I would suggest you ditch DevC++, it's crap. Just get the express edition of Visual Studio, it's free. It has limitations to what you can do, but if you are using it to just learn the basics atm, then you will be fine. Get the full version if you want. (Not giving links and such, warez aren't allowed.)

void main() does not follow standards, but, in most cases will work with most compilers. int main() is the standard though.

using namespace std; just incase the full STD namespace, which in my opinion, is also bad practice to include something like that if you don't plan to use more then the basics inside it. In most code that includes the namespace, the only parts used is cin and cout, which to be honest is a waste to include the full thing just for those.

If you want to use the functions without including the namespace, just add std:: infront of your functions, like this:

Code:
std::cout << "Hello world!\n";

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Sat May 24, 2008 7:02 pm    Post subject: Reply with quote

Oh Thanks Wiccaan, May i ask what the \n did? & Also this is why i need a good tutorial because the ones that i follow always teach me the stuff that you guys say are a waste Rolling Eyes
_________________
Back to top
View user's profile Send private message AIM Address
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat May 24, 2008 7:11 pm    Post subject: Reply with quote

http://www.cprogramming.com/tutorial.html#c++tutorial

Amazing tutorial.

http://www.cplusplus.com/doc/tutorial/

This one is pretty good too.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat May 24, 2008 10:19 pm    Post subject: Reply with quote

Mussy69 wrote:
Oh Thanks Wiccaan, May i ask what the \n did? & Also this is why i need a good tutorial because the ones that i follow always teach me the stuff that you guys say are a waste Rolling Eyes


\n is an escape charecter that means new line.

there are a bunch of these

\n - New Line
\t - Tab
\r - Carriage Return
\\ - Backslash "\"
\? - Question Mark
\' - Single Quote
\" - Double Quote

i think there was a couple more but i cant remember.

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Sun May 25, 2008 3:02 am    Post subject: Reply with quote

Mussy69 wrote:
Oh Thanks Wiccaan, May i ask what the \n did? & Also this is why i need a good tutorial because the ones that i follow always teach me the stuff that you guys say are a waste Rolling Eyes


Certain things that we say are more or less so user opinion. I personally think that, like above, using the entire std namespace for two functions like most people use is a waste. Theres no reason you should include it just to be lazy. Typing the extra std:: doesn't kill you and takes less then a second to type.

www.cplusplus.com is probably one of the best tutorials for C++ basics and such though. They cover how to do just about everything to get you started.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Mon May 26, 2008 8:06 am    Post subject: Reply with quote

Thanks Wiccaan, But that TuT you just posted is what you just went against on Shocked it uses the example 'using namespace std;' but il be sure to take that out and add std:: in my programs if i get pro enough to get up to that stage, another question, do i put std:: infront of cin or just cout
_________________
Back to top
View user's profile Send private message AIM Address
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon May 26, 2008 8:43 am    Post subject: Reply with quote

Anything from the namespace "std" you'll need to add std:: before it.

cout, cin, string, are all examples
type std:: and if your using MSVC++ or MSVS 2008 and it has intellisense it will pop up a list of functions within the namespace.

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Mon May 26, 2008 9:02 am    Post subject: Reply with quote

Mussy69 wrote:
Thanks Wiccaan, But that TuT you just posted is what you just went against on Shocked it uses the example 'using namespace std;' but il be sure to take that out and add std:: in my programs if i get pro enough to get up to that stage, another question, do i put std:: infront of cin or just cout


Like I said, it's user opinion about using namespaces. It's not wrong, it's just seen as a lazy thing to do and a waste by many. Something like...

Code:
#include <iostream>
using namespace std;

int main( int argc, TCHAR* argcv[] )
{
     cout << "Hello World!";
     return 0;
}


Something as basic as that, to me, is pointless to include a full namespace for 1 function. You could have easily just typed 'std::cout' and achieved the same thing without using the namespace. In big projects, I can see it being useful if you plan to utilize the full namespace and not just a few select functions from it.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Mussy69
Grandmaster Cheater
Reputation: 0

Joined: 09 Mar 2007
Posts: 842
Location: Sydney

PostPosted: Tue May 27, 2008 3:48 am    Post subject: Reply with quote

Also one more question lmao,
What compiler should i use?
Dev-cpp is shit
Visual - wont let me build
Borland - wont install

_________________
Back to top
View user's profile Send private message AIM Address
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Tue May 27, 2008 8:24 am    Post subject: Reply with quote

If you got the Express edition of Visual Studio you need to make sure you have the Platform SDK installed as well.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites