Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9231031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:58:10+00:00 2026-06-18T05:58:10+00:00

I’m trying to create a PHP extension for Windows, using the Visual Studio Express.

  • 0

I’m trying to create a PHP extension for Windows, using the Visual Studio Express. I started the extension from scratch and had just test.cpp file, where I wrote some code. Although the code compiled and worked well, during compilation it produced several warnings, I’d rather get rid of.

I reduced the file to a single line, which reproduces those warnings:

#include "php.h"

Building such an empty DLL I get:

>Compiling...
>test.cpp
>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(620) : warning C4273: 'getwchar' : inconsistent dll linkage
>        C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(435) : see previous definition of 'getwchar'
>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(622) : warning C4273: 'putwchar' : inconsistent dll linkage
>        C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(437) : see previous definition of 'putwchar'

What is the proper way to fix these two warnings?

I’ve tried to investigate the issue, and checked if I forgot some preprocessor directive. But I couldn’t find anything applicable to influence that stdio.h properly.

Here is the list of my preprocessor directives, as set up in the project configuration:

WIN32
NDEBUG
_WINDOWS
_USRDLL
TEST_EXPORTS
PHP_WIN32
ZEND_WIN32
ZTS=1
ZEND_DEBUG=0

Inherited values:
_WINDLL
_UNICODE
UNICODE

It looks pretty same as other PHP projects have. I’ve also studied the stdio.h, but haven’t found appropriate preprocessor directives to set.

So, the main question is divided into smaller questions:

  1. What is the PHP authors’ intent – should I have those
    getwchar() and putwchar() functions imported or declared inline? stdio.h tries to do that simultaneously.
  2. Have I missed some preprocessor directive to set?
  3. Do I have to include some win32-specific header files from PHP sources?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:58:11+00:00Added an answer on June 18, 2026 at 5:58 am

    Eventually I managed to find the issue – that was the .cpp extension, which caused the file to be compiled as C++, while the PHP is written in plain C.

    The simplest solution is just to rename file to have .c extension. And, of course, write the source in C.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am using jsonparser to parse data and images obtained from json response. When
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.