Cygwin error (undefined reference to `_IID_IPersistFile')

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
augustus
In need of some credit
In need of some credit
Posts: 1
Joined: Wed Feb 08, 2012 8:22 pm

Cygwin error (undefined reference to `_IID_IPersistFile')

Post by augustus »

So, I've been trying to get wxWidgets to compile in Cygwin (v1.7.9), and I've been running into a problem I don't know how to fix. Basically, I'm directly following the instructions for "Using configure" in /wxWidgets-2.9.3/docs/msw/install.txt.

Running the command, "../configure --with-msw --enable-debug --enable-debug_gdb --disable-shared", results in the following output:

Code: Select all

Configured wxWidgets 2.9.3 for `i686-pc-cygwin'

  Which GUI toolkit should wxWidgets use?                 msw
  Should wxWidgets be compiled into single library?       no
  Should wxWidgets be linked as a shared library?         no
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.6      no
                                       wxWidgets 2.8      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               sys
                                       png                sys
                                       regex              builtin
                                       tiff               sys
                                       zlib               sys
                                       expat              sys
                                       libmspack          no
                                       sdl                no
Since that seems okay, I proceed to call make. It goes along for quite some time, and eventually halts with the following error:

Code: Select all

...
(if test -f utils/wxrc/Makefile ; then cd utils/wxrc && make all ; fi)
make[1]: Entering directory `/cygdrive/c/wxWidgets-2.9.3/build-debug/utils/wxrc'
g++ -o wxrc.exe wxrc_wxrc.o    -L/cygdrive/c/wxWidgets-2.9.3/build-debug/lib    -lwx_baseu_xml-2.9 -lexpat -lwx_baseu-2.9     -lwxregexu-2.9  -lz -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 -lkernel32 -luser32  -lz -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 -lkernel32 -luser32
/cygdrive/c/wxWidgets-2.9.3/build-debug/lib/libwx_baseu-2.9.a(baselib_filename.o):/cygdrive/c/wxWidgets-2.9.3/build-debug/../src/common/filename.cpp:1602: undefined reference to `_IID_IPersistFile'
collect2: ld returned 1 exit status
make[1]: *** [wxrc.exe] Error 1
make[1]: Leaving directory `/cygdrive/c/wxWidgets-2.9.3/build-debug/utils/wxrc'
make: *** [wxrc] Error 2
As far as I can tell, that sort of error generally indicates that a wrong library is being used, or the libraries are being linked out of order. However, nothing I've tried has had any (positive) effects.

Does anyone happen to have any idea what I'm doing wrong?

Thanks!
bob2012resolution
In need of some credit
In need of some credit
Posts: 1
Joined: Tue Mar 20, 2012 8:25 am

Re: Cygwin error (undefined reference to `_IID_IPersistFile'

Post by bob2012resolution »

I have the same problem. Have you or anyone found a solution to this?
Any help would be great.

Thanks =)
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: Cygwin error (undefined reference to `_IID_IPersistFile'

Post by Auria »

Google found this : http://cygwin.com/ml/cygwin-apps/2010-11/msg00045.html

this sounds very relevant
"Keyboard not detected. Press F1 to continue"
-- Windows
jmadom
In need of some credit
In need of some credit
Posts: 5
Joined: Thu Sep 26, 2013 7:20 am

Re: Cygwin error (undefined reference to `_IID_IPersistFile')

Post by jmadom »

on following post i put a path to solve compile probles with wxWidgets on cygwin
viewtopic.php?f=19&t=36040&p=168576#p168576

Basically problem is libuuid-devel is installed on cygwin environment and put new libraries and header files to uuid development.
When gcc try to compile, link against /lib/libuuid.dll.a and not with /lib/w32api/libuuid.a.

I am not a cygwin expert and dont know why _IID_IPersistFile are defined on w32api static library but not in libuuid.dll.a.

To solve undefined references to uuid, please set LDFLAGS to compile /lib/w32api static libraries

export CPPFLAGS='-w -fpermissive -D__USE_W32_SOCKETS'; export LDFLAGS='-L /lib/w32api/'; ./configure --prefix=/usr/local --with-msw
hamishmb
Knows some wx things
Knows some wx things
Posts: 29
Joined: Mon Jul 08, 2019 8:48 pm
Location: /usr/lib/python3/

Re: Cygwin error (undefined reference to `_IID_IPersistFile')

Post by hamishmb »

Okay, so using these options helped:

Code: Select all

CPPFLAGS='-w -fpermissive -D__USE_W32_SOCKETS' LDFLAGS='-L /lib/w32api/' ./configure --enable-debug
But it now gets stuck a little bit later:

Code: Select all

g++ -shared -o /home/Hamish/wxwidgets-build/wxWidgets-3.0.4/lib/cygwxmsw30u_gl_gcc_custom-0.dll gldll_version_rc.o gldll_glcmn.o gldll_msw_glcanvas.o    -L/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/lib  -Wl,--out-implib=/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/lib/libwx_mswu_gl-3.0.dll.a   -L /lib/w32api/ -lGLU        -lpng -lz -ljpeg -ltiff  -lwxregexu-3.0  -L /lib/w32api/ -lGLU   -lz -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 -lkernel32 -luser32  -lwx_mswu_core-3.0 -lwx_baseu-3.0  -lopengl32 -lglu32 -lz -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 -lkernel32 -luser32
gldll_glcmn.o: In function `ZN14wxGLCanvasBase9SetColourERK8wxString':
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:76: undefined reference to `glGetBooleanv'
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:79: undefined reference to `glColor3f'
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:91: undefined reference to `glIndexi'
gldll_glcmn.o: In function `ZN7wxGLAPI9glFrustumEffffff':
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:217: undefined reference to `glFrustum'
gldll_glcmn.o: In function `ZN7wxGLAPI7glBeginEj':
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:239: undefined reference to `glBegin'
gldll_glcmn.o: In function `ZN7wxGLAPI12glTexCoord2fEff':
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:258: undefined reference to `glTexCoord2f'
gldll_glcmn.o: In function `ZN7wxGLAPI10glVertex3fEfff':
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:288: undefined reference to `glVertex3f'
gldll_glcmn.o: In function `ZN7wxGLAPI10glNormal3fEfff':
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:305: undefined reference to `glNormal3f'
gldll_glcmn.o: In function `ZN7wxGLAPI9glColor4fEffff':
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:323: undefined reference to `glColor4f'
gldll_glcmn.o: In function `ZN7wxGLAPI9glColor3fEfff':
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:332: undefined reference to `glColor3f'
gldll_glcmn.o: In function `ZN7wxGLAPI5glEndEv':
/home/Hamish/wxwidgets-build/wxWidgets-3.0.4/./src/common/glcmn.cpp:373: undefined reference to `glEnd'
collect2: error: ld returned 1 exit status
make: *** [Makefile:16113: /home/Hamish/wxwidgets-build/wxWidgets-3.0.4/lib/cygwxmsw30u_gl_gcc_custom-0.dll] Error 1
make: *** Waiting for unfinished jobs....
As far as I can tell, it's trying to build the wxmsw version, rather than the X11 version. Is this what I want to be doing, or do I need to tell it to build for X11?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Cygwin error (undefined reference to `_IID_IPersistFile')

Post by ONEEYEMAN »

Hi,
Do you have opengl libraries installed?

Thank you.
hamishmb
Knows some wx things
Knows some wx things
Posts: 29
Joined: Mon Jul 08, 2019 8:48 pm
Location: /usr/lib/python3/

Re: Cygwin error (undefined reference to `_IID_IPersistFile')

Post by hamishmb »

Oops, I posted this in the wrong place, I meant to post it at viewtopic.php?f=19&t=46091&p=192688#p192688

I think I do, and I tried linking against them explicitly with "-lGLU" in the LDFLAGS variable, but it made no difference.
Post Reply