CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Unresolved external symbol ___iob_func libcurl.x86.lib

  1. #1
    Join Date
    Dec 2017

    Unresolved external symbol ___iob_func libcurl.x86.lib

    I am trying to compile a project with visual studio 2017 and I'm getting the error:

    	libcurl.x86.lib(mprintf.obj) : error LNK2001: unresolved external symbol ___iob_func
    It seems libcurl is compiled with an older compiler. I added legacy_stdio_definitions.lib to Project Properties to use the old functionality, but I'm still getting the error.

    I also added:
    	#ifdef __cplusplus
    	#define EXTERN_C extern "C" {
    	#define EXTERN_C_END }
    	#define EXTERN_C
    	#define EXTERN_C_END
    	In other files:
    		struct _iobuf {
    				char *_ptr;
    				int   _cnt;
    				char *_base;
    				int   _flag;
    				int   _file;
    				int   _charbuf;
    				int   _bufsiz;
    				char *_tmpfname;
    		typedef struct _iobuf FILE;
    		typedef struct _iobuf
    			void* _Placeholder;
    		} FILE;
    		_ACRTIMP_ALT FILE* __cdecl __acrt_iob_func(unsigned);
    		#define stdin (__acrt_iob_func(0))
    		#define stdout (__acrt_iob_func(1))
    		#define stderr (__acrt_iob_func(2))

    still the same.

    The project is written in C

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012

    Re: Unresolved external symbol ___iob_func libcurl.x86.lib

    How did you obtain curl? Did you download a windows package or the source? If you downloaded a windows package, be aware that these are for the mingw compiler and not MS VS. I haven't tried these with MS VS but I suspect you'll need to download the source and compile them yourself with MS VS to make the libcurl.dll & libcurl.lib files. The supplied curl.exe program should be OK.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.2.2)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)