Compiler GetOpenFileName(&ofn) me donne cette erreur :

||=== Build: Debug in Mycologie (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `Z15WindowProcedureP6HWND__jjl@16':|
C:\Users\Public\Documents\Champignons\Mycologie\main.cpp|125|undefined reference to `GetOpenFileNameA@4'|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
J'ai la même erreur avec BCC55 que MinGW (GCC) sur deux PC (Windows 10 et Windows Vista).

Je n'ai pas trouvé de solution sur le forum…

Merci pour votre aide



Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
OPENFILENAME ofn;
                            CHAR szFile[MAX_PATH]={0};
 
                            ZeroMemory(&ofn, sizeof(OPENFILENAME));
                            ofn.lStructSize = sizeof(OPENFILENAME);
                            ofn.hwndOwner = hwnd;
                            ofn.lpstrFile = szFile;
                            ofn.nMaxFile = MAX_PATH;
                            ofn.lpstrFilter =
                                       "Fichier source C\0*.c\0Fichier source CPP\0*.cpp\0";
                            ofn.nFilterIndex = 1;
                            ofn.Flags =
                                   OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
 
                            if (GetOpenFileName(&ofn)==TRUE)