xboxscene.org forums

Author Topic: Why Do I Need Xapi.lib Here?  (Read 102 times)

Tatsh

  • Archived User
  • Jr. Member
  • *
  • Posts: 67
Why Do I Need Xapi.lib Here?
« on: July 05, 2010, 10:53:00 AM »

CODE
Creating temporary file "c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg123-1.12.2\ports\MSVC++\2005\libmpg123\Xbox 360\Release_Generic\RSP0000334201008.rsp" with contents
[
/Ob2 /Oi /Ot /GL /I "../.." /I "../../../../src/libmpg123" /D "WIN32" /D "_CRT_SECURE_NO_WARNINGS" /D "REAL_IS_FLOAT" /D "OPT_GENERIC" /D "NDEBUG" /D "_LIB" /D "_XBOX" /D "_UNICODE" /D "UNICODE" /FD /MD /Gy /fp:fast /Fo"Xbox 360\Release_Generic\\" /Fd"Xbox 360\Release_Generic\vc80.pdb" /W3 /c /TC /wd4996

"..\..\..\..\src\libmpg123\compat.c"

"..\..\..\..\src\libmpg123\tabinit.c"

"..\..\..\..\src\libmpg123\synth_s32.c"

"..\..\..\..\src\libmpg123\synth_real.c"

"..\..\..\..\src\libmpg123\synth_8bit.c"

"..\..\..\..\src\libmpg123\synth.c"

"..\..\..\..\src\libmpg123\stringbuf.c"

"..\..\..\..\src\libmpg123\readers.c"

"..\..\..\..\src\libmpg123\parse.c"

"..\..\..\..\src\libmpg123\optimize.c"

"..\..\..\..\src\libmpg123\ntom.c"

"..\..\msvc.c"

"..\..\..\..\src\libmpg123\libmpg123.c"

"..\..\..\..\src\libmpg123\layer3.c"

"..\..\..\..\src\libmpg123\layer2.c"

"..\..\..\..\src\libmpg123\layer1.c"

"..\..\..\..\src\libmpg123\index.c"

"..\..\..\..\src\libmpg123\id3.c"

"..\..\..\..\src\libmpg123\icy2utf8.c"

"..\..\..\..\src\libmpg123\icy.c"

"..\..\..\..\src\libmpg123\frame.c"

"..\..\..\..\src\libmpg123\format.c"

"..\..\..\..\src\libmpg123\feature.c"

"..\..\..\..\src\libmpg123\equalizer.c"

"..\..\..\..\src\libmpg123\dct64.c"
]
Creating command line "cl.exe @"c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg123-1.12.2\ports\MSVC++\2005\libmpg123\Xbox 360\Release_Generic\RSP0000334201008.rsp" /nologo"
Creating temporary file "c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg123-1.12.2\ports\MSVC++\2005\libmpg123\Xbox 360\Release_Generic\RSP0000344201008.rsp" with contents
[
/OUT:"C:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\Xbox 360\Release_Generic\libmpg123.lib" /LTCG

".\xbox 360\release_generic\compat.obj"

".\xbox 360\release_generic\dct64.obj"

".\xbox 360\release_generic\equalizer.obj"

".\xbox 360\release_generic\feature.obj"

".\xbox 360\release_generic\format.obj"

".\xbox 360\release_generic\frame.obj"

".\xbox 360\release_generic\icy.obj"

".\xbox 360\release_generic\icy2utf8.obj"

".\xbox 360\release_generic\id3.obj"

".\xbox 360\release_generic\index.obj"

".\xbox 360\release_generic\layer1.obj"

".\xbox 360\release_generic\layer2.obj"

".\xbox 360\release_generic\layer3.obj"

".\xbox 360\release_generic\libmpg123.obj"

".\xbox 360\release_generic\msvc.obj"

".\xbox 360\release_generic\ntom.obj"

".\xbox 360\release_generic\optimize.obj"

".\xbox 360\release_generic\parse.obj"

".\xbox 360\release_generic\readers.obj"

".\xbox 360\release_generic\stringbuf.obj"

".\xbox 360\release_generic\synth.obj"

".\xbox 360\release_generic\synth_8bit.obj"

".\xbox 360\release_generic\synth_real.obj"

".\xbox 360\release_generic\synth_s32.obj"

".\xbox 360\release_generic\tabinit.obj"
]
Creating command line "lib.exe @"c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg123-1.12.2\ports\MSVC++\2005\libmpg123\Xbox 360\Release_Generic\RSP0000344201008.rsp" /NOLOGO"


The problem is that I added a Reference to libmpg123 to my project and this (simple) code compiles but fails to link:

CODE
#include "stdafx.h"

void __cdecl cleanup(mpg123_handle *h) {
    debug_log("Called cleanup\n");

    mpg123_close(h);
    mpg123_delete(h);
    mpg123_exit();
}

void __cdecl main()
{
    mpg123_handle *mh;


    
    cleanup(mh);
    return;
}


stdafx.h as you imagine has mpg123.h (the one fixed for MSVC2005). Here is the build log:

CODE
Build Log
          
Build started: Project: mpg12360, Configuration: Release_LTCG|Xbox 360


Command Lines
          
Creating temporary file "c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg12360\Release_LTCG\RSP000039420760.rsp" with contents
[
/Ox /Os /GL /I "C:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg123-1.12.2\src\libmpg123" /I "C:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg123-1.12.2\ports\MSVC++" /D "NDEBUG" /D "_XBOX" /D "LTCG" /D "_MBCS" /GF /FD /MT /Gy /Yu"stdafx.h" /Fp"Release_LTCG/mpg12360.pch" /Fo"Release_LTCG\\" /Fd"Release_LTCG\vc80.pdb" /W3 /c /Zi /TP

".\debug.cpp"

".\mpg12360.cpp"
]
Creating command line "cl.exe @"c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg12360\Release_LTCG\RSP000039420760.rsp" /nologo"
Creating temporary file "c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg12360\Release_LTCG\RSP00003A420760.rsp" with contents
[
/Ox /Os /GL /I "C:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg123-1.12.2\src\libmpg123" /I "C:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg123-1.12.2\ports\MSVC++" /D "NDEBUG" /D "_XBOX" /D "LTCG" /D "_MBCS" /GF /FD /MT /Gy /Yc"stdafx.h" /Fp"Release_LTCG/mpg12360.pch" /Fo"Release_LTCG\\" /Fd"Release_LTCG\vc80.pdb" /W3 /c /Zi /TP

".\stdafx.cpp"
]
Creating command line "cl.exe @"c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg12360\Release_LTCG\RSP00003A420760.rsp" /nologo"
Creating temporary file "c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg12360\Release_LTCG\RSP00003B420760.rsp" with contents
[
/XEX:No /VERBOSE:LIB /OUT:"Release_LTCG\mpg12360.exe" /INCREMENTAL:NO /DEBUG /PDB:"Release_LTCG/mpg12360.pdb" /STACK:262144,262144 /OPT:REF /OPT:ICF /LTCG /RELEASE xapilib.lib d3d9ltcg.lib d3dx9.lib xgraphics.lib xboxkrnl.lib xnet.lib xaudioltcg.lib xactltcg.lib x3daudioltcg.lib vcomp.lib "..\xbox 360\release_generic\libmpg123.lib"

".\release_ltcg\stdafx.obj"

".\release_ltcg\mpg12360.obj"

".\release_ltcg\debug.obj"
]
Creating command line "link.exe @"c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg12360\Release_LTCG\RSP00003B420760.rsp" /NOLOGO"
Output Window
          
Compiling...
stdafx.cpp
Compiling...
debug.cpp
mpg12360.cpp
Linking...
Searching libraries
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\xapilib.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\d3d9ltcg.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\d3dx9.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\xgraphics.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\xboxkrnl.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\xnet.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\xaudioltcg.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\xactltcg.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\x3daudioltcg.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\vcomp.lib:
    Searching ..\xbox 360\release_generic\libmpg123.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\libcpmt.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\OLDNAMES.lib:
    Searching C:\Program Files\Microsoft Xbox 360 SDK\lib\xbox\LIBCMT.lib:
LINK : fatal error LNK1104: cannot open file 'XAPI.lib'
Results
          
Build log was saved at "file://c:\Users\Tatsh\My Documents\Visual Studio 2005\Projects\mpg12360\mpg12360\Release_LTCG\BuildLog.htm"
mpg12360 - 1 error(s), 0 warning(s)


There are only functions that use XAPI.lib and require Xbox.h to be #include'd which is in Xtl.h which is also of course in my stdafx.h file. I don't see where this is going wrong.

Thanks in advance
Logged

Tatsh

  • Archived User
  • Jr. Member
  • *
  • Posts: 67
Why Do I Need Xapi.lib Here?
« Reply #1 on: July 05, 2010, 05:04:00 PM »

Copied my copy of xapilib.lib to XAPI.lib and it compiles fine.

This project is not so simple after all even though libmpg123 does have ASM ready for PPC (but not PPC64). It uses too many UNIX functions that are only half-supported (and Microsoft could not care less). I prefer UNIX functions (POSIX as well), not sure why Microsoft wants to impose their API (including the secure CRT library (fopen_s, etc)).

I have a debug.log file being generated but it seems that _wopen() maybe cannot handle the paths like "game:\\test.mp3" (but maybe this is because of C compiling mode, or some #define that is not present in libmpg123 although it's an Xbox static library project)? And same goes for open and open_s. I didn't enable secure CRT for libmpg123 but I tried to use the functions and they still didn't work. (Also, I got tired of switching my flash drive from my PC to 360  sleeping.gif )

I have the source if anyone is interested in this. My plan is really to look at libmpg123 as its an excellent decoder for many platforms and just make a good MP3 decoder lib for Xbox 360/PPC64, optimised for 360 and ready for XAudio2 using the 360/Windows API. PM me if you are interested in helping with this effort.

Mainly I'm looking forward to finally having some multimedia homebrew on the 360. So far, it seems nothing much yet. But it's okay, it's tough to do.

Porting mplayer has the same problem as libmpg123 (and it even uses that lib for MP3s), which is the dependence on Microsoft's support for the C library and POSIX functions (some C99, which Microsoft barely supports; and POSIX has very little support other than _underscore functions that do not always do the same thing). But regardless, I'm sure the open source community won't mind a few #ifdef _XBOX >= 200 patches to make good things for the 360. And hopefully in the near future with a FREE compiler. The DX9 acceleration code for mplayer is already present AFAIK. So, that might be something I'll be looking into soon.
Logged