Problems with my windows build Topic is solved

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
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 188
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Problems with my windows build

Post 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?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems with my windows build

Post by doublemax »

You didn't add the jpeg library to your linker include files.
Use the source, Luke!
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 188
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Problems with my windows build

Post by Parduz »

doublemax wrote:You didn't add the jpeg library to your linker include files.
Isn't the library the libwxjpegd.a?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Problems with my windows build

Post 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.
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 188
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Problems with my windows build

Post 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.
Post Reply