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

Leptonica - Link Error #42

Closed
rweldin opened this issue May 17, 2020 · 10 comments
Closed

Leptonica - Link Error #42

rweldin opened this issue May 17, 2020 · 10 comments
Labels
bug Something isn't working

Comments

@rweldin
Copy link

rweldin commented May 17, 2020

Linking for Leptonica fails with the following error:

3>LINK : fatal error LNK1181: cannot open input file 'pkg\89\dc\64e7\obj\bld\144693\lib\org.sw.demo.gif-5.2.1.lib'
3>Done building project "leptonica.vcxproj" -- FAILED.
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'm building with Visual Studio 2017 and generated a solution file with the following command:

cmake -G "Visual Studio 15 2017 Win64" -DBUILD_SHARED_LIBS=1 -DSW_BUILD_SHARED_LIBS=0 ..

Of note the org.sw.demo.gif-5.2.1.lib file is located at: pkg\89\dc\64e7\obj\bld\469698\lib, but the lib folder, 144693\lib, in the link error does not exist. This also appears to be an issue with the other dependencies as the solution points to the 144693\lib folder, but the other lib files are also located in the associated 469698\lib folder.

If you need any other information please let me know.

Information:
E:\src\repo\leptonica-master\win64>sw --version
sw.client.sw version 1.0.0
git revision 3831e99
assembled on
17.05.2020 13:43:42 UTC
17.05.2020 08:43:42 Central Daylight Time

Windows 10 x64

@rweldin rweldin added the bug Something isn't working label May 17, 2020
@egorpugin
Copy link
Contributor

Oh, yes, sorry. Couple of paths were unfixed.
sw --self-upgrade and try now. I've updated binaries.

@rweldin
Copy link
Author

rweldin commented May 17, 2020 via email

@rweldin
Copy link
Author

rweldin commented May 17, 2020

Egor, I'm also having linker issues with Tesseract as noted below. This may be a separate issue and I can open a new issue if you'd prefer, but it appears to be very similar. The simddetect.obj file causing the issue is located at: E:\src\repo\tesseract-master\win64\libtesseract.dir\Release, but Visual Studio is looking in E:\src\repo\tesseract-master\win64.

If you need anything else please let me know.

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "double __cdecl tesseract::DotProductFMA(double const *,double const *,int)" (?DotProductFMA@tesseract@@YANPEBN0H@Z) referenced in function "public: static void __cdecl tesseract::SIMDDetect::Update(void)" (?Update@SIMDDetect@tesseract@@Saxxz) libtesseract E:\src\repo\tesseract-master\win64\simddetect.obj 1

E:\src\repo\tesseract-master\win64>sw --version
sw.client.sw version 1.0.0
git revision 37cfa3b plus 3 modified files
assembled on
17.05.2020 16:22:03 UTC
17.05.2020 11:22:03 Central Daylight Time

On a side note when looking at the Additional Dependencies section in Visual Studio for my libtesseract project there were 14 duplicate entries. This likely has nothing to do with this linker issue and may not be a problem, but I thought I would point it out.

@egorpugin
Copy link
Contributor

egorpugin commented May 17, 2020

Yes, I also observed that. Someone changed tess files without fixing tess build. I'll check.

Upd.: this post is about build issue.

@egorpugin
Copy link
Contributor

On a side note when looking at the Additional Dependencies section in Visual Studio for my libtesseract project there were 14 duplicate entries.

Where do you see it? I see only unique libs.

image

@egorpugin
Copy link
Contributor

tess build error

  1. Can you open an issue on tesseract side? Sse/avx/fma code is not very well set in cmake build. I'm not sure how to better fix it (flags etc.). Implementers should know better.
  2. You can try to use sw build of tess.

@rweldin
Copy link
Author

rweldin commented May 17, 2020

I'll open an issue with the Tesseract group.

Regarding the dependencies issue I was looking at the Additional Dependencies string under the Linker > Input options. I used Excel to split the string and sorted it which you can see below. When viewing through the Edit section the true duplicates are removed, but my screenshots below contain libs of the same name that are in different build folders; I don't see that in your screenshot.

ADVAPI32.lib
advapi32.lib
C:\Users\AdminWeldin.sw\storage\pkg\00\4d\7be6\obj\bld\657802\lib\org.sw.demo.gnu.nettle.nettle-3.5.1.lib
C:\Users\AdminWeldin.sw\storage\pkg\00\4d\7be6\obj\bld\657802\lib\org.sw.demo.gnu.nettle.nettle-3.5.1.lib
C:\Users\AdminWeldin.sw\storage\pkg\2a\68\57cb\obj\bld\147106\lib\org.sw.demo.xz_utils.lzma-5.2.4.lib
C:\Users\AdminWeldin.sw\storage\pkg\2a\68\57cb\obj\bld\147106\lib\org.sw.demo.xz_utils.lzma-5.2.4.lib
C:\Users\AdminWeldin.sw\storage\pkg\2a\68\57cb\obj\bld\657802\lib\org.sw.demo.xz_utils.lzma-5.2.4.lib
C:\Users\AdminWeldin.sw\storage\pkg\41\dd\3fd5\obj\bld\147106\lib\org.sw.demo.gnu.iconv.libiconv-1.16.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\41\dd\3fd5\obj\bld\657802\lib\org.sw.demo.gnu.iconv.libiconv-1.16.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\41\dd\3fd5\obj\bld\657802\lib\org.sw.demo.gnu.iconv.libiconv-1.16.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\42\70\b9e7\obj\bld\657802\lib\org.sw.demo.lz4-1.9.2.lib
C:\Users\AdminWeldin.sw\storage\pkg\42\70\b9e7\obj\bld\657802\lib\org.sw.demo.lz4-1.9.2.lib
C:\Users\AdminWeldin.sw\storage\pkg\5f\22\3837\obj\bld\147106\lib\org.sw.demo.gnu.iconv.libcharset-1.16.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\5f\22\3837\obj\bld\657802\lib\org.sw.demo.gnu.iconv.libcharset-1.16.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\5f\22\3837\obj\bld\657802\lib\org.sw.demo.gnu.iconv.libcharset-1.16.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\63\c5\6249\obj\bld\657802\lib\org.sw.demo.xmlsoft.libxml2-2.9.10.lib
C:\Users\AdminWeldin.sw\storage\pkg\63\c5\6249\obj\bld\657802\lib\org.sw.demo.xmlsoft.libxml2-2.9.10.lib
C:\Users\AdminWeldin.sw\storage\pkg\75\6a\600e\obj\bld\657802\lib\org.sw.demo.danbloomberg.leptonica-1.80.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\75\6a\600e\obj\bld\657802\lib\org.sw.demo.danbloomberg.leptonica-1.80.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\76\c7\435a\obj\bld\657802\lib\org.sw.demo.facebook.zstd.zstd-1.4.4.lib
C:\Users\AdminWeldin.sw\storage\pkg\76\c7\435a\obj\bld\657802\lib\org.sw.demo.facebook.zstd.zstd-1.4.4.lib
C:\Users\AdminWeldin.sw\storage\pkg\9b\07\5d05\obj\bld\657802\lib\org.sw.demo.libarchive.libarchive-3.4.2.lib
C:\Users\AdminWeldin.sw\storage\pkg\9b\07\5d05\obj\bld\657802\lib\org.sw.demo.libarchive.libarchive-3.4.2.lib
C:\Users\AdminWeldin.sw\storage\pkg\b8\73\733e\obj\bld\657802\lib\org.sw.demo.oberhumer.lzo.lzo-2.10.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\b8\73\733e\obj\bld\657802\lib\org.sw.demo.oberhumer.lzo.lzo-2.10.0.lib
C:\Users\AdminWeldin.sw\storage\pkg\ce\99\b2f8\obj\bld\147106\lib\org.sw.demo.madler.zlib-1.2.11.lib
C:\Users\AdminWeldin.sw\storage\pkg\ce\99\b2f8\obj\bld\147106\lib\org.sw.demo.madler.zlib-1.2.11.lib
C:\Users\AdminWeldin.sw\storage\pkg\ce\99\b2f8\obj\bld\657802\lib\org.sw.demo.madler.zlib-1.2.11.lib
C:\Users\AdminWeldin.sw\storage\pkg\eb\0c\8faa\obj\bld\147106\lib\org.sw.demo.bzip2-1.0.8.lib
C:\Users\AdminWeldin.sw\storage\pkg\eb\0c\8faa\obj\bld\147106\lib\org.sw.demo.bzip2-1.0.8.lib
C:\Users\AdminWeldin.sw\storage\pkg\eb\0c\8faa\obj\bld\657802\lib\org.sw.demo.bzip2-1.0.8.lib
comdlg32.lib
gdi32.lib
kernel32.lib
ole32.lib
oleaut32.lib
shell32.lib
USER32.lib
user32.lib
uuid.lib
winspool.lib
Ws2_32.lib

Prop
AD

@egorpugin
Copy link
Contributor

I see.
I don't want to investigate this deeply, but I'll keep it in mind.

@egorpugin
Copy link
Contributor

See tesseract-ocr/tesseract#2986 about cmake error.

@rweldin
Copy link
Author

rweldin commented May 18, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants