WTL and STL 
Author Message
 WTL and STL

To All,

When I compile a WTL project in release mode with some STL object like
BASIC_STRING which uses <string> , I get the following compile error:

Linking...
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Release/pixReader.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

This problem does not appears in debug mode, Is anyone else encounter this
problem?

thansk




Tue, 04 Nov 2003 23:23:23 GMT  
 WTL and STL
Hello,

<msdn>
_ATL_MIN_CRT and Link Error "unresolved external symbol _main":

When you build a Release version of an ATL project, you can get the
following link error:
LIBCMT.LIB(crt0.obj) : error LNK2001: unresolved external symbol _main
This error occurs if you are using CRT functions that require CRT startup
code. The Release configuration defines _ATL_MIN_CRT, which excludes CRT
startup code from your EXE or DLL.

To avoid this error, do one of the following:

Remove _ATL_MIN_CRT from the list of preprocessor defines to allow CRT
startup code to be included. On the Project menu, click Settings. In the
Settings For: drop down list, choose Multiple Configurations. In the Select
project configuration(s) to modify dialog box that appears, click the check
boxes for all Release versions, and then click OK. On the C/C++ tab, choose
the General category. Remove _ATL_MIN_CRT from the Preprocessor definitions
edit box.

If possible, remove calls to CRT functions that require CRT startup code.
Instead, use their Win32 equivalents. For example, use lstrcmp instead of
strcmp. Known functions that require CRT startup code are some of the string
and floating point functions.
</msdn>

--
Best regards,
Vadim Melnik,
{*filter*} Consultant.
_____________________
http://www.*-*-*.com/


Quote:
> To All,

> When I compile a WTL project in release mode with some STL object like
> BASIC_STRING which uses <string> , I get the following compile error:

> Linking...
> LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
> Release/pixReader.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.

> This problem does not appears in debug mode, Is anyone else encounter this
> problem?

> thansk





Tue, 04 Nov 2003 23:52:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. WTL - Very new to WTL - Trying to insert new COM object in WTL

2. ATL+WTL+STL versus MFC

3. wtl, CString, and the stl

4. Differences between MFC/ATL/WTL/STL

5. wtl, CString, and the stl

6. WTL: Printing like Petzold using WTL? (and getting up-to-date WTL?)

7. Conflict between VC 7 STL and SGI STL - how to resolve

8. ATL conflict between VC 7 STL and SGI STL - how to resolve

9. typedef'ing iterators in MSVC's STL (not the HP STL)

10. MFC + STL < STL

11. STL Newbie: STL maps

12. Porting code from SGI STL to MSVC STL

 

 
Powered by phpBB® Forum Software