Compiling Lame

CodeLite installation/troubleshooting forum
hobospy
CodeLite Curious
Posts: 2
Joined: Thu Dec 17, 2009 11:18 am
Genuine User: Yes
IDE Question: c++
Contact:

Compiling Lame

Post by hobospy » Thu Dec 17, 2009 11:25 am

Hi everyone,

Has anyone compiled the Lame code (http://lame.sourceforge.net/). I got the code, couldn't work out how to use any of the makefiles that come with it so thought I would create a new Codelite project and then compile from there but when I try to compile I get odd messages about my string header file, can anyone make sense of what is going on.. (MinGW32 - latest version and the version below (3.4.5)). :shock:

g++ -c "C:/Temp/TempLame/Lib/bitstream.c" -g -o ./Debug/bitstream.o "-IC:/MinGW-3.4.5/include/c++/3.4.5" "-I." "-I."
g++ -c "C:/Temp/TempLame/Lib/encoder.c" -g -o ./Debug/encoder.o "-IC:/MinGW-3.4.5/include/c++/3.4.5" "-I." "-I."
In file included from C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winnt.h:37,
from C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/windef.h:246,
from C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/windows.h:48,
from C:/Temp/TempLame/Lib/machine.h:130,
from C:/Temp/TempLame/Lib/bitstream.c:34:
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:38: error: expected primary-expression before "const"
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:38: error: expected `)' before "const"
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:39: error: redefinition of `void*bcopy'
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:38: error: `void*bcopy' previously defined here
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:39: error: expected primary-expression before "const"
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:39: error: expected `)' before "const"
In file included from C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winnt.h:37,
from C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/windef.h:246,
from C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/windows.h:48,
from C:/Temp/TempLame/Lib/machine.h:130,
from C:/Temp/TempLame/Lib/encoder.c:34:
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:38: error: expected primary-expression before "const"
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:38: error: expected `)' before "const"
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:39: error: redefinition of `void*bcopy'
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:38: error: `void*bcopy' previously defined here
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:39: error: expected primary-expression before "const"
C:/MinGW-3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/string.h:39: error: expected `)' before "const"
In file included from C:/Temp/TempLame/Lib/bitstream.c:36:
C:/Temp/TempLame/Lib/util.h:321: error: `uint16_t' does not name a type
C:/Temp/TempLame/Lib/util.h:500: error: `ieee754_float32_t' does not name a type
In file included from C:/Temp/TempLame/Lib/bitstream.c:40:
C:/Temp/TempLame/Lib/gain_analysis.h:88: error: `uint32_t' does not name a type
C:/Temp/TempLame/Lib/gain_analysis.h:89: error: `uint32_t' does not name a type
In file included from C:/Temp/TempLame/Lib/bitstream.c:41:
C:/Temp/TempLame/Lib/VbrTag.h:76: error: variable or field `UpdateMusicCRC' declared void
C:/Temp/TempLame/Lib/VbrTag.h:76: error: `uint16_t' was not declared in this scope
C:/Temp/TempLame/Lib/VbrTag.h:76: error: `crc' was not declared in this scope
C:/Temp/TempLame/Lib/VbrTag.h:76: error: expected primary-expression before "unsigned"
C:/Temp/TempLame/Lib/VbrTag.h:76: error: expected primary-expression before "int"
C:/Temp/TempLame/Lib/VbrTag.h:76: error: initializer expression list treated as compound expression
C:/Temp/TempLame/Lib/bitstream.c: In function `void putheader_bits(lame_internal_flags*)':
C:/Temp/TempLame/Lib/bitstream.c:94: error: `bcopy' cannot be used as a function
C:/Temp/TempLame/Lib/bitstream.c: In function `int copy_buffer(lame_internal_flags*, unsigned char*, int, int)':
C:/Temp/TempLame/Lib/bitstream.c:976: error: `bcopy' cannot be used as a function
C:/Temp/TempLame/Lib/bitstream.c:981: error: 'struct lame_internal_flags' has no member named 'nMusicCRC'
C:/Temp/TempLame/Lib/bitstream.c:981: error: `UpdateMusicCRC' cannot be used as a function
mingw32-make.exe[1]: *** [Debug/bitstream.o] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
In file included from C:/Temp/TempLame/Lib/encoder.c:36:
C:/Temp/TempLame/Lib/util.h:321: error: `uint16_t' does not name a type
C:/Temp/TempLame/Lib/util.h:500: error: `ieee754_float32_t' does not name a type
In file included from C:/Temp/TempLame/Lib/encoder.c:42:
C:/Temp/TempLame/Lib/VbrTag.h:76: error: variable or field `UpdateMusicCRC' declared void
C:/Temp/TempLame/Lib/VbrTag.h:76: error: `uint16_t' was not declared in this scope
C:/Temp/TempLame/Lib/VbrTag.h:76: error: `crc' was not declared in this scope
C:/Temp/TempLame/Lib/VbrTag.h:76: error: expected primary-expression before "unsigned"
C:/Temp/TempLame/Lib/VbrTag.h:76: error: expected primary-expression before "int"
C:/Temp/TempLame/Lib/VbrTag.h:76: error: initializer expression list treated as compound expression
C:/Temp/TempLame/Lib/encoder.c: In function `int lame_encode_mp3_frame(lame_global_flags*, const sample_t*, const sample_t*, unsigned char*, int)':
C:/Temp/TempLame/Lib/encoder.c:484: error: `bcopy' cannot be used as a function
C:/Temp/TempLame/Lib/encoder.c:489: error: `bcopy' cannot be used as a function
mingw32-make.exe[1]: *** [Debug/encoder.o] Error 1
mingw32-make.exe: *** [All] Error 2
----------Build Ended----------
36 errors, 0 warnings

jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Compiling Lame

Post by jfouche » Thu Dec 17, 2009 12:43 pm

As written in the makefile :

Code: Select all

# these variables are available on command line:
#
#   make UNAME=xxxxx ARCH=xxxxx   - specify a type of host
#   make PGM=lame_exp             - specify a name of an executable file
#
# if you have mingw32-gcc, try:
#   make -fMakefile.unix UNAME=MSDOS
# or if you get the error
# "process_begin: CreateProcess((null), copy configMS.h config.h, ...)":
#   make -fMakefile.unix UNAME=MSDOS NOUNIXCMD=NO
# or if you have NASM:
#   make -fMakefile.unix UNAME=MSDOS HAVE_NASM=YES
Try :

Code: Select all

make -fMakefile.unix UNAME=MSDOS
Jérémie

hobospy
CodeLite Curious
Posts: 2
Joined: Thu Dec 17, 2009 11:18 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Compiling Lame

Post by hobospy » Fri Dec 18, 2009 3:32 am

I feel like a right eidget, I hadn't even thought of looking there :oops: Anyway for anyone else looking to compile it here are the commands:

Firstly in the main folder you will find the Makefile.unix compile it with:

Code: Select all

mingw32-make -f Makefile.unix UNAME=MSDOS
After that has successfully compiled change into the DLL directory and compile that with:

Code: Select all

mingw32-make -f Makefile.mingw32
Hope that helps, oh and I got some error when making the DLL to do with making the example.exe but as I already had the DLL I didn't care :D

http://www.thewonderfulwandertooz.wordpress.com

Thanks again jFouche for pointing me in the right direction ;)

Post Reply