Page 1 of 1

Cygwin error (undefined reference to `_IID_IPersistFile')

Posted: Wed Feb 08, 2012 11:07 pm
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!

Re: Cygwin error (undefined reference to `_IID_IPersistFile'

Posted: Tue Mar 20, 2012 8:32 am
by bob2012resolution
I have the same problem. Have you or anyone found a solution to this?
Any help would be great.

Thanks =)

Re: Cygwin error (undefined reference to `_IID_IPersistFile'

Posted: Tue Mar 20, 2012 1:11 pm
by Auria
Google found this : http://cygwin.com/ml/cygwin-apps/2010-11/msg00045.html

this sounds very relevant

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

Posted: Wed Dec 09, 2015 11:25 am
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

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

Posted: Fri Jul 12, 2019 2:00 pm
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?

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

Posted: Fri Jul 12, 2019 2:15 pm
by ONEEYEMAN
Hi,
Do you have opengl libraries installed?

Thank you.

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

Posted: Fri Jul 12, 2019 3:08 pm
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.