[vorbis-dev] Vorbis with BCB

David K. Gasaway dgasaway at bigvalley.net
Sat Jan 27 22:24:04 PST 2001



After downloading the nightly snapshot last night, I've spent a good 
part of the day trying to build the package with Borland C++Builder 
4.  I have some things to report, and also need some help.

[Note: this message is long and messy :)]

{Converting DSP files to BPR files}

I made the necessary BPR files from the DSP files with the Visual 
C++ Project Conversion Utility.  This works okay for the most part, 
but there are conversion issues, and some problems with the DSP 
files themselves.  Perhaps we could put proper BCB project files in 
as well?

For example, output libraries have names like 'ogg_static.lib'.  I 
have to rename them later, then.  Is the same manual intervention 
required when building with MSVC?

The dynamic linking projects (like vorbisfile_dynamic.dsp) don't 
have an include path for the ogg headers (..\..\ogg\include).  They 
also don't set a link path for the libraries 
(..\..\ogg\win32\Dynamic_Release).

The dynamic DSP files reference 'ODBCCP32.LIB'.  Would this be 
ODBC, as for database access?  I don't think Vorbis uses that :)

{Building ogg_dynamic}

I get this warning:

[C++ Warning] vorbisfile.c(1133): W8065 Call to function 
'host_is_big_endian' with no prototype.

There is no prototype for 'host_is_big_endian' in 'vorbisfile.h'.  But, it 
is just a warning, after all.

{Building vorbis_dynamic}

I get a set of errors, starting with this:

[C++ Error] os.h(136): E2211 Inline assembly not allowed in inline 
and template functions.

BCB doesn't like the inline MSVC assembly.  This function is 
preceded by this code:
   #ifdef _WIN32
I changed it to this:
   #if defined(_WIN32) && !defined(__BORLANDC__)
But it should probably be something like this:
   #if defined(_WIN32) && defined(__MSVC__)
Or shortened to:
   #ifdef __MSVC__
With what ever constant that MSVC defines as its own.

The same thing appears in 'platform.c' when defining 'setbinmode'.  
I'm not sure, though, if just changing the directive is enough.  Does 
there need to alternative code for BCB?

{Building oggenc}

The DSP files for oggenc have a number of absolute paths, like:

# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "c:\src\ogg\include" 
/I "c:\src\vorbis\include" /D "WIN32" /D "NDEBUG" /D 
"_CONSOLE" /D "_MBCS" /YX /FD /c

And:

# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib ogg_static.lib vorbis_static.lib 
vorbisenc_static.lib /nologo /subsystem:console /machine:I386 
/libpath:"c:\src\ogg\win32\Static_Release" 
/libpath:"c:\src\vorbis\win32\Static_Release"

Once getting by those issues, I get these errors:

[C++ Error] oggenc.cpp(201): E2034 Cannot convert 'void *' to 'char 
*'.
[C++ Error] oggenc.cpp(214): E2034 Cannot convert 'void *' to 'char 
*'.
[C++ Error] oggenc.cpp(336): E2034 Cannot convert 'void *' to 'char 
*'.
[C++ Error] oggenc.cpp(390): E2227 Extra parameter in call to 
getopt_long().
[C++ Error] oggenc.cpp(399): E2034 Cannot convert 'void *' to 'char 
* *'.
[C++ Error] oggenc.cpp(403): E2034 Cannot convert 'void *' to 'char 
* *'.
[C++ Error] oggenc.cpp(407): E2034 Cannot convert 'void *' to 'char 
* *'.
[C++ Error] oggenc.cpp(411): E2034 Cannot convert 'void *' to 'char 
* *'.
[C++ Error] oggenc.cpp(421): E2034 Cannot convert 'void *' to 'char 
* *'.
[C++ Error] oggenc.cpp(458): E2034 Cannot convert 'void *' to 'char 
* *'.

I can get by the type errors with the appropriate type-casts.  Do 
other compilers (msvc, gcc, egcs, whatever) accept this code?

But the error in line 390 is the real problem.  BCB is using the 
getopt_long declaration from line 155 in getopt.h.  This is the one 
that looks like this:
   extern int getopt_long ();
I tried declaring '__STDC__', but this causes problems with 'strdup' 
from Borland's 'string.h'.  Then I tried hacking getopt.h so that BCB 
would use the full prototypes that start on line 140, but then I get:

[C++ Error] getopt1.c(73): E2342 Type mismatch in parameter 
'argv'.
[C++ Error] getopt1.c(73): E2342 Type mismatch in parameter 
'options'.
[C++ Error] getopt1.c(73): E2342 Type mismatch in parameter 
'long_options'.

So, it accepts the type for argc, but is convinced the remaining 
parms are mismatched?!  Must be a ANSI vs K&R thing, I figured.  
Well, if change the definition for getopt_long, I get this:

[C++ Error] getopt1.c(67): E2356 Type mismatch in redeclaration 
of 'getopt_long'.
[C++ Error] getopt.h(160): E2344 Earlier declaration of 'getopt_long'.

I've tried various things, but I'm stumped.  Anyone have any ideas?

Also, while looking at 'getopt.h' I noticed a couple lines (85 and 
129) that say:
   # if defined __STDC__ && __STDC__
Shouldn't this really be...
   #if defined(__STDC__) && defined(__STDC__)
...?  At least, that's the way BCB needs it.  Of course, I don't 
understand the logic of the thing.  Does this stuff come straight 
from GNU sources?

-----
David K. Gasaway
dgasaway at comports.com
http://dkg.home.dhs.org
-----
You have to be sharp to be on the cutting edge.
-----
Sig by Kookie Jar 5.98b http://go.to/generalfrenetics/
22 January 2001

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list