| View previous topic :: View next topic |
| Author |
Message |
Mussy69 Grandmaster Cheater
Reputation: 0
Joined: 09 Mar 2007 Posts: 842 Location: Sydney
|
Posted: Fri May 23, 2008 4:43 am Post subject: [C++] Quick Noob Compile Question |
|
|
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
~ Much Appreciated, MuSSii
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Fri May 23, 2008 6:11 am Post subject: |
|
|
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 |
|
 |
Mussy69 Grandmaster Cheater
Reputation: 0
Joined: 09 Mar 2007 Posts: 842 Location: Sydney
|
Posted: Fri May 23, 2008 9:02 pm Post subject: |
|
|
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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Fri May 23, 2008 9:25 pm Post subject: |
|
|
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 |
|
 |
Mussy69 Grandmaster Cheater
Reputation: 0
Joined: 09 Mar 2007 Posts: 842 Location: Sydney
|
Posted: Fri May 23, 2008 11:28 pm Post subject: |
|
|
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Sat May 24, 2008 5:00 am Post subject: |
|
|
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 |
|
 |
Mussy69 Grandmaster Cheater
Reputation: 0
Joined: 09 Mar 2007 Posts: 842 Location: Sydney
|
Posted: Sat May 24, 2008 7:02 pm Post subject: |
|
|
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
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat May 24, 2008 10:19 pm Post subject: |
|
|
| 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  |
\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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
|
| Back to top |
|
 |
Mussy69 Grandmaster Cheater
Reputation: 0
Joined: 09 Mar 2007 Posts: 842 Location: Sydney
|
Posted: Mon May 26, 2008 8:06 am Post subject: |
|
|
Thanks Wiccaan, But that TuT you just posted is what you just went against on 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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Mon May 26, 2008 8:43 am Post subject: |
|
|
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Mon May 26, 2008 9:02 am Post subject: |
|
|
| Mussy69 wrote: | Thanks Wiccaan, But that TuT you just posted is what you just went against on 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 |
|
 |
Mussy69 Grandmaster Cheater
Reputation: 0
Joined: 09 Mar 2007 Posts: 842 Location: Sydney
|
Posted: Tue May 27, 2008 3:48 am Post subject: |
|
|
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Tue May 27, 2008 8:24 am Post subject: |
|
|
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 |
|
 |
|