how to you build an exe in visual studio.net? im trying to convert from visual studio 6 and im lost =/ apparently build isnt what i want...
how to you build an exe in visual studio.net? im trying to convert from visual studio 6 and im lost =/ apparently build isnt what i want...
the F5 button i believe.
if not:
F9
Ctrl + F5
Ctrl + F9
One of those always works...
nope niether of those, it says that it can't find 'test project.exe' (what i named it) so its not even being created...
are you trying to name the file "test project.exe"? If so get rid of the space
didnt work, whenever i press ctrl-f5 it says it cant start because the file does not exist
edit:renaming didnt work
edit2: bah i can compile c# files but not c++ and i wanted to try making some c++ files before i went to c#
Last edited by Guido; 06-08-2004 at 07:37 PM.
c:\dos
c:\dos\run
run dos run
If you have an existing project from VC6, open it in VC7. Click yes when you are asked to convert. If you want to build a new project, Select new project from the File menu. Make sure you select the right project, C++ if you want C++, C# if you need C#. Select "Build Solution" or "Build" from the menu. Check for any compiler errors. If there are no errors there should be an informational line line "1 Project build, 0 failed, 0 skipped".
Your executable is now located in the appropriate folder, either bin/Debug or bin/Release. If it was Debug, you can start debugging by pressing the "Play" button in VC7.
If there are any error-messages in this process, please post them.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
------ Build started: Project: starship, Configuration: Debug Win32 ------
Compiling...
ship.cpp
Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
LIBCD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
.\Debug/starship.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Program Files\Microsoft Visual Studio\MyProjects\starship\Debug\BuildLog.htm"
starship - 2 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
i dunno if this has anything to do with it but i am using allegro.h and alleg.lib in the project
c:\dos
c:\dos\run
run dos run
------ Build started: Project: starship, Configuration: Debug Win32 ------
Compiling...
ship.cpp
Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
LIBCD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
.\Debug/starship.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Program Files\Microsoft Visual Studio\MyProjects\starship\Debug\BuildLog.htm"
starship - 2 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
This is called a compiler error
You don't have a main function in your program. Maybe you have a windows application but created your new project as console application ?
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
void main()
{
}
whats wrong with that?
c:\dos
c:\dos\run
run dos run
Besides the fact that main should return an int, anything else can result in undefined behaviour, I see nothing wrong with it.
Change it to return int and make sure this file is in the project.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
I get the same link error.
I am using the following instead of a main function:
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nShowCmd)
{
/*MyGameWindow class is defined before opening WinMain*/
MyGameWindow myWindow;
myWindow.Create (hInstance, "My First Game");
myWindow.SetSize (640, 480);
myWindow.Init (hInstance);
myWindow.Run ();
return 0;
}
Can I fix this without switching off the incremental:no option?
Thanks
Yes, make sure your project is build for SUBSYSTEM:WINDOWS. Browse through your project or solutions properties, it has to be in there somewhere ( don't have a compiler on this pc ).
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
Its in project properties (right click on your project in the solution window and select properties) /Linker/System. You need to change the SubSystem field to either "Console(/SUBSYSTEM:CONSOLE)" or "Windows(/SUBSYSTEM:WINDOWS)" depending on what you are trying to compile.
Its console if you have:
and windows if you have:Code:int main() { }
Code:int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { }
Last edited by dalek; 08-12-2004 at 03:53 AM.
Hi i think you have to put the main function in a class in C# like this.
class Name
{
public static void Main()
{
Like in Java just main with a big M. And to build you puch ctrl + shift + b. then use F5 to debug.