From: SF/projects/mingw n. l. <min...@li...> - 2012-10-19 16:34:33
|
Bugs item #3439065, was opened at 2011-11-16 14:39 Message generated for change (Settings changed) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3439065&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc >Group: Known Feature >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: method incorrectly identified Initial Comment: I am trying to compile some stripped down Scintilla component, but i get the error: sciedit.o:sciedit.cxx:(.text$_ZN16TScintillaEditor6searchEPKct+0x84): undefined reference to `Document::FindTextA(int, int, char const*, bool, bool, bool, bool, int, int*, CaseFolder*)' but I have no FindTextA method defined in the Document class, only FindText instead; I think it's because the method is mistook for the Windows function FindText, and renamed accordingly when referenced. This is the compile/link command: g++ -shared -Wl,--enable-runtime-pseudo-reloc-v2 -mno-cygwin -mwindows --relocatable -o ../bin/Scintilla.dll -s sciedit.o CellBuffer.o CharacterSet.o CharClassify.o ContractionState.o Decoration.o Document.o KeyMap.o PerLine.o PropSetSimple.o RESearch.o RunStyles.o ScintRes.o PlatTV.o Selection.o UniConversion.o -DNDEBUG -Os -ffunction-sections -fdata-sections -Wall -Wno-missing-braces -Wno-char-subscripts -Wno-strict-overflow -pedantic -I ../include -I ../src -I../lexlib -Id:\devel\tvision\include -fno-rtti -mno-cygwin -L"D:\devel\tvision\lib\gcc_dll" -ltvision -lstdc++ -luuid -Wl,--out-implib=../bin/libscintilla.a The symbol in the sciedit.o file appears to be __ZN8Document9FindTextAEiiPKcbbbbiPiP10CaseFolder But, if I remove the "#include <windows.h>" from the sciedit.cxx I get a compiler error: sciedit.cxx: In member function 'bool TScintillaEditor::search(const char*, ushort)': sciedit.cxx:818:15: error: 'class Document' has no member named 'FindTextA' I guess these problems would arise for whatever other method has a Win32 API similar name - haven't tried that, though. ---------------------------------------------------------------------- Comment By: https://www.google.com/accounts () Date: 2011-11-17 06:02 Message: Ok, but the macro replacement doesn't happen in the module defining the class, and it is also including <windows.h>. So the method is correctly compiled as FindText. Anyway, I have already considered undefing the macro, but that was after the post. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2011-11-17 04:50 Message: Maybe you can get by with defining WINDOWS_LEAN_AND_MEAN before including windows.h. FindText is defined in commdlg.h which isn't included if this macro is defined. The other option is to #undef FindText after including windows.h. This really isn't a compiler bug nor is it a runtime header bug. Welcome to the world of MACRO hell caused by the world of Microsoft Windows API. ---------------------------------------------------------------------- Comment By: https://www.google.com/accounts () Date: 2011-11-16 16:38 Message: later edit: it seems that the preprocessor comes in and replaces the call to pDoc->FindText(..) with pDoc->FindTextA(..) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3439065&group_id=2435 |