Author Topic: Undefined references when linking "devel\wxscintilla.dll"  (Read 15003 times)

Offline ivan_ijh

  • Single posting newcomer
  • *
  • Posts: 7
Undefined references when linking "devel\wxscintilla.dll"
« on: January 07, 2008, 05:04:56 am »
I have a problem linking wxscintilla.

Version: svn build rev 4767

My input (link) libraries are:
"wxmsw28$(WX_SUFFIX)" is actually  "libwxmsw28u.a" and "gdi32" are installed from "wxPack".

I'm using "GNU GCC Compiler" .

And here is a  Built Log:

Quote
-------------- Build: scintilla in Code::Blocks ---------------

Linking dynamic library: devel\wxscintilla.dll
.objs\sdk\wxscintilla\src\PlatWX.o: In function `ZN4Font6CreateEPKciibbb':
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:109: undefined reference to `_imp___ZN19wxEncodingConverter22GetPlatformEquivalentsE14wxFontEncodingi'
.objs\sdk\wxscintilla\src\PlatWX.o: In function `ZN11SurfaceImpl10InitPixMapEiiP7SurfacePv':
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:222: undefined reference to `_imp___ZN8wxBitmapC1Eiii'
.objs\sdk\wxscintilla\src\PlatWX.o: In function `ZN11SurfaceImpl7ReleaseEv':
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:229: undefined reference to `_imp__wxNullBitmap'
.objs\sdk\wxscintilla\src\PlatWX.o: In function `ZN11SurfaceImpl9PenColourE15ColourAllocated':
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:247: undefined reference to `_imp___ZN5wxPenC1ERK8wxColourii'
.objs\sdk\wxscintilla\src\PlatWX.o: In function `ZN11SurfaceImpl11BrushColourE15ColourAllocated':
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:251: undefined reference to `_imp___ZN7wxBrushC1ERK8wxColouri'
.objs\sdk\wxscintilla\src\PlatWX.o: In function `ZN11SurfaceImpl13FillRectangleE10PRectangle15ColourAllocated':
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:293: undefined reference to `_imp___ZN10wxStockGDI6GetPenENS_4ItemE'
.objs\sdk\wxscintilla\src\PlatWX.o: In function `ZN11SurfaceImpl13FillRectangleE10PRectangleR7Surface':
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:298: undefined reference to `_imp___ZN7wxBrushC1Ev'
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:300: undefined reference to `_imp___ZN7wxBrushC1ERK8wxBitmap'
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:302: undefined reference to `_imp___ZN10wxStockGDI9GetColourENS_4ItemE'
D:/cvs_projects/codeblocks/trunk/src/sdk/wxscintilla/src/PlatWX.cpp:302: undefined reference to `_imp___ZN7wxBrushC1ERK8wxColouri'
..........................
(and much more..)


All these symbols exists in link libraries, but without "_imp_" prefix (added later by linker I suppose)



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7699
    • My Best Post
Re: Undefined references when linking "devel\wxscintilla.dll"
« Reply #1 on: January 07, 2008, 08:21:25 am »
All these symbols exists in link libraries, but without "_imp_" prefix (added later by linker I suppose)

The compiler and linker are both involved in creating the "_imp_" prefix. But, I think of it mainly being the compiler; the dllexport and dllimport keywords are used in this.

Which version of wxWidgets are you using?
What steps did you follow to compile it?
Which wxPack file did you download?

I also need to know which version of MinGW is being used?

You can normally get this by running this command for MinGW GCC before version 4.0
The MinGW GCC 4.x versions requires a different command, sometimes.

Code
gcc -v

Tim S

« Last Edit: January 07, 2008, 08:37:56 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ivan_ijh

  • Single posting newcomer
  • *
  • Posts: 7
Re: Undefined references when linking "devel\wxscintilla.dll"
« Reply #2 on: January 07, 2008, 02:29:51 pm »
Which version of wxWidgets are you using?
What steps did you follow to compile it?
Which wxPack file did you download?

I also need to know which version of MinGW is being used?

I tried with two packages of wxWidgets  with same result :
1) 2.8 - from "wxPack_v2.8.7.03.exe"
2) 2.8.7 from "wxWidgets-2.8.7.tar.gz" downloaded from wxWidgets site
and compiled with this miniGW :

Quote
gcc -v
Reading specs from D:/programming/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as -
-host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --
enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shar
ed --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --ena
ble-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-sync
hronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw special)

in C::B  i'm using maybe :

Quote
gcc -v
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=
mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable
-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --e
nable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-ja
va-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchroniz
ation --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.4 (mingw special)

Well..wxPack as I know, it is not necessary to build anything.


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: Undefined references when linking "devel\wxscintilla.dll"
« Reply #3 on: January 07, 2008, 02:45:05 pm »
I have a problem linking wxscintilla.
Try moving the wxscintilla lib before and after the wx lib (I don't recall what's right - but only *one* way is correct). The order of libraries that depend on each other matters in the linker settings!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7699
    • My Best Post
Re: Undefined references when linking "devel\wxscintilla.dll"
« Reply #4 on: January 07, 2008, 06:37:49 pm »
gcc version 3.4.4 (mingw special)

Where did you get gcc version 3.4.4 (mingw special)?
Edit: Found it, RC2 had 3.4.4 with it.
I am downloading it now to test with wxPack.

I am still testing, but it appears to be an issue in the compiler gcc version 3.4.4 (mingw special) at first testing.

The wxPack works OK, so the issue is the compiler; please upgrade to 3.4.5 to use that wxPack.

Tim S
« Last Edit: January 07, 2008, 09:26:46 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ivan_ijh

  • Single posting newcomer
  • *
  • Posts: 7
Re: Undefined references when linking "devel\wxscintilla.dll"
« Reply #5 on: January 09, 2008, 02:33:07 am »
PROBLEM RESOLVED

 and C::B successfully built. I found that there is a two directories for library (object)  files :
"gcc_dll" and "gcc_lib" with same libraries inside. But the libraries in "gcc_dll" have names (symbols) with "_imp_" prefix and the libraries in "gcc_dll" doesn't have names with this prefix.

For example in  gcc_dll/libwxmsw28.a
__imp__wxTopLevelWindows
and in gcc_lib/libwxmsw28.a same symbol is
_wxTopLevelWindows

I just changed linker option directories from 
"$(#WX.lib)\gcc_lib$(WX_CFG)\msw$(WX_SUFFIX)" to
"$(#WX.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX)" .

Yes...it was all MY FAULT, because I changed this option before - when I tried to guess the correct libraries directory. Thanks for help anyway. Sorry ! :cry:
« Last Edit: January 09, 2008, 02:38:33 am by ivan_ijh »