Skip to main content

Topic: compile MP3x of Lame 3.98-2 winXP Step by Step (Read 5743 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
compile MP3x of Lame 3.98-2 winXP Step by Step
Can somebody write how to successfuly compile lame3.98-2 MP3x frame analyzer source code step by step?

To do this is nessesary download
GTK+ toolkit (older than 2.0):
Lame source code:          
Visual Studio
After that I do something wrong. What?
I unpack Lame to E:\school\lame-398-2\
I unpack Gtk to E:\school\lame-398-2\gtk

in gtk folder are following folders:

Open lame_vc6.dsw => Build MP3x => requires <gtk/gtk.h>,
(Cannot open include file: 'gtk\gtk.h': No such file or directory)
althroug this *.h is in E:\school\lame-398-2\gtk\gtk+\gtk\
so I copied whole gtk\gtk.h folder to E:\school\lame-398-2\
Also missing <gdk\gdk.h> => gdk\gdk.h copied to main folder E:\school\lame-398-2\
Also missing <glib.h> => E:\school\lame-398-2\gtk+\glib\glib\ folder copied to main folder E:\school\lame-398-2\
And probem is
"fatal error C1083: Cannot open include file: 'glibconfig.h': No such file or directory"
header file "glibconfig.h" is not include in
only in GTK 2.0 toolkit. but in GTK 2.0 cannot by used for compilling LAME MP3x, because GTK_WINDOW_DIALOG is no longer presentin GTK-2.0

How to continue?

compile MP3x of Lame 3.98-2 winXP Step by Step
Reply #1
I just copied "glibconfig.h" from Gtk 2.0 and its => fixed
Also missing <pango/pango.h> =>  copied from gtk 1.3    copied to E:\school\lame-398-2\
Also missing <glib-object.h>    =>            from gtk 1.3                  E:\school\lame-398-2\
Also missing <gobject/gboxed.h>    => folder from gtk 1.3 to          E:\school\lame-398-2\
Also missing <gdkconfig.h>  =>              from Gtk 2.0                  ...
                  <gdk-pixbuf\gdk-pixbuf.h>  => gdk-pixbuf  folder to E:\school\lame-398-2\
also              <atk/atkobject.h>  =>            atk folder to E:\school\lame-398-2\

and the PERL is:
e:\!!!skola\lame-398-2\frontend\gtkanal.c(1146) : error C2065: 'GTK_WINDOW_DIALOG' : undeclared identifier
e:\!!!skola\lame-398-2\frontend\gtkanal.c(1159) : warning C4013: 'gtk_text_set_editable' undefined; assuming extern returning int
e:\!!!skola\lame-398-2\frontend\gtkanal.c(1160) : error C2223: left of '->vadj' must point to struct/union
e:\!!!skola\lame-398-2\frontend\gtkanal.c(1160) : error C2198: 'gtk_vscrollbar_new' : too few arguments for call

SAME ERROR like GTK+ 2.0

What I am doing wrog? I am a nervous. please help. thanks a lot for answer
  • Last Edit: 09 February, 2010, 12:00:49 PM by greynol

  • viktor
  • [*][*][*][*]
compile MP3x of Lame 3.98-2 winXP Step by Step
Reply #2
you shouldn't copy things. there are several project settings which can help. here's a manual for another project:

check out "Creating a VS solution from scratch", there are instructions how to modify properties such as "Additional Include Directories", "Additional Library Directories" and "Additional Dependencies". the first property is needed for VS to find external headers, the latter 2 are required to be properly set for linking.

of course your mileage will vary with this specific project, this will just give you a picture what's the way building works in VS. this project uses environmental variables ("$DEPS"), you can safely use absolute paths (such as "E:\school\lame-398-2\gtk\includes" or wherever the required headers are).
  • Last Edit: 09 February, 2010, 08:52:39 AM by viktor

compile MP3x of Lame 3.98-2 winXP Step by Step
Reply #3
Can someone else help with it? Somebody who already did LAME on windows XP.
more solutions will by very helpful.

Thanks for answers.

  • viktor
  • [*][*][*][*]
compile MP3x of Lame 3.98-2 winXP Step by Step
Reply #4
i've managed to get it work with gtk2:

i think i'll send patches to the LAME team. if they reject it, i'll publish a howto here.
  • Last Edit: 10 February, 2010, 01:03:41 PM by viktor

  • viktor
  • [*][*][*][*]
compile MP3x of Lame 3.98-2 winXP Step by Step
Reply #5
okay i'm too lazy for a well-formatted patch so here's the howto:

1) download the latest gtk+ bundle:

extract it to a folder anywhere, i use "c:\users\user\desktop\gtk" from now. change it everywhere according to your folder.

2) control panel/system/advanced system settings/environmental variables/user variables for user:
new, name: PATH, value: c:\users\user\desktop\gtk\bin. if PATH already exists, append ";c:\users\user\desktop\gtk\bin" without quotation marks.

3) open lame-398-2/lame_vc8.sln with vs. if you're using vs2008, use the conversion wizard to update the solution. open mp3x_vc8/source files/gtkanal.c

line 1146. change
Code: [Select]
    textwindow = gtk_window_new(GTK_WINDOW_DIALOG);

Code: [Select]
    textwindow = gtk_window_new(GTK_WINDOW_POPUP);

line 1160. change
Code: [Select]
    vscrollbar = gtk_vscrollbar_new(GTK_TEXT(box)->vadj);

Code: [Select]
    vscrollbar = gtk_vscrollbar_new(GTK_TEXT_VIEW(box)->vadjustment);

line 1402: comment it out like:
Code: [Select]
    /* gtk_accel_group_attach(accel_group, GTK_OBJECT(windows)); */

4) change solution configuration to "Release". go to mp3x project properties. right click on mp3x_vc8. go to configuration properties.

5) C/C++/General/Additional Include Directories. add:

Code: [Select]

6) C/C++/Preprocessor/Preprocessor Definitions: add:
Code: [Select]

7) C/C++/Code Generation/Runtime Library: change to Multi-threaded (/MT)

8) Linker/General/Additional Library Directories: add:
Code: [Select]

9) Linker/Input/Additional Dependencies: remove
Code: [Select]

and add:
Code: [Select]

10) build mp3x. go to lame-398-2/output. copy an mp3 here as "test.mp3". run a command prompt from here (in TC enter "cmd"). in cmd enter "mp3x test.mp3", and it should run.

there are errors in the command line ("assertion failed") and if you resize the window the graphs won't be redrawed, etc. so this is just a start, but at least it builds and runs. maybe someone will fix it correctly.
  • Last Edit: 10 February, 2010, 01:37:21 PM by viktor

compile MP3x of Lame 3.98-2 winXP Step by Step
Reply #6
Viktor. Thanks, Thanks, Thanks
I am pretty surprised. IT WORKs. WOW

I will buy a many beers for that help...