I wonder why the linker is always searching these libraries, and where I can switch that off. I can imagine why kernel32 is linked, but what do I need gdi for in a dos app and odbc and so on? cheers Ingo
2. Problem with DLL, static LIB and static data
3. Linking to a static field in a static lib
I can't seem to find out how to put static fields in static libs
without linker errors. If I move the definition (here:
static int missing;) out of the class, it links fine, but it
seems a bit awkward I can't put it in the class. I can't find
the magic words that give a static field the same kind of
linking as a global variable.
I have this boiled-down "solution" with projects P and Q.
P is a static library, Q is a console app that depends on P.
The files are:
P\MyClass.h:
class MyClass
{
public:
static int missing;
static void initialize(void);
};
P\MyClass.ccp:
#include "MyClass.h"
void MyClass::initialize(void)
{
missing = 0;
}
Q\Q.cpp:
#include "stdafx.h"
#include "..\P\MyClass.h"
int _tmain(int argc, _TCHAR* argv[])
{
MyClass::initialize();
return 0;
}
and the linker error message is:
p.lib(MyClass.obj) : error LNK2019: unresolved external symbol
"public: static int MyClass::missing"
(?missing@MyClass@@2HA)
referenced in function
"public: static void __cdecl MyClass::initialize(void)"
(?initialize@MyClass@@SAXXZ)
4. Having to manually include lib for component - Borland C++ Builder VCL Components
5. Problem in using c# dll having resources(forms) in VC++
Dear All, I have created a c# dll having resource files. I am trying to use this dll in VC++ project. I have done following steps: 1. Convert the dll to .tlb file using regasm tool provided by .NET 2. Through Project-->AddClass Menu created classes from type library and added in the project. 3. When we compile the project it gives following errors: Error 1 error C2146: syntax error : missing ';' before identifier 'GetType' d:\classlibrary3\vc++app\debug\class3.tlh 62 Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\classlibrary3\vc++app\debug\class3.tlh 62 Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\classlibrary3\vc++app\debug\class3.tlh 62 Error 5 error C2143: syntax error : missing ';' before '_Class1::GetType' d:\classlibrary3\vc++app\debug\class3.tli 35 Error 6 error C2433: '_TypePtr' : 'inline' not permitted on data declarations d:\classlibrary3\vc++app\debug\class3.tli 35 Error 7 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\classlibrary3\vc++app\debug\class3.tli 35 Error 8 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\classlibrary3\vc++app\debug\class3.tli 35 Error 9 error C2064: term does not evaluate to a function taking 2 arguments d:\classlibrary3\vc++app\debug\class3.tli 39 Can somebody help me in resolving this issue. Thanks In Advance Rajani
6. Having trouble with multiple threads and a shared resource - CSharp/C#
7. having problem enumerating resources [syntax error: '__stdcall']
Hi,
I am having problem with line 13. It gives me syntax error saying
'__stdcall'. I am trying to find all the bitmap resource that current
application uses. I can't find a good doc. or relevant posting that
discussed this. Please let me know what I'm doing wrong. Thanks in advance.
Rajib
01. BOOL CALLBACK MyDlg::BitmapEnumProc(HMODULE hModule, LPCSTR lpszType,
02. LPSTR lpszName, LONG_PTR lParam)
03. {
04. AfxMessageBox(lpszName);
05. return TRUE;
06. }
07.
08. void MyDlg::OnAboutApp()
09. {
10. CAboutDlg aboutDlg;
11. LONG_PTR lParam=0;
12. //////// getting error on this function call
13. EnumResourceNames(NULL, RT_BITMAP, (CALLBACK*
ENUMRESNAMEPROCA)BitmapEnumProc, lParam);
14. aboutDlg.DoModal();
15. }