Compilation problems encountered by using ice

Source: Internet
Author: User

Before use, you must first set the following:
Add the/GR compilation option enable C ++ rtti.
Add the include of ice, the include of stlport, And the Lib path of ice, and add these paths to the beginning to avoid conflicts with VC.
Add iced. Lib iceutild. lib to link object/library modles.
1. compilation appears

Linking
Link: Fatal error lnk1104: cannot open file "stlport_vc6_static.lib"
Error executing link.exe.

Solution:
Porject-> setting-> C ++-> codegeneration: Set use run-time library = debug multithreaded DLL
2. Compilation

Warning c4005: '_ stlp_debug_check': Macro redefinition

Solution: add the following before including ice/ice. h:Code

# If! Defined (ndebug )&&! Defined (_ stlp_debug)
# DEFINE _ stlp_debug
# Endif

3. Compilation

Error c2065: 'tryentercriticalsection ': Undeclared identifier

Solution:
In stdafx. H, add

# Ifndef _ win32_winnt
# DEFINE _ win32_winnt 0x400
# Endif

4. Compilation

Error lnk2001: unresolved external symbol "_ declspec (dllimport) Public: _ thiscall iceutil: gcrecmutexinit (void)" (_ imp _?? 0gcrecmutexinit @ iceutil @ Qae @ xz)
Error lnk2001: unresolved external symbol "_ declspec (dllimport) Public: _ thiscall iceutil: gcrecmutexinit ::~ Gcrecmutexinit (void) "(_ imp _?? 1gcrecmutexinit @ iceutil @ Qae @ xz)
D

Solution:
Porject-> setting-> link-> Object/library modles: Add iced. Lib iceutild. Lib
5. compilation appears

Error c2061: syntax error: identifier 'SC _ handle'
Error c2061: syntax error: identifier 'service _ status'
Error c2146: syntax error: Missing '; 'before identifier' _ statushandle'
Error c2501: 'service _ status_handle': Missing storage-class or type specifiers
Error c2501: '_ statushandle': Missing storage-class or type specifiers
Error c2146: syntax error: Missing '; 'before identifier' _ status'
Error c2501: 'service _ status': Missing storage-class or type specifiers
Error c2501: '_ status': Missing storage-class or type specifiers

Solution:
Add in stdafx. h or other files

# Include <winsvc. h>

author: Li treasure (http://zhenbaodao51.51.net, http://www.lizhenbao.com, http://www.cnitblog.com/lizhenbao/), reprint please indicate the source
end.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.