Enabling Exception handling causes Linker error, help! 
Author Message
 Enabling Exception handling causes Linker error, help!

Hello,

I am compiling a sample project I got from a book on ATL COM.  It is a
simple ATL COM object with Dual Interfaces that compiles and links to a
DLL successfully.  If I do nothing else but enable "Enable Exception
Handling" from the project settings window, I get the following linker
error:

Linking...
   Creating library ReleaseUMinDependency/Simple.lib and object
ReleaseUMinDependency/Simple.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseUMinDependency/Simple.dll : fatal error LNK1120: 1 unresolved
externals
Error executing link.exe.

I need to enable exception handling because I intend to use the STL in
modifications I am going to make to the sample project.  Can anyone tell
me why this is happening and how to fix it?

Thanks.



Mon, 24 Sep 2001 03:00:00 GMT  
 Enabling Exception handling causes Linker error, help!
Are you using VC6.0? If so, it'smost likely a known problem with the default ATL
project created. If you use a CRT function that requires the CRT startup code,
you'll get the error, because by default, the project has  _ATL_MIN_CRT defined.
To remove it, go to project -> settings -> C/C++ and remove the _ATL_MIN_CRT
definition from the "Preprocessor Definitions" box.

--
Tomas Restrepo

http://members.xoom.com/trestrep/


Quote:
> Hello,

> I am compiling a sample project I got from a book on ATL COM.  It is a
> simple ATL COM object with Dual Interfaces that compiles and links to a
> DLL successfully.  If I do nothing else but enable "Enable Exception
> Handling" from the project settings window, I get the following linker
> error:

> Linking...
>    Creating library ReleaseUMinDependency/Simple.lib and object
> ReleaseUMinDependency/Simple.exp
> LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
> ReleaseUMinDependency/Simple.dll : fatal error LNK1120: 1 unresolved
> externals
> Error executing link.exe.

> I need to enable exception handling because I intend to use the STL in
> modifications I am going to make to the sample project.  Can anyone tell
> me why this is happening and how to fix it?

> Thanks.



Tue, 25 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to enable C++ style Exception Handling

2. HUGE causes linker error

3. using _variant_t rather than _bstr_t causing linker error LNK2005

4. ADO property causes linker error

5. pure virtual destructor causes linker error

6. return Error object from Activate Method Causes Exception

7. Stepping into a class function causes exception error: access violation

8. What causes this unhandled exception error?

9. What causes this unhandled exception error?

10. Q: Error (Exception) handling in C (not C++)

11. Error in fp-exception handling?

12. Help: Truncate text causes exception in release, but not debug

 

 
Powered by phpBB® Forum Software