链接到libsodium时出现nim链接器错误

时间:2016-03-11 15:02:05

标签: nim libsodium

我在Windows 7(64位)上。

我的nim版本是:Nim Compiler Version 0.12.0 (2015-12-15) [Windows: i386]

我尝试用这个nim包装器(https://github.com/jedisct1/libsodium)构建libsodium(https://github.com/judofyr/sodium.nim) 我用VS2013 -> Release Win32

编译了libsodium

我看到了libsodium.lib 我把nim包装纸放在它旁边。

所以它看起来像这样:

\libsodium-1.0.2\Build\Release\Win32\nimwrapper.nim
\libsodium-1.0.2\Build\Release\Win32\libsodium.lib

现在我尝试用。编译包装器 nim c nimwrapper.nim

现在我看到以下错误消息:

C:\Users\hello\Downloads\libsodium-1.0.2\Build\Release\Win32>nim c nimwrapper.nim
Hint: system [Processing]
Hint: nimwrapper [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
CC: nimwrapper
c:\users\hello\downloads\libsodium-1.0.2\build\release\win32\nimcache\nimwrapper.c: In function 'nimwrapperInit000':
c:\users\hello\downloads\libsodium-1.0.2\build\release\win32\nimcache\nimwrapper.c:449:2: error: incompatible type for argument 1 of 'HEX24_108328'
  LOC2 = HEX24_108328(sig_108406);
  ^
In file included from c:\users\hello\downloads\libsodium-1.0.2\build\release\win32\nimcache\nimwrapper.c:9:0:
c:\users\hello\downloads\libsodium-1.0.2\build\release\win32\nimcache\nimwrapper.c:330:27: note: expected 'struct Signature108092 *' but argument is of type '
Signature108092'
 N_NIMCALL(NimStringDesc*, HEX24_108328)(Signature108092* sig) {
                           ^
C:\Nim\lib/nimbase.h:168:57: note: in definition of macro 'N_NIMCALL'
 #    define N_NIMCALL(rettype, name) rettype __fastcall name
                                                         ^
Hint:  [Link]
gcc.exe: error: c:\users\hello\downloads\libsodium-1.0.2\build\release\win32\nimcache\nimwrapper.o: No such file or directory
Error: execution of an external program failed: 'gcc.exe   -o c:\users\hello\downloads\libsodium-1.0.2\build\release\win32\nimwrapper.exe  c:\users\hello\do
wnloads\libsodium-1.0.2\build\release\win32\nimcache\stdlib_parseutils.o c:\users\hello\downloads\libsodium-1.0.2\build\release\win32\nimcache\stdlib_strutils
.o c:\users\hello\downloads\libsodium-1.0.2\build\release\win32\nimcache\stdlib_system.o c:\users\hello\downloads\libsodium-1.0.2\build\release\win32\nimcac
he\nimwrapper.o  -lsodium '

C:\Users\hello\Downloads\libsodium-1.0.2\Build\Release\Win32>

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

我在Linux上遇到同样的错误,将其作为错误提交:https://github.com/nim-lang/Nim/issues/3962