3) msvs.net questions

Started by
6 comments, last by Dean Harding 18 years, 11 months ago
1) it seems i can only compile and run projects. I want to compile a single source file and run it. Nothing funcy just a hello world program ( it's too small to create a whole new project for it. ) How can i do it? The little blue tringle that stands for "run" is inactive for a single source file :( That IDE doesn't even have a "compile" button somewhere :( All it has is "build" and "run". 2) why when i creatre a new visuall c++ win32 console project the default source file starts with:
// xczcdac.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
	//...
	return 0;
}
why "_tmain" and not just main? why "stdafx.h" and why does it have to build it every time i create/compile the program? the libraries shouldn't be already built for me to just use? And why _TCHAR and not just char as the standard specifies? 3) when i installed msvs.net a shortuct to it wasn't created in my desktop. i created one manually, but why didn't they create the shortcut for me? I installed it normally, basically without changing any options. thanks in advane!
Advertisement
1) Create a project, but for the most part, clicking build should create a default project (does for me at least).
2) _tmain is a define that checks if unicode is enabled or not in the build environment. If it is it uses wmain if not it uses main. Instead of creating a project with source files, check the box that says create empty project, and add a source file.
3) It adds them to the start menu.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

>1) Create a project, but for the most part, clicking build should create a default project (does for me at least).

ok but how do i compile and run a single source file? no projects, just a little hello_world.cpp?

>2) _tmain is a define that checks if unicode is enabled or not in the build environment. If it is it uses wmain if not it uses main. Instead of creating a project with source files, check the box that says create empty project, and add a source file.

o... i see :) ok thank you problem solved, but i already i uninstalled the evil M$ product :)

>3) It adds them to the start menu.
yeah i saw them.. i expected one in the desktop though..
you dont compile and run just a source file. you compile and run a project, thats how it is. unless you want to use the command line

[Edited by - chad_420 on May 14, 2005 5:46:41 PM]
Quote:Original post by chad_420
you dont compile and run just a source file. you compile and run a project, thats how it is. unless you want to use the command line


what do you mean i don't? How did i do it all the time using Dev-c++? I want to make a program that is consisted by only one source file. Is that so weird? sheesh...
Yes, but the compiler and linker need to know what to make from the source file. Will it be a console app, a windows app, a dll, a lib?
This cannot be deduced from the source. That's what the project is: It tells the compiler/linker what files need to be compiled how and any special settings are stored in the project.
You could probably trick the IDE into compiling your .cpp file, but that leaves you with just an .obj file. Which needs to be linked to make something runnable. And it can't just link an object file without knowing more about what you want to do with it.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

oh... this sucks... Then, how does Dev-cpp know that i am compiling a win32 console app with my source file and not say a dll?

thanks!
It guesses. No, really!

VS.NET 2003 doesn't support compiling and running a single file, but I think they've added it to 2005. I don't have 2005 installed at the moment to check, cause I unstalled beta 1 in anticipation of beta 2 (which hasn't arrived at my house yet) :)

This topic is closed to new replies.

Advertisement