Code::Blocks Forums
User forums => Help => Topic started by: 19bernardo87 on October 03, 2008, 09:58:23 pm
-
Hi, I'm fairly new to API's (and programming in general) and recently started on windows.
I'm attempting to use the OPENFILENAME struct, unfortunately I get an Undefined Reference error when I try to use the function GetOpenFileName: it seems that I need to link with comdlg32.lib.
I do so by specifying in "Build Options"-"Linker Settings" and Adding "..\..\..\..\..\watcom-1.3\lib386\nt\comdlg32.lib" to "Link Libraries."
However I now get this error:
..\..\..\..\..\watcom-1.3\lib386\nt\comdlg32.lib: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings
Also, for learning purposes, I'd like to know if I understand this.
The reason I get undefined reference is because the header file <windows.h> only contains the declaration of the function, its definition lies inside of comdlg32.lib, which is a set of source of files put together more or less. Are these pre-compiled (already in object code, .o) and the linker just puts them together?
-
What compiler / OS / C::B version do you use (exactly)?
You don't mix compilers, right?! "collect2" seems to me like coming from GCC compilers suite but you try to use library components from Watcom?!
-
What compiler / OS / C::B version do you use (exactly)?
You don't mix compilers, right?! "collect2" seems to me like coming from GCC compilers suite but you try to use library components from Watcom?!
You are correct, I wasn't aware static libraries were compiler specific. Thanks a bunch. =D