Sign in to follow this  

exe to be used for the debug session?

This topic is 3457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I opened someone elses Visual Studio project and fixed the bugs in it but now that the build is succeding it is asking me this: "Please specify the name of the executable file to be used for the debug session." If I point it at the Visual Studio EXE it just opens another copy of Visual Studio and says that this exe doesnt have debugger information... Does anyone know? I have never been asked this before when creating my own projects. I am new to this whole thing though.

Share this post


Link to post
Share on other sites
You may be building it as a library rather then an executable. This is the only time that I have seen it, anyways.

If it is supposed to be an executable and not a library, go to Project Properties->Configuration Type and insure it is Application (.exe) and then rebuild the solution.

If it is supposed to be a library, then you need an application to link it with. You cannot execute libraries by themselves (which is what seems to be happening here)

Dynamic libraries are a little different, but lets not go there ;)

Share this post


Link to post
Share on other sites
Humm.. you were right. Thats odd, this wasnt meant to be a library. Well I changed it to an application and now it have 1 unresolved error

It says "LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup"

Thats a general Visual Studio library.. how could it have a undefined symbol? Now I guess I am going off subject...

Share this post


Link to post
Share on other sites
Quote:
It says "LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup"

main() is only for executables. Because its not in this project, I am suspecting it was meant to be a library and not an application.. (libraries do not have an entry point like applications do.)

(I am excluding the Win32's DllMain() routine here, but thats only used for DLLs and is optional anyways)

You will need to define main(), which is the entry point for your program.

---

If this is a Visual Studio library, then I am suspecting you need to build your application and statically link with it in order to use it.

Share this post


Link to post
Share on other sites
Here is the main statement in main.cpp under Common Files:
void main(int argc, char** argv)
{
// Set up GLUT and the timers
glutInit(&argc, argv);
TimingData::init();

// Create the application and its window
app = getApplication();
createWindow(app->getTitle());

// Set up the appropriate handler functions
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutDisplayFunc(display);
glutIdleFunc(update);
glutMouseFunc(mouse);
glutMotionFunc(motion);

// Run the application
app->initGraphics();
glutMainLoop();

// Clean up the application
app->deinit();
delete app;
TimingData::deinit();
}

Share this post


Link to post
Share on other sites
You need to change your system type from /WINDOWS to /CONSOLE int he linker options (or recreate the project as a Console app and not a Windows app).

Share this post


Link to post
Share on other sites
I think I might see what is happening here: Part of the project (the physics engine) wants to be a library when compiled. The other part called Ballistic wants to be an EXE, but when it compiles the libaray it wants to know where the exe is that hasnt been created yet. Can't it just figure all that out??!?

Share this post


Link to post
Share on other sites
Quote:
Here is the main statement in main.cpp under Common Files:

What do you mean by common files? With this code, do you still get the
same error? If so, then your file is still not being built with the project.

Share this post


Link to post
Share on other sites
Quote:
Original post by Silicon Seed
I think I might see what is happening here: Part of the project (the physics engine) wants to be a library when compiled. The other part called Ballistic wants to be an EXE, but when it compiles the libaray it wants to know where the exe is that hasnt been created yet. Can't it just figure all that out??!?

Wait, I think I know whats going on: Project Dependencies. You need to tell what order to build your projects in to insure the needed libraries or executables are built before the others that rely on them.

Right click your project->Project Dependencies. Set what projects depend on what and check it with the Build Order tab.

Share this post


Link to post
Share on other sites
By right clicking on the project in the list I want to build and selecting build I now get this error:

LIBCMTD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

Share this post


Link to post
Share on other sites
Quote:
Original post by Crypter
Wait, I think I know whats going on: Project Dependencies. You need to tell what order to build your projects in to insure the needed libraries or executables are built before the others that rely on them.

Right click your project->Project Dependencies. Set what projects depend on what and check it with the Build Order tab.


I checked that, it is set correctly by the guy who made the project originaly.

Share this post


Link to post
Share on other sites
Quote:
Original post by Silicon Seed
By right clicking on the project in the list I want to build and selecting build I now get this error:

LIBCMTD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

Uh-oh... WinMain() is for Win32 applications (SubSystem:WINDOWS instead of CONSOLE) only. It is the entry point for Win32 programs. ie, instead of main() it is looking for the Win32 entry point WinMain().

What project did you get this error from?

*edit: Never mind, I see that you have posted your project :)

Share this post


Link to post
Share on other sites
I would say you need to revert the settings you messed with, then you go into your solution explorer, and change the startup project to the actual application (the one with the main function) by right clicking on the project and selecting "Set as StartUp Project"). Then hit F5.

Edit: Try setting any of the projects that start with "demo_" as the startup project.

Share this post


Link to post
Share on other sites
I found that the Demo_ballistic project was set to WINDOWS and switched it to the console app, Building it is now successful. Though clicking Play next to Debug still asks me what EXE I want to use. I am trying to get the app to run.

He included .exe's that work already precompield, so somehow he was able to release the each of the projects to a .exe.

Share this post


Link to post
Share on other sites
Quote:
Original post by Deventer
I would say you need to revert the settings you messed with, then you go into your solution explorer, and change the startup project to the actual application (the one with the main function) by right clicking on the project and selecting "Set as StartUp Project"). Then hit F5.

Edit: Try setting any of the projects that start with "demo_" as the startup project.



THAT WAS IT!!! Wow thank you! Sorry everyone for being so ignorant to how visual studio works.

Share this post


Link to post
Share on other sites

This topic is 3457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this