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

例子链接错误:LINK : fatal error LNK1181: 无法打开输入文件“advapi32.obj” #17

Closed
hankchan opened this issue Dec 14, 2014 · 5 comments

Comments

@hankchan
Copy link

编译环境:

windows 8.1
X64位
visual studio 2010 旗舰版 

编译选型:

gyp.bat --depth=. pomelo.gyp -Dtarget_arch
=ia32 -Dno_tls_support=true -Dbuild_pypomelo=false  -Dbuild_jpomelo=false

其中 ia32和x64,都试过,均链接失败

错误信息:

1>LINK : fatal error LNK1181: 无法打开输入文件“advapi32.obj”

这个问题大家遇到过吗?

@cynron
Copy link
Member

cynron commented Dec 15, 2014

link错误你改一下link配置不就好了,你看看link的配置

@hankchan
Copy link
Author

@cynron
advapi32是系统库,在gyp文件中以 -ladvapi32.lib 的方式加入工程,不是简单的链接错误。
我确认advapi32.lib在工程路径中。

@cynron
Copy link
Member

cynron commented Dec 15, 2014

自己改一下就好了,这个又不费啥事,gyp只是一个辅助工具而已。一般情况下,生成的工程文件,出现问题的时候,手动改改就好了

@hankchan
Copy link
Author

将pomelo.gyp中

         'link_settings': {
            'libraries': [
              '-ladvapi32.lib',
            '-liphlpapi.lib',
            '-lpsapi.lib',
            '-lshell32.lib',
            '-lws2_32.lib'
              ],
          },

修改为(去掉.lib) :

         'link_settings': {
            'libraries': [
              '-ladvapi32',
            '-liphlpapi',
            '-lpsapi',
            '-lshell32',
            '-lws2_32'
              ],
          },

解决问题。

@cynron
Copy link
Member

cynron commented Dec 15, 2014

由于我们不可能对每个编译环境都做测试,比如VS的各个版本之间,可能配置项有不同,而且,当遇到这种比较明显的问题的时候,一般都可以通过自己手动修改解决的。

对你使用时遇到的问题,表示抱歉,多谢关注及反馈!

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

2 participants