what this means?

  • Thread starter Thread starter kathy
  • Start date Start date
K

kathy

In my C++.NET Class library project, I called a dll by using:

#using "My_Win32_Dll.dll"

But when I build the project, I got:

"c:\DotNET\C++\C++_Solution\MyClassLib\MyClassLib.h(5): fatal error
C1192: #using failed on
'c:\dotnet\c++\c++_solution\myclasslib\my_win32_dll.dll'
"

What is the problem?
 
kathy said:
In my C++.NET Class library project, I called a dll by using:

#using "My_Win32_Dll.dll"

But when I build the project, I got:

"c:\DotNET\C++\C++_Solution\MyClassLib\MyClassLib.h(5): fatal error
C1192: #using failed on
'c:\dotnet\c++\c++_solution\myclasslib\my_win32_dll.dll'

#using is for importing managed assemblies only. If My_Win32_Dll is a native
(unmanaged) DLL, you need to use it the traditionnal C++ way :
- #include the header file.
- Add the library import file (.lib) to the linker input in project
properties.

Arnaud
MVP - VC
 
Thank you for your reply.

I did as what you said. But still got error. What is wrong?

"MyClassLib error LNK2001: unresolved external symbol "void * __cdecl
operator new(unsigned int)" (??2@$$FYAPAXI@Z)"

and

"MyClassLib error LNK2001: unresolved external symbol __DllMainCRTStartup@12"

What I have done is:
1. Use the wizrd to generate a Class Library Project.
2. Change the project to mixed mode.
3. Call Win32 dll which have exported function: f(int m,int n)

To change the project to mixed mode, I did:

1. Add /noentry to the Additional Options field of the Command Line page.
2. Add msvcrt.lib to the Additional Dependencies field of the Input page.
3. Remove nochkclr.obj from the Additional Dependencies field of the Input
page.
4. Add __DllMainCRTStartup@12 to the Force Symbol Reference field of the
Input page.
 
Delete that line completely. Then right-click on the project's References
folder and use the Add Reference feature to add your library.
 
Back
Top