exe to be used for the debug session?

Started by
16 comments, last by GameDev.net 15 years, 9 months ago
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.
Advertisement
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 ;)
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...

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.
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();
}
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).

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

Under Linker > System > SubSystem it is set to Console (/SUBSYSTEM:CONSOLE) is that what you mean?
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??!?
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.
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.

This topic is closed to new replies.

Advertisement