General Discussion

Nested
Visual Studio 2008 and main_decode.c in decode project
User: vkepuska
Date: 2/17/2010 10:45 am
Views: 6432
Rating: 12

I am trying to compile a single main file ( in main_decode.c).

 

The project set-up propelry links the sphinxbase library and includes  all the paths of includes . However it reports a link error:

 

The sphinx code uses this structure to establish exports and imports.

 

#ifndef __S3DECODER_EXPORT_H__

#define __S3DECODER_EXPORT_H__

 

/* Win32/WinCE DLL gunk */

#if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(CYGWIN)

#ifdef S3DECODER_EXPORTS

#define S3DECODER_EXPORT __declspec(dllexport)

#else

#define S3DECODER_EXPORT __declspec(dllimport)

#endif

#else /* !_WIN32 */

#ifdef HAVE_ATTRIBUTE_VISIBILITY

#define S3DECODER_EXPORT __attribute__ ((visibility("default")))

#else

#define S3DECODER_EXPORT

#endif

#endif

 

#if defined(__GNUC__) && __GNUC__ > 2

#define S3DECODER_DEPRECATED __attribute__ ((deprecated))

#else

#define S3DECODER_DEPRECATED

#endif

 

#endif /* __S3DECODER_EXPORT_H__ */

 

 

I triead including the above lines (that apply to Windows) and explicitly defined them for import as well as export. The pragmas were added in the main_decode.c before includes. However, there was no change in linking step (perhaps they are re-set in those includes). However, the search indicates that the definition of the constant occurs only in sphinx3_exports.h

 

One major difference is that the original Visual Studio project definiition was is Visual Studio 6.0 and I have Visual Studio 2008 (that required automatic conversion).

 

I have run out of ideas what coudl be the source of the problem. The output of the build process is given below

 

Thanks

 

--Veton

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Output of build

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

 

1>------ Build started: Project: sphinx3_decode, Configuration: Debug Win32 ------

1>Compiling...

1>main_decode.c

1>Linking...

1>main_decode.obj : error LNK2019: unresolved external symbol _kb_free referenced in function _main

1>main_decode.obj : error LNK2019: unresolved external symbol _stat_report_corpus referenced in function _main

1>main_decode.obj : error LNK2019: unresolved external symbol _ctl_process_utt referenced in function _main

1>main_decode.obj : error LNK2019: unresolved external symbol _ctl_process referenced in function _main

1>main_decode.obj : error LNK2019: unresolved external symbol _utt_decode referenced in function _main

1>main_decode.obj : error LNK2019: unresolved external symbol _kb_init referenced in function _main

1>.\..\..\..\..\bin\Debug/sphinx3_decode.exe : fatal error LNK1120: 6 unresolved externals

1>Build log was saved at "file://c:\Users\vkepuska\Documents\Development\SPHINX\tutorial\sphinx3\win32\msdev\programs\decode\Debug\BuildLog.htm"

1>sphinx3_decode - 7 error(s), 0 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

End Output of build

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

Thanks

 

Re: Visual Studio 2008 and main_decode.c in decode project
User: nsh
Date: 2/18/2010 6:42 pm
Views: 3161
Rating: 13

I ultimately recommend you to try pocketsphinx instead of sphinx3. You can learn more about versions of CMU decoders on cmusphinx website:

http://cmusphinx.sourceforge.net/versions/

PreviousNext