Author Topic: Problem Creating Console Application (C++)  (Read 6706 times)

PSU_Blue

  • Guest
Problem Creating Console Application (C++)
« on: February 19, 2007, 04:25:54 pm »
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!

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Problem Creating Console Application (C++)
« Reply #1 on: February 19, 2007, 04:30:31 pm »
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

  • Guest
Re: Problem Creating Console Application (C++)
« Reply #2 on: February 19, 2007, 04:33:13 pm »
I am using the GNU GCC Compiler, which is the same compiler that I used for my first project, which worked fine.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Problem Creating Console Application (C++)
« Reply #3 on: February 19, 2007, 04:38:28 pm »
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

  • Guest
Re: Problem Creating Console Application (C++)
« Reply #4 on: February 19, 2007, 04:41:39 pm »
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.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Problem Creating Console Application (C++)
« Reply #5 on: February 19, 2007, 04:45:44 pm »
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.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Problem Creating Console Application (C++)
« Reply #6 on: February 19, 2007, 04:46:21 pm »
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

  • Guest
Re: Problem Creating Console Application (C++)
« Reply #7 on: February 19, 2007, 04:48:17 pm »
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.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Problem Creating Console Application (C++)
« Reply #8 on: February 19, 2007, 05:06:24 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.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)