VC++ 10 gives error when libraries and headers related to libcurl are added to project.Even if curl.h is not included in the code,
C2065 undeclared identifier _SH_DENYNO //this is in xiosbase...
the above error comes.
Is there a problem as there is no libcurl version for vc++ 10? ....libcurl works fine in vc++ 6.
Any help would be great.
Thanks in advance,

Prasanna

Dani AI

Generated

This error is almost always an include-path collision rather than a missing VC++10 build of libcurl. libcurl’s source tree contains an internal header named share.h; if the compiler finds that file before Microsoft’s <share.h> the _SH_DENYNO macro (used by MSVC’s iostream headers) won’t be defined and you get C2065 from xiosbase. See the curl source lib/share.h for the file that can clash. ()
The symbol _SH_DENYNO itself is defined by Microsoft in <share.h> (that’s why the C++ runtime expects it). (learn.microsoft.com)

Two quick diagnostics and why they matter: check the compiler include search order and print the include tree. MSVC searches /I include paths in the order provided, so an overly-broad curl source path placed early will hide system headers. (stackoverflow.com)
Turn on the compiler’s include trace (Project → Properties → C/C++ → Advanced → Show Includes or cl /showIncludes) and inspect which share.h is being picked up. That will quickly prove the collision. (stackoverflow.com)

Practical fixes (in order of least to most invasive):

  • Remove any curl source or lib/ directory from your project include paths; only add the public headers folder (the folder that contains curl/curl.h). Example:

    /* wrong — exposes lib/share.h to the compiler */
    Additional Include Directories: C:\curl-src\
    
    /* right — only public headers */
    Additional Include Directories: C:\curl-src\include\curl
  • If you must keep a path that contains share.h, move it after the system includes or reorder the /I entries so MSVC’s include directories are searched first. (stackoverflow.com)

  • As a last resort when you control the libcurl build, avoid installing or exposing the internal share.h (rename it locally or adjust the install layout) and rebuild — several projects have renamed internal share.h to avoid this exact clash. (git.chylex.com)

A quick confirm step: remove the curl include path entirely and rebuild. If the C2065 goes away, the include-path collision is confirmed. — this explains why the error appears even when curl.h isn’t explicitly included. ’s suggestion to use prebuilt binaries is still valid (they usually install headers in the correct layout), but the immediate fix is to correct the include path or rebuild with a non-conflicting layout.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.