Author Topic: wxWidgets libjpeg problem  (Read 13026 times)

Offline Knx

  • Multiple posting newcomer
  • *
  • Posts: 41
wxWidgets libjpeg problem
« on: April 01, 2007, 07:53:33 pm »
I've compiled wxWidgets 2.8.3.

But when I try to compile a wx project on C::B I get a lot of errors

Code
:: === test, Debug ===
:C:\CodeBlocks\wx\build\msw\..\..\src\common\imagjpeg.cpp:205: undefined reference to `jpeg_resync_to_restart'
:C:\CodeBlocks\wx\build\msw\..\..\src\common\imagjpeg.cpp:238: undefined reference to `jpeg_std_error'
:C:\CodeBlocks\wx\build\msw\..\..\src\common\imagjpeg.cpp:252: undefined reference to `jpeg_destroy_decompress'
:C:\CodeBlocks\wx\build\msw\..\..\src\common\imagjpeg.cpp:257: undefined reference to `jpeg_CreateDecompress'
...

Will this patch work?
I found it on wiki

How I "install" it?
Using:
• Code::Blocks SVN        • wxWidGets 2.8.6
• Windows XP SP2          • MinGW Latest  Wish List • Code folding (For wxSmith and more options like NetBeans)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: wxWidgets libjpeg problem
« Reply #1 on: April 01, 2007, 08:03:36 pm »
Most probably, the patch will not work.

Possible reason of that error is missing jpeg headers.

Are you compiling wxWidgets with C::B? Or you're compiling a wxWidgets project?
Be a part of the solution, not a part of the problem.

Offline Knx

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: wxWidgets libjpeg problem
« Reply #2 on: April 01, 2007, 08:28:45 pm »
I've already compiled wxWidgets
Code
mingw32-make -f makefile.gcc

It took 10minutes+

I'm trying to compile a new wxWidgets project inside C::B.
Using:
• Code::Blocks SVN        • wxWidGets 2.8.6
• Windows XP SP2          • MinGW Latest  Wish List • Code folding (For wxSmith and more options like NetBeans)

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: wxWidgets libjpeg problem
« Reply #3 on: April 01, 2007, 09:21:22 pm »
No need for a patch, just add "wxjpeg" to your link libraries. Since you didn't specify "MONOLITHIC=1" when building wxWidgets, the default multilib version was built. When using the multilib version of wxWidgets, most programs need wxbase at least and usually the utility libraries (wxpng, wxtiff, wxjpeg, wxzlib, wxexpat, wxregex) and platform libraries as well. (For Windows, wxmsw_core, wxmsw_adv, and the rest).
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Knx

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: wxWidgets libjpeg problem
« Reply #4 on: April 01, 2007, 09:41:35 pm »
What's wxjpeg?

If I compile with MONOLITHIC=1 I won't need to do anything right? I'll try it then.
Using:
• Code::Blocks SVN        • wxWidGets 2.8.6
• Windows XP SP2          • MinGW Latest  Wish List • Code folding (For wxSmith and more options like NetBeans)

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: wxWidgets libjpeg problem
« Reply #5 on: April 01, 2007, 10:05:44 pm »
What's wxjpeg?
wxjpeg is the name of the library containing the jpg stuff.
The filename should be (under windows) libwxjpeg.a and (debug build) libwxjpegd.a.
If I compile with MONOLITHIC=1 I won't need to do anything right? I'll try it then.
No, the image manipulation libs aren't build into the monolithic library. Just go to "Project"->"Build options"->select "Linker Settings"->click "Add" under "Link Libraries" and type in "wxjpeg".

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: wxWidgets libjpeg problem
« Reply #6 on: April 01, 2007, 10:26:48 pm »
No, the image manipulation libs aren't build into the monolithic library.
The image manipulation libs aren't built into the static (default) monolithic library, true. A monolithic DLL build (SHARED=1) already includes them, however.
« Last Edit: April 01, 2007, 10:33:29 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: wxWidgets libjpeg problem
« Reply #7 on: April 01, 2007, 10:46:56 pm »
No, the image manipulation libs aren't build into the monolithic library.
The image manipulation libs aren't built into the static (default) monolithic library, true. A monolithic DLL build (SHARED=1) already includes them, however.
Ah, good to know :D

Offline Knx

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: wxWidgets libjpeg problem
« Reply #8 on: April 02, 2007, 01:22:36 am »
Compiled with
Code
mingw32-make -f makefile.gcc

Adding libraries

Code
ld.exe:: cannot find -lwxmsw28d_dbgrid
:: === Build finished: 1 errors, 0 warnings ===


When I compile with
Code
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1
It says that can't find "wx/setup.h"
Using:
• Code::Blocks SVN        • wxWidGets 2.8.6
• Windows XP SP2          • MinGW Latest  Wish List • Code folding (For wxSmith and more options like NetBeans)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: wxWidgets libjpeg problem
« Reply #9 on: April 02, 2007, 01:57:01 am »
Verify that these files exist in your wxWidgets folder.

include\wx\msw\setup0.h
include\wx\msw\setup.h

Note: If include\wx\msw\setup.h is missing copy include\wx\msw\setup0.h to include\wx\msw\setup.h

Tim S

Try below and see if it works for you, note it assumes MinGW is installed in C:\MinGW and that you are in your wxWidgets folder.

Code
CD build\msw
SET PATH=C:\MinGW\bin;C:\MinGW\mingw32\bin
mingw32-make -f makefile.gcc  SHARED=1 MONOLITHIC=1 clean
mingw32-make -f makefile.gcc  SHARED=1 MONOLITHIC=1
« Last Edit: April 02, 2007, 02:00:33 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Knx

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: wxWidgets libjpeg problem
« Reply #10 on: April 02, 2007, 02:48:18 am »
Verify that these files exist in your wxWidgets folder.

include\wx\msw\setup0.h
include\wx\msw\setup.h

Note: If include\wx\msw\setup.h is missing copy include\wx\msw\setup0.h to include\wx\msw\setup.h

Tim S

Try below and see if it works for you, note it assumes MinGW is installed in C:\MinGW and that you are in your wxWidgets folder.

Code
CD build\msw
SET PATH=C:\MinGW\bin;C:\MinGW\mingw32\bin
mingw32-make -f makefile.gcc  SHARED=1 MONOLITHIC=1 clean
mingw32-make -f makefile.gcc  SHARED=1 MONOLITHIC=1

Yes, there is setup.h in that folder.
I've compiled as you said.

When I'm creating a wxW project It says:



also for release.

Compiling without anything it works. (mingw32-make -f makefile.gcc)

Compiling with things you said:
Code
:: === teste, Debug ===
C:\CodeBlocks\wx\include\wx\platform.h:196: wx/setup.h: No such file or directory
C:\CodeBlocks\wx\include\wx\chkconf.h:98: #error "wxUSE_DYNLIB_CLASS must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:106: #error "wxUSE_EXCEPTIONS must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:114: #error "wxUSE_FILESYSTEM must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:122: #error "wxUSE_FS_ARCHIVE must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:135: #error "wxUSE_DYNAMIC_LOADER must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:143: #error "wxUSE_LOG must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:151: #error "wxUSE_LONGLONG must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:159: #error "wxUSE_MIMETYPE must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:175: #error "wxUSE_PRINTF_POS_PARAMS must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:183: #error "wxUSE_PROTOCOL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:225: #error "wxUSE_REGEX must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:233: #error "wxUSE_STDPATHS must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:241: #error "wxUSE_XML must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:249: #error "wxUSE_SOCKETS must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:257: #error "wxUSE_STREAMS must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:265: #error "wxUSE_STOPWATCH must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:273: #error "wxUSE_TEXTBUFFER must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:281: #error "wxUSE_TEXTFILE must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:297: #error "wxUSE_URL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:305: #error "wxUSE_VARIANT must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:325: #error "wxUSE_ABOUTDLG must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:333: #error "wxUSE_ACCEL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:341: #error "wxUSE_ANIMATIONCTRL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:349: #error "wxUSE_BITMAPCOMBOBOX must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:357: #error "wxUSE_BMPBUTTON must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:365: #error "wxUSE_BUTTON must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:373: #error "wxUSE_CALENDARCTRL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:381: #error "wxUSE_CARET must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:389: #error "wxUSE_CHECKBOX must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:405: #error "wxUSE_CHOICE must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:413: #error "wxUSE_CHOICEBOOK must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:421: #error "wxUSE_CHOICEDLG must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:429: #error "wxUSE_CLIPBOARD must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:437: #error "wxUSE_COLLPANE must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:445: #error "wxUSE_COLOURDLG must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:453: #error "wxUSE_COLOURPICKERCTRL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:461: #error "wxUSE_COMBOBOX must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:469: #error "wxUSE_COMBOCTRL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:477: #error "wxUSE_DATAOBJ must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:485: #error "wxUSE_DATAVIEWCTRL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:493: #error "wxUSE_DATEPICKCTRL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:501: #error "wxUSE_DIRPICKERCTRL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:509: #error "wxUSE_DISPLAY must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:517: #error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:525: #error "wxUSE_FILEDLG must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:533: #error "wxUSE_FILEPICKERCTRL must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:541: #error "wxUSE_FONTDLG must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:549: #error "wxUSE_FONTMAP must be defined."
C:\CodeBlocks\wx\include\wx\chkconf.h:557: #error "wxUSE_FONTPICKERCTRL must be defined."
:: More errors follow but not being shown.
:: Edit the max errors limit in compiler options...
:: === Build finished: 50 errors, 0 warnings ===
Using:
• Code::Blocks SVN        • wxWidGets 2.8.6
• Windows XP SP2          • MinGW Latest  Wish List • Code folding (For wxSmith and more options like NetBeans)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: wxWidgets libjpeg problem
« Reply #11 on: April 02, 2007, 03:30:14 am »
Turn ON FULL Compiler Logging and post the commands that have the error.

What directory are you using as the Specified wxWidgets Directory that does not have the setup.h?

Tim S
« Last Edit: April 02, 2007, 04:02:23 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: wxWidgets libjpeg problem
« Reply #12 on: April 02, 2007, 05:02:42 am »
Wizard sets include directory for setup.h file under lib dir. E.g., if you use the following command to compile wx:
Code
mingw32-make -f makefile.gcc
Then the setup.h file is copied to <wxWidgets_dir>\lib\gcc_lib\mswd\wx directory. Wizard adds this directory to the project file and the actual contents of this directory depends upon your choices.

So if you get such error that "setup.h not found", then probable reason is You're using wrong settings in the wizard.



The warning message is shown for a purpose.

IMO, you didn't change the options which was leading C::B to search for some critical libraries in a wrong directory. It tells you that particular target will throw error during compiling. It may come due to 1) the particular configuration you're trying to use doesn't exist in your system, 2) selection of wrong options in wizard.

Regards,

Biplab
Be a part of the solution, not a part of the problem.