lifthrasiir / rust-encoding

Character encoding support for Rust
MIT License
284 stars 59 forks source link

rust-encoding failed to compile with rust-msvc_x64 #90

Open sbant opened 9 years ago

sbant commented 9 years ago

libencoding-628a0580477da326.rlib(encoding-628a0580477da326.0.o) : error LNK2019: unresolved external symbol impZN6euc_kr20BACKWARD_TABLE_UPPER20h7dcfe3eed7745131q6oE referenced in function _ZN6euc_kr8backward20h382884ad758a08bazDpE libencoding-628a0580477da326.rlib(encoding-628a0580477da326.0.o) : error LNK2019: unresolved external symbol impZN6euc_kr20BACKWARD_TABLE_LOWER20h7dcfe3eed7745131RlgE referenced in function _ZN6euc_kr8backward20h382884ad758a08bazDpE libencoding-628a0580477da326.rlib(encoding-628a0580477da326.0.o) : error LNK2019: unresolved external symbol impZN6euc_kr13FORWARD_TABLE20h7dcfe3eed7745131gaaE referenced in function _ZN6euc_kr7forward20h893f5ab6f8728033rlgE libencoding-628a0580477da326.rlib(encoding-628a0580477da326.0.o) : error LNK2019: unresolved external symbol impZN7jis020820BACKWARD_TABLE_UPPER20h8b1de7443deb80aa6MiE referenced in function _ZN7jis02088backward20h25fc7b114b367a7dstjE libencoding-628a0580477da326.rlib(encoding-628a0580477da326.0.o) : error LNK2019: unresolved external symbol impZN7jis020820BACKWARD_TABLE_LOWER20h8b1de7443deb80aaT3cE referenced in function _ZN7jis02088backward20h25fc7b114b367a7dstjE .........

many link errors.

lifthrasiir commented 9 years ago

That sounds like a linkage error and not a fault of Encoding. Did you use Cargo with an ordinary dependency or a direct command line to rustc? (AFAIK Cargo does not have MSVC support at the moment, but it might have been changed.)

sbant commented 9 years ago

sorry, I found may be some problem in RustDT.

In command line,with "cargo build", both gnu and msvc cargo can build the project without problem.

But in RustDT, looks like it will mix the gnu's and msvc's rlib, so there are so many linkage errors.

therustmonk commented 9 years ago

I have the same problem. Build success, but lib fails on tests (or when I use items from lib in code): https://gist.github.com/DenisKolodin/f45760e6d1883fda0652 I've gist cargo test log with verbose flag.

Cargo calls MS linker. "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib" "C:\DEVELOPMENT\rustio\rust-encoding\target\debug\examples\recode.0.o" "/OUT:C:\DEVELOPMENT\rustio\rust-encoding\target\debug\examples\recode.exe" "/OPT:REF,ICF" "/DEBUG" "C:\DEVELOPMENT\rustio\rust-encoding\target\debug\libencoding.rlib" "C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libencoding_index_singlebyte-d3520d24c050d74f.rlib" "C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libencoding_index_korean-6a481ab62fa85cae.rlib" "C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libencoding_types-fe8521ccc808562d.rlib" "C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libencoding_index_simpchinese-bbf6de1c29d64619.rlib" "C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libencoding_index_tradchinese-50f5d4943fa2e14a.rlib" "C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libencoding_index_japanese-504681e476128dbc.rlib" "C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps\libgetopts-bd82d57ca5684ae5.rlib" "C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib\libstd-10cbabc2.rlib" "C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib\libcollections-10cbabc2.rlib" "C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib\librustc_unicode-10cbabc2.rlib" "C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib\librand-10cbabc2.rlib" "C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib\liballoc-10cbabc2.rlib" "C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib\liballoc_system-10cbabc2.rlib" "C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib\liblibc-10cbabc2.rlib" "C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib\libcore-10cbabc2.rlib" "/LIBPATH:C:\DEVELOPMENT\rustio\rust-encoding\target\debug" "/LIBPATH:C:\DEVELOPMENT\rustio\rust-encoding\target\debug\deps" "/LIBPATH:C:\Rust\rust-nightly-i686-pc-windows-msvc\bin\rustlib\i686-pc-windows-msvc\lib" "/LIBPATH:C:\DEVELOPMENT\rustio\rust-encoding.rust\bin\i686-pc-windows-msvc" "/LIBPATH:C:\DEVELOPMENT\rustio\rust-encoding\bin\i686-pc-windows-msvc" "ws2_32.lib" "userenv.lib" "advapi32.lib" "kernel32.lib" "shell32.lib" "msvcrt.lib" "compiler-rt.lib"

Other crates compiles with MSVC version without similar errors. With gnu version that tests was passed. Any ideas how can I help to fix it?

DoumanAsh commented 7 years ago

JFYI: been playing with this crate, don't see any problem to compile it om msvc compiler