News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Problem Creating Console Application (C++)

Started by PSU_Blue, February 19, 2007, 04:25:54 PM

Previous topic - Next topic

PSU_Blue

I am using Code::Blocks IDE for some work in a computer graphics course at Penn State. I successfully imported our "starter code" for our first assignment, which was in MS Visual Studio project format. However, when I try to create a new project for our second assignment (a console application with C++ source) from scratch, building/running the code that is automatically generated causes a crash. It appears the error is related to "ntdll.dll" It won't even display the "Hello, world!" before the console runner program crashes. Am I missing something in the configuration of the project, or is there some known issue with this? The problem seems to be unique to console applications with C++ source; the C source works fine. Please let me know if there's a way to fix this. Thanks!

Biplab

Are you using MSVC 8 (MSVC 2005)? Console wizard have problem with MSVC 8. :)
Be a part of the solution, not a part of the problem.

PSU_Blue

I am using the GNU GCC Compiler, which is the same compiler that I used for my first project, which worked fine.

Biplab

Console wizard works perfectly with GCC. I'd request you to check your configuration once.

Also try looking at the differences between your project that worked and the generated console project. :)
Be a part of the solution, not a part of the problem.

PSU_Blue

What should I be looking for that might be amiss in the configuration? I haven't modified anything since creating the project. I am literally just creating a project and clicking "Build & run". I might just try uninstalling/reinstalling.

TDragon

Have you tried running the compiled program outside of Code::Blocks (i.e. from the command line)? If it works, it may be a bug in Code::Blocks. If it doesn't work, it's a problem with MinGW or your PC.

Also, you haven't stated which version of C::B you're using.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Biplab

Are you using latest nightly? If not please upgrade.

You can check the compiler options, linker options, link libraries, to see what are the differences.
Be a part of the solution, not a part of the problem.

PSU_Blue

I think I realized what happened. I had manually added some lib files to be linked, and I had to delete one of them. I think the linker was looking for the lib file even though it wasn't needed, couldn't find it, and crashed. I deleted all my settings and reinstalled, and now it seems to work. Thank you for your help, though. I appreciate it.

TDragon

Quote from: PSU_Blue on February 19, 2007, 04:48:17 PM
I think the linker was looking for the lib file even though it wasn't needed, couldn't find it, and crashed.
You may be confusing GCC's compile-time linker, which will give you an error message in C::B's build log at compile time if it can't find a necessary file, with Windows' runtime linker, which resolves dependencies on DLLs. Code::Blocks gives you control over the compile-time linker only; the runtime linker will give you a "can't find DLL" message box if it can't find a necessary DLL when you run the program.

Whatever your problem, I'm glad it's fixed.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)