question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

on windows, functions of libbleu are not found

See original GitHub issue

using microsoft visual compiler 14.0, fairseq 0.5.0 building libbleu dll by calling python setup.py build develop

functions in pyd are only exposed if they are declared as __declspec(dllexport).

problem is fixed if declaration of all exported C++ functions are changed, e.g.

extern "C" {
  __declspec(dllexport) void bleu_zero_init(bleu_stat* stat) {
    std::memset(stat, 0, sizeof(bleu_stat));
  }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ShilinHecommented, Dec 19, 2018

Let me elaborate more on the solution of @hollyhook. This issue is caused by the name changing problem during compiling. The compiler changed the function name, and thereby we cannot find the function.

To solve the problem, you should add __declspec(dllexport) before the function declaration. In this line (fairseq/fairseq/clib/libbleu/libbleu.cpp file), add the __declspec(dllexport) before function void bleu_zero_init, void bleu_one_init , and void bleu_add. Finally, call the python setup.py build develop, the problem would be fixed.

0reactions
eripcommented, Jan 5, 2020

I propose this should be re-opened. Requiring users to build your library from scratch is possible, but painful. I am not an expert at cross-compiling, but would it be as simple as conditionally adding the __declspec to the files in master? I don’t know if that directive impacts Linux or OS X builds.

Read more comments on GitHub >

github_iconTop Results From Across the Web

on windows, functions of libbleu are not found · Issue #292
Let me elaborate more on the solution of @hollyhook. This issue is caused by the name changing problem during compiling. The compiler changed ......
Read more >
Windows 10 Start and other functions not working.
Windows 10 Start and other functions not working. I have attempted all of the steps to get the Start menu to resume working...
Read more >
Why Window Functions Are Not Allowed in WHERE Clauses
Window functions can only appear in SELECT and ORDER BY but not in WHERE clauses. The reason is the logical order in which...
Read more >
Alias of window function field causing a "not found" error when ...
In this query, the reference to the row_num_alias field in the HAVING clause is causing the following error: Field 'row_num_alias' not found ......
Read more >
Error in windows() function
This issue is being caused by a property called masking. There are two methods called windows() , one is available in base R...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found