Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: mrkaban on July 11, 2017, 05:55:39 pm

Title: undefined reference to `GetSaveFileNameA@4'|
Post by: mrkaban on July 11, 2017, 05:55:39 pm
Hello dear forum users! Just want to apologize for my English. Also I apologize for being just a beginner.

Faced such a mistake
Quote
\main.cpp|198|undefined reference to `GetSaveFileNameA@4'|

Here is the function in which the problem arises
Code
void newGradebookDialog( HWND hwnd, TCHAR file[] )
{
   OPENFILENAME ofn;

  TCHAR saveFileName[MAX_PATH] ="";

   ZeroMemory( &ofn, sizeof( ofn ) );

    ofn.lStructSize = sizeof(OPENFILENAME);
    ofn.hwndOwner = hwnd;
    ofn.lpstrFilter = "CSV File (*.csv)\0*.csv\0";
    ofn.lpstrFile = saveFileName;
    ofn.nMaxFile = MAX_PATH;
    ofn.lpstrDefExt = "csv";
    ofn.Flags  = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
    ofn.lpstrTitle = "Export to CSV";

 if(GetSaveFileName(&ofn))
  strcpy(file,saveFileName);
}

Yes, the development environment points to the next line

Code
if(GetSaveFileName(&ofn))

Thankful in advance for any help! If the topic did not create the right place, I apologize.
Title: Re: undefined reference to `GetSaveFileNameA@4'|
Post by: stahta01 on July 11, 2017, 06:18:27 pm
Read the rules and look to this link http://www.cplusplus.com/forum/windows/72278/ (http://www.cplusplus.com/forum/windows/72278/)

Link to rules http://forums.codeblocks.org/index.php/topic,9996.0.html

If  you can NOT figure out where to enter the library name ask in this thread.

Tim S.
Title: Re: undefined reference to `GetSaveFileNameA@4'|
Post by: mrkaban on July 12, 2017, 01:59:54 pm
Thank you very much! I'm sorry, I could not find this page myself.

Thank you very much, it helped!