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 6832203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:49:48+00:00 2026-05-26T22:49:48+00:00

I have a small C++ library, compiles fine on Linux (which is my main

  • 0

I have a small C++ library, compiles fine on Linux (which is my main dev platform). Now I’m trying to build it on a windows machine (XP3) with Mingw, and compiling fails, due to an unexplainable error.
For example, say I have the following method in class AAA, in namespace aaa, declared in file aaa.h:

void AAA::DrawText( foo z );

When compiling file aaa.cpp (that holds of course the methods implementation), I get the following error:

D:\dev\[...]\aaa.cpp:644: error: no 'void aaa::AAA::DrawTextA( foo z )' member function declared in class 'aaa::AAA'

Yep, you got it, no typo there… the compiler misread somehow the functions name, and added a letter to the function identifier !!!

This is absolutely beneath my comprehension. Never had such an issue on Linux. How can mingw / Gcc change an identifier ?

Name mangling ? No, this happens after compiling.

I checked of course the exact command line (I use an IDE): nothing wrong:

mingw32-g++.exe -W  -O3 -Wall    -I..\include -I"C:\program files\OpenCV2.1\include\opencv"  -c D:\dev\...\aaa.cpp -o ..\obj\Release\src\aaa.o

BUT: if I rename the function to, say, DrawTxt(), then everything goes fine (but I can’t do that). This means to me that the identifier is already defined somewhere. Opencv lib ? Grepped the tree, found nothing… And yes, I searched also the current include folder, nothing close.

The other solution that I see is that there is somewhere (?) a macro like:

#define DrawText DrawTextA

that gets activated in some situation.

So my questions are:

  • Are there other possibilities for this curious name replacement in my code ? To me, the macro is the only way, if the identifier was already declared elsewhere, it would just throw an error, a compiler can not (well…) abruply change/replace/edit an identifier.
  • How can I trackdown the problem ?
  • 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-05-26T22:49:49+00:00Added an answer on May 26, 2026 at 10:49 pm

    Well, I’m almost certain it’s because somewhere this happens:

    #define DrawText DrawTextA
    

    Why? Because the suffix A often means “ascii” opposed to the suffix W which means “wide” (often for unicode). This is a common practice in Windows code to unify ascii and unicode builds with a simple define switch.

    Also, it seems that the functions exists in the Windows library: http://msdn.microsoft.com/en-us/library/ms901121.aspx. Is windows.h is included in your project?

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

Sidebar

Related Questions

we're building a cross-platform utility which must have a small footprint. We've been pulling
I have this small code library that I'm considering releasing into Open Source. I
I have an ActionScript 2.0 file that contains a small library. This library parses
I have small page which has label, DropDownList and a submit button. <div> <asp:label
I have small web app that generate PDF files as a report. I'm trying
I have a small project where I need just part of boost library, boost::regex
I'm trying to compile a small OpenCV program using Eclipse. I'm limited in library
We wrote a small Windows class library that implements extension methods for some standard
I have been developing a library that is getting pretty large, and now I
I'm working on a small library for our in-company use, and have been heavily

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.