Page 1 of 1

Problems with my windows build

Posted: Fri Oct 26, 2018 2:36 pm
by Parduz
I've built the wxWidgets with this command, and with these ambient variable set:

Code: Select all

WXWIN="C:\SVILUPPO\Toolchains\wxWidgets-3.0.4\build\msw\..\"
Path=C:\SVILUPPO\Toolchains\MinGW-6.3.0-1\bin; ... 

mingw32-make -f makefile.gcc CXXFLAGS="-std=gnu++11" USE_XRC=1 SHARED=0 MONOLITHIC=0 BUILD=debug CFG=%Comp_Version%
I get a lot of error like this:
In function `wx_jpeg_io_src':
C:\SVILUPPO\Toolchains\wxWidgets-3.0.4\build\msw/../../src/common/imagjpeg.cpp:201: undefined reference to `jpeg_resync_to_restart'
to all the defined functions in the imagjpeg.cpp.

This happens when i use

Code: Select all

wxImage::AddHandler(new wxJPEGHandler);
I have no problem when i call

Code: Select all

wxImage::AddHandler(new wxPNGHandler);
What should i do?

Re: Problems with my windows build

Posted: Fri Oct 26, 2018 2:58 pm
by doublemax
You didn't add the jpeg library to your linker include files.

Re: Problems with my windows build

Posted: Mon Nov 05, 2018 6:36 pm
by Parduz
doublemax wrote:You didn't add the jpeg library to your linker include files.
Isn't the library the libwxjpegd.a?

Re: Problems with my windows build

Posted: Mon Nov 05, 2018 6:52 pm
by PB
Assuming you added the library...

I do not know whether it is the reason but with GCC, the order the libraries are listed matters. Is yours correct?
E.g. the library order (but for release build of v3.1) taken from a command line goes like

Code: Select all

lwxmsw31u_core -lwxbase31u -lwxpng -lwxzlib -lwxjpeg -lwxtiff -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -luxtheme -loleacc
BTW, your WXWIN variable is rather unusual, it should contain the root wxWidgets folder (in your case C:\SVILUPPO\Toolchains\wxWidgets-3.0.4, so you can reference it like $(WXWIN)/include, $(WXWIN)/gcc_lib etc.

Re: Problems with my windows build

Posted: Tue Nov 06, 2018 11:25 am
by Parduz
PB wrote:Assuming you added the library...
I do not know whether it is the reason but with GCC, the order the libraries are listed matters. Is yours correct?
E.g. the library order (but for release build of v3.1) taken from a command line goes like

Code: Select all

lwxmsw31u_core -lwxbase31u -lwxpng -lwxzlib -lwxjpeg -lwxtiff -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -luxtheme -loleacc

That was the problem! Thanks.
Mine was sorted this way:

Code: Select all

-lwxbase30ud_net
-lwxmsw30ud_xrc
-lwxmsw30ud_adv
-lwxmsw30ud_gl
-lwxmsw30ud_propgrid
-lwxmsw30ud_ribbon
-lwxmsw30ud_richtext
-lwxmsw30ud_stc
-lwxmsw30ud_webview
-lwxbase30ud_xml
-lwxregexud
-lwxscintillad
-lwxexpatd
-lwxjpegd
-lwxtiffd
-lwxmsw30ud_aui
-lwxmsw30ud_media
-lwxmsw30ud_html
-lwxmsw30ud_core
-lwxpngd
-lwxzlibd
-lwxbase30ud

-lkernel32
-luser32
-lgdi32
-lwinspool
-lcomdlg32
-ladvapi32
-lshell32
-lole32
-loleaut32
-luuid
-lcomctl32
-lwsock32
-lodbc32
-mwindows
I moved the jpeg and tiff under the _core and everything is well now. Thanks!
PB wrote: BTW, your WXWIN variable is rather unusual, it should contain the root wxWidgets folder (in your case C:\SVILUPPO\Toolchains\wxWidgets-3.0.4, so you can reference it like $(WXWIN)/include, $(WXWIN)/gcc_lib etc.
That was just for building the widgets (i use a couple of batch files that sets the variable related to the current directory).
In Code::Blocks the WXWIN variable is exactly like you said.