Re: [Dev-C++] Strange linking problem (?)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Billiam <bon...@ya...> - 2004-08-19 22:01:23
|
Do you have all the libraries linked to it that you should have? That might be the problem, but Im not sure.
Hielke <hie...@he...> wrote:Hi all,
During the compilation of the following constructor I get a "'GetInstance' undeclared" error. However I included an headerfile which includes the appropriate header (windows.h) to use that function.
// topwindow1.cc
#include "windowwrappers.ih"
TopWindow::TopWindow(WindowClass &winClass, int resId)
:
Window(winClass)
{
d_style = WS_OVERLAPPEDWINDOW;
HINSTANCE hInst = GetInstance();
d_windowName = ResourceString(hInst, resId);
}
// windowwrappers.ih
#include "window.h"
#include "topwindow.h"
#include "../winexception.h"
#include "../resourcestring.h"
#include <windows.h>
I don't get why it won't compile. Especially because I use the very same function in a classmember of another class:
// setdefaults.cc
#include "classwrappers.ih"
void WindowClass::SetDefaults()
{
/* <some code> */
d_class.lpszClassName = GetName();
d_class.hInstance = GetInstance();
/* <some more code> */
}
// classwrappers.ih
#include "simplewindowclass.h"
#include "windowclass.h"
#include "topwindowclass.h"
#include "../resourcestring.h"
#include "../winexception.h"
#include <windows.h>
#include <string>
Note that I use a nonstandard extension for the headerfiles (following the "internal header" approach where classmembers include a common headerfile (which in turn includes the header containing classdeclaration)). This might be the cause of linker problems when using Dev-C++ but I already tried projectfile options. Currently the *.ih files are neither included during compilation nor during linkingprocess.
Thanks in advance. Hope somebody sees what I'm doing wrong.
Regards,
Hielke
zw...@he...
---------------------------------
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers! |