Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8449815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:48:43+00:00 2026-06-10T10:48:43+00:00

I am working with code blocks using MinGW, and I have a coding project

  • 0

I am working with code blocks using MinGW, and I have a coding project I’ve been working on for some time. The project I’ve been using has been console application, and the debug functions I have rely on printing to the console.

However, recently, I’ve tried to implement windows ‘GetOpenFileName()’ function to pull up an open file box so it’d be a lot easier for users to open files with. However, when using a project in console application with the headers included, the MinGW compiler acts like it can’t find the function. I found however changing the project to win32 GUI allows the compiler to find the function (I don’t entirely understand why but that’s just me).

The problem is thus: I tried to output debug information to console, but of course now the application is win32 GUI, the console doesn’t display and thus I cannot see the debug information, and I can’t switch it back to console application or the windows open file box code won’t compile. How do I both display the console and still allow the project to correctly compile the windows GUI code?

I cannot alter the debug functions or use different ones because they are written into all of the classes to assist with back-tracing errors and there are at least 43 files, most of which use the debug functionality.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:48:43+00:00Added an answer on June 10, 2026 at 10:48 am

    And so the problem appears not to be caused by a project type, but a setting/compiler option. The compiler can find the function declaration just fine, but the linker now complains because it can’t find the definition.

    In order to remedy this, you need to link to the correct library (which, as stated in the MSDN documentation, is comdlg32.lib).


    In CodeBlocks, you can do this by:

    1. Go to the Project menu and click Build Options.
    2. Click the Linker Settings tab.
    3. Click Add.
    4. Type comdlg32 and press OK.
    5. Click OK to save your change and exit.

    Your project will now link to that library when building. If you want all programs, project or not, to link to that library, you can replace step 1 with the following step instead:

    1. Go to the Settings menu and click Compiler and Debugger.

    The rest is the same from there, but on a global basis.


    For what it’s worth, if you’re using raw command line building, you can add the -lcomdlg32 option to produce the same effect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get Glew and opengl 3.2 working with code blocks(minGW)
I have built GMP for MinGW. The IDE I'm using is Code::Blocks. I don't
I'm porting some (working) code from Linux to Windows 8. I'm using DDK. typedef
I have some working code with a crutch to add BOM marker to a
I have a large class ClassA that I defined in a Code::Blocks Project ProjectA.
I'm currently working on a program (in C++, using Code::Blocks) that uses a lot
I am working on a project which has no determined algorithm to solve using
I am using SFML, and I am building an application in Code::Blocks and mingw32.
I'm working on a project with some event handling code. Basically, I create a
I had a working project. After rearranging some code, I tried to recompile my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.