dll and console app problem? 
Author Message
 dll and console app problem?

I wrote a dll using vc++ 5.0 and now I am trying to write a quick test
console app to test it.  But, I keep getting this error here when I try to
compile the console app
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol
__endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol
__beginthreadex
dlluse__/dlluse.exe : fatal error LNK1120: 2 unresolved externals

The dll project compiles fine?  
What's haps?  I am not using MFC at all.



Mon, 04 Jun 2001 03:00:00 GMT  
 dll and console app problem?
You should have gotten a .LIB when you made your .DLL.  The LIB needs to by
specified (with location if you don't put it in the "lib" directory) among
your linker project options.

And you need to declare the DLL functions as "__declspec (dllimport)" in
your EXE source (or some header in your EXE project)

There's also the question of "name-mangling" which can be overcome (among
other ways) by including a .DEF in your DLL's project and by specifying
therein the exported DLL functions using their "normal" (undecorated) names.
DEF files are (can be) easy; here's a little one; the three function names
are just the names I used in the DLL source:

NAME CONSCRL.DLL

EXPORTS
        hookproc
        SetTheHook
        SetControlPid

 - Vince

Quote:

>I wrote a dll using vc++ 5.0 and now I am trying to write a quick test
>console app to test it.  But, I keep getting this error here when I try to
>compile the console app
>Linking...
>nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol
>__endthreadex
>nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol
>__beginthreadex
>dlluse__/dlluse.exe : fatal error LNK1120: 2 unresolved externals

>The dll project compiles fine?  
>What's haps?  I am not using MFC at all.

___
   Vincent Fatica
   Syracuse University Mathematics

   http://barnyard.syr.edu/~vefatica/


Tue, 05 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. console app + Dialog DLL problems

2. DLL initialization problem in console app

3. Need help converting a console app to windows app with a DLL

4. Building a console app that doesn't require mscoree.dll in Visual C++ .NET

5. About converting Console App to DLL

6. DLL: recognising windows or console app. calls

7. Writing to an _iobuf in a DLL called from a multithreaded console app

8. Invoking a console app and hiding the console.

9. problems with database access via ODBC in console app

10. basic problem in console app

11. Problem linked console App

12. Console App --- Problem solved

 

 
Powered by phpBB® Forum Software