Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build ngram and other extensions #34

Open
billsheh opened this issue Aug 17, 2020 · 4 comments
Open

Build ngram and other extensions #34

billsheh opened this issue Aug 17, 2020 · 4 comments
Assignees

Comments

@billsheh
Copy link

billsheh commented Aug 17, 2020

When I compile some other projects using fst with vs.net 201, got the following errors. Looks like it needs the ngram extension, please advise how to build it in vs.net with extension, very appreciated it!

model.obj: error LNK2019: Unresolved external symbol "public: unsigned __int64 __cdecl fst :: BitmapIndex :: Rank1 (unsigned __int64) const" (? Rank1 @ BitmapIndex @ fst @@ QEBA_K_K @ Z) in the function "public: class fst :: TropicalWeightTpl __cdecl fst :: internal :: NGramFstImpl <struct fst :: ArcTpl <class fst :: TropicalWeightTpl >> :: Final (int) const "(? Final @? $ NGramFstImpl @ U ? $ ArcTpl @ V? $ TropicalWeightTpl @ M @ fst @@@ fst @@@ internal @ fst @@ QEBA? AV? $ TropicalWeightTpl @ M @ 3 @ H @ Z) is referenced
model.obj: error LNK2019: unresolved external symbol "public: unsigned __int64 __cdecl fst :: BitmapIndex :: Select1 (unsigned __int64) const" (? Select1 @ BitmapIndex @ fst @@ QEBA_K_K @ Z) in function "public: virtual bool __cdecl fst :: NGramFstMatcher <struct fst :: ArcTpl <class fst :: TropicalWeightTpl >> :: Find (int) "(? Find @? $ NGramFstMatcher @ U? $ ArcTpl @ V? $ TropicalWeightTpl @ M @fst @@@ fst @@@ fst @@ UEAA_NH @ Z)
model.obj: error LNK2019: Unresolved external symbol "public: struct std :: pair <unsigned __int64, unsigned __int64> __cdecl fst :: BitmapIndex :: Select0s (unsigned __int64) const" (? Select0s @ BitmapIndex @ fst @@ QEBA? AU? $ Pair @ _K_K @ std @@ _ K @ Z) in the function "public: void __cdecl fst :: internal :: NGramFstImpl <struct fst :: ArcTpl <class fst :: TropicalWeightTpl > :: Init (char const *, bool, class fst :: MappedFile *) "(? Init @? $ NGramFstImpl @ U? $ ArcTpl @ V? $ TropicalWeightTpl @ M @ fst @@ fst @@@ internal @ fst @@ QEAAXPEBD_NPEAVMappedFile @ 3 @@ Z) is referenced
model.obj: error LNK2019: Unresolved external symbol "public: void __cdecl fst :: BitmapIndex :: BuildIndex (unsigned __int64 const *, unsigned __int64)" (? BuildIndex @ BitmapIndex @ fst @@ QEAAXPEB_K_K @ Z) in function "public: void __cdecl fst :: internal :: NGramFstImpl <struct fst :: ArcTpl <class fst :: TropicalWeightTpl >> :: Init (char const *, bool, class fst :: MappedFile *)" (? Init @? $ NGramFstImpl @ U? $ ArcTpl @ V? $ TropicalWeightTpl @ M @ fst @@@ fst @@@ internal @ fst @@ QEAAXPEBD_NPEAVMappedFile @ 3 @@ Z) is referenced
MSVCRTD.lib (exe_main.obj): error LNK2019: Unresolved external symbol main is referenced in function "int __cdecl invoke_main (void)" (? Invoke_main @@ YAHXZ)
@kkm000
Copy link
Owner

kkm000 commented Aug 21, 2020

Sorry, I never heard of "vs.net 201". What are you talking about?

@kkm000
Copy link
Owner

kkm000 commented Aug 21, 2020

But yeah, we're not compiling ngram extensions yet. You can use cmake though, it compiles everything the original Makefiles do.

@kkm000 kkm000 changed the title Need to build with extensions in vs.net Build ngram and other extensions Sep 26, 2020
@kkm000 kkm000 self-assigned this Sep 26, 2020
@LuggerMan
Copy link

If i compile extensions with cmake, will binaries be compatible with nmake? Trying to make alphacep/vosk work, gettin` the same error stack

@kkm000
Copy link
Owner

kkm000 commented May 3, 2021

@LuggerMan, depends on the compiler. CMake is only a meta-builder, the choice of the toolchain is yours. cl and clang-cl in fact use the same Microsoft's own code generation 2nd pass c2.dll. The Intel compiler, icc, is also compatible.

Looks like some source file where these symbols are defined is not compiled. It's possible that a file is compiled, but its .o file is discarded by the linker, since it does not have referenced symbols, essentially like this problem: #36 (comment). FWIW, it may happen only with static linking; can you try DLL build? It it goes through, that's a hint.

Unfortunately, I'm out of free cycles now to look into this. Will appreciate it if you diagnose the issue deeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants