Page 1 of 1

Build on Windows PC

Posted: Thu Aug 01, 2013 11:48 am
by faywong8888
Hi all,

I am try to develop a simple frame-based window app on windows PC.

There's a linker error as following:

Code: Select all

C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 4 -e -f  "edid_parser_wsp.mk""
----------Building project:[ EDIDUtil - Debug ]----------
mingw32-make[1]: Entering directory `e:/codelite_proj/edid_parser/EDIDUtil'
windres -i "E:/codelite_proj/edid_parser/EDIDUtil/win_resources.rc" --use-temp-file --define __WXMSW__ --define __WXDEBUG__ --define _UNICODE --include-dir C:\wxWidgets-2.9.4\lib\gcc_dll\mswud --include-dir C:\wxWidgets-2.9.4\include --define WXUSINGDLL    -o ./Debug/win_resources.rc.o -IC:/wxWidgets-2.9.4/include
g++  -c  "E:/codelite_proj/edid_parser/EDIDUtil/main.cpp" -g -O0 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IC:\wxWidgets-2.9.4\lib\gcc_dll\mswud -IC:\wxWidgets-2.9.4\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport    -o ./Debug/main.o -I. -IC:/wxWidgets-2.9.4/include -IC:/wxWidgets-2.9.4/lib/gcc_dll/mswud -I.
g++  -c  "E:/codelite_proj/edid_parser/EDIDUtil/wxcrafter_bitmaps.cpp" -g -O0 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IC:\wxWidgets-2.9.4\lib\gcc_dll\mswud -IC:\wxWidgets-2.9.4\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport    -o ./Debug/wxcrafter_bitmaps.o -I. -IC:/wxWidgets-2.9.4/include -IC:/wxWidgets-2.9.4/lib/gcc_dll/mswud -I.
g++  -c  "E:/codelite_proj/edid_parser/EDIDUtil/MainFrame.cpp" -g -O0 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IC:\wxWidgets-2.9.4\lib\gcc_dll\mswud -IC:\wxWidgets-2.9.4\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport    -o ./Debug/MainFrame.o -I. -IC:/wxWidgets-2.9.4/include -IC:/wxWidgets-2.9.4/lib/gcc_dll/mswud -I.
c:\MinGW-4.7.1\bin\windres.exe: warning: 24: 1: 1033: duplicate value
g++  -c  "E:/codelite_proj/edid_parser/EDIDUtil/wxcrafter.cpp" -g -O0 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IC:\wxWidgets-2.9.4\lib\gcc_dll\mswud -IC:\wxWidgets-2.9.4\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport    -o ./Debug/wxcrafter.o -I. -IC:/wxWidgets-2.9.4/include -IC:/wxWidgets-2.9.4/lib/gcc_dll/mswud -I.
g++ -o ./Debug/EDIDUtil @"EDIDUtil.txt" -L.   -static  -mthreads -LC:\wxWidgets-2.9.4\lib\gcc_dll -lwxmsw29ud_xrc -lwxmsw29ud_aui -lwxmsw29ud_html -lwxmsw29ud_adv -lwxmsw29ud_core -lwxbase29ud_xml -lwxbase29ud_net -lwxmsw29ud_richtext -lwxbase29ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexud -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32  -mwindows
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw29ud_xrc
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw29ud_aui
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw29ud_html
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw29ud_adv
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw29ud_core
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxbase29ud_xml
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxbase29ud_net
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw29ud_richtext
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxbase29ud
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxtiffd
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxjpegd
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxpngd
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxzlibd
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxregexud
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxexpatd
c:/mingw-4.7.1/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxregexud
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [Debug/EDIDUtil] Error 1
mingw32-make.exe: *** [All] Error 2
EDIDUtil.mk:79: recipe for target `Debug/EDIDUtil' failed
mingw32-make[1]: Leaving directory `e:/codelite_proj/edid_parser/EDIDUtil'
edid_parser_wsp.mk:4: recipe for target `All' failed
0 errors, 0 warnings
But under "C:\wxWidgets-2.9.4\lib\gcc_dll", there's lib{some}.a.

Can anyone do me a favor?

Thanks,
faywong

Re: Build on Windows PC

Posted: Thu Aug 01, 2013 12:26 pm
by eranif
Did you compile wxWidgets yourself? and did you compile it as static version?
ld is looking for the .a version of wxWidgets - if you did not compile it as static, then it will fail in linking (same as it did for you)

Eran

Re: Build on Windows PC

Posted: Thu Aug 01, 2013 3:28 pm
by faywong8888
Hi Eranif,

Thanks for your kindly support.

I download it with refer to an announce sent by you. The download url is: http://superb-dca3.dl.sourceforge.net/p ... NABLED.exe

I see it ships so many prebuilt library(*.a, *.dll), i infer that is capable of both static and dynamic linking. so i use it directly after installing(other than compiling it from scratch).

the -static flag is added by me. As i am a usual linux developer, not sure about the ld's behavior on minGW(search by libsome.so or some.so, or libsome.a when -lsome is set).

Also, i list the directory structure as following:
C:.
├─build
│ └─msw
├─include
│ ├─msvc
│ │ └─wx
│ └─wx
│ ├─android
│ ├─aui
│ ├─dfb
│ │ └─private
│ ├─generic
│ │ └─private
│ ├─html
│ ├─meta
│ ├─msdos
│ ├─msw
│ │ ├─ole
│ │ ├─private
│ │ └─wince
│ ├─persist
│ ├─private
│ ├─propgrid
│ ├─protocol
│ ├─ribbon
│ ├─richtext
│ ├─stc
│ ├─univ
│ ├─xml
│ └─xrc
└─lib
└─gcc_dll
├─mswu
│ └─wx
│ └─msw
└─mswud
└─wx
└─msw
And in the c:\wxWidgets-2.9.4\lib\gcc_dll, there are:

c:\wxWidgets-2.9.4\lib\gcc_dll>ls
libwxbase29u.a libwxmsw29u_gl.a libwxmsw29ud_html.a libwxscintillad.a wxbase294ud_xml_gcc_cl.dll wxmsw294ud_adv_gcc_cl.dll
libwxbase29u_net.a libwxmsw29u_html.a libwxmsw29ud_media.a libwxtiff.a wxmsw294u_adv_gcc_cl.dll wxmsw294ud_aui_gcc_cl.dll
libwxbase29u_xml.a libwxmsw29u_media.a libwxmsw29ud_propgrid.a libwxtiffd.a wxmsw294u_aui_gcc_cl.dll wxmsw294ud_core_gcc_cl.dll
libwxbase29ud.a libwxmsw29u_propgrid.a libwxmsw29ud_ribbon.a libwxzlib.a wxmsw294u_core_gcc_cl.dll wxmsw294ud_gl_gcc_cl.dll
libwxbase29ud_net.a libwxmsw29u_ribbon.a libwxmsw29ud_richtext.a libwxzlibd.a wxmsw294u_gl_gcc_cl.dll wxmsw294ud_html_gcc_cl.dll
libwxbase29ud_xml.a libwxmsw29u_richtext.a libwxmsw29ud_stc.a mswu wxmsw294u_html_gcc_cl.dll wxmsw294ud_media_gcc_cl.dll
libwxexpat.a libwxmsw29u_stc.a libwxmsw29ud_webview.a mswud wxmsw294u_media_gcc_cl.dll wxmsw294ud_propgrid_gcc_cl.dll
libwxexpatd.a libwxmsw29u_webview.a libwxmsw29ud_xrc.a wx-config.exe wxmsw294u_propgrid_gcc_cl.dll wxmsw294ud_ribbon_gcc_cl.dll
libwxjpeg.a libwxmsw29u_xrc.a libwxpng.a wxbase294u_gcc_cl.dll wxmsw294u_ribbon_gcc_cl.dll wxmsw294ud_richtext_gcc_cl.dll
libwxjpegd.a libwxmsw29ud_adv.a libwxpngd.a wxbase294u_net_gcc_cl.dll wxmsw294u_richtext_gcc_cl.dll wxmsw294ud_stc_gcc_cl.dll
libwxmsw29u_adv.a libwxmsw29ud_aui.a libwxregexu.a wxbase294u_xml_gcc_cl.dll wxmsw294u_stc_gcc_cl.dll wxmsw294ud_webview_gcc_cl.dll
libwxmsw29u_aui.a libwxmsw29ud_core.a libwxregexud.a wxbase294ud_gcc_cl.dll wxmsw294u_webview_gcc_cl.dll wxmsw294ud_xrc_gcc_cl.dll
libwxmsw29u_core.a libwxmsw29ud_gl.a libwxscintilla.a wxbase294ud_net_gcc_cl.dll wxmsw294u_xrc_gcc_cl.dll wxrc.exe

Can you help me to figure out what's the cause of building failure?

Thanks,
faywong

Re: Build on Windows PC

Posted: Thu Aug 01, 2013 4:22 pm
by eranif
The wx installer that we provide for Windows is built as shared libraries. You can't use it for static building, you will need to build wxWidgets yourself to enable it

Eran

Re: Build on Windows PC

Posted: Fri Aug 02, 2013 7:51 am
by faywong8888
Would you help to tell any guide about how to dynamic link wxwidget libraries on windows PC?

Will the ld search & use the {some}.dll when -lsome flag added, -static flag removed?

Thanks,
faywong

Re: Build on Windows PC

Posted: Fri Aug 02, 2013 9:08 am
by eranif
Just try one of the built-in wxWidgets templates of codelite without changing it (if you did not modify anything in codelite, they should work out of the box)
note that codelite uses the wx-config.exe tool under Windows, which requires you to set WXCFG and WXWIN environment variables

Eran

Re: Build on Windows PC

Posted: Fri Aug 02, 2013 12:48 pm
by faywong8888
Got it.
Many thanks.