我正在研究A makefile config类型。首先,我ran nmake 命令认为它可能会告诉我文件在哪里,但是我有一个错误: nmake:致命错误u1064:找不到makefile且未找到目标
> ,我认为没有一个,我必须做到这一点。因此,我制作了一个文件并将其命名为 makefile ,在内部我只添加了一行 jnilib = c:\ program Files \ java \ jdk1.8.0_333 \ lib \ lib \ jvm.lib
我以为我需要。之后,我再次运行 nmake ,只有这次我回来了:
Microsoft (R) Program Maintenance Utility Version 14.29.30141.0
Copyright (C) Microsoft Corporation. All rights reserved.
但是问题仍然存在,那是错误lnk2019未解决的外部符号
。这意味着我做错了什么,但是老实说,我不知道如何使用 makefile 清楚地显示出来(也许我需要在文件中添加更多,或者我写的错误是错误的) 。
谁能帮我克服这个错误?那是我唯一的问题,如何告诉它我正在从该位置使用该库。
I was working on a tutorial project I found on another website where it explains how to use Java inside a C++ project (this is just for context, isn't the important part). The project was working as it should. After that I wanted to copy the code to another project, but this time it was of Makefile config type. First I ran nmake command thinking that it might tell me where the file is, but I got an error instead: NMAKE : fatal error U1064: MAKEFILE not found and no target specified
, which I thought that there isn't one, and I have to make it. So I made a file and named it Makefile and inside I added only one line JNILIB=C:\Program Files\Java\jdk1.8.0_333\lib\jvm.lib
that I thought I need. After that I ran nmake again, only this time I got back:
Microsoft (R) Program Maintenance Utility Version 14.29.30141.0
Copyright (C) Microsoft Corporation. All rights reserved.
But the problem still persists and that is Error LNK2019 unresolved external symbol
. This means I'm doing something wrong, but to be honest I don't know how to use Makefile which clearly shows (maybe I need to add more to the file, or what I wrote is wrong).
Can anyone help me get past this error? That is the only problem I have, how to tell it that I'm using that library from that location.
发布评论
评论(1)
我不熟悉使用
nmake
。以下是我进行的测试,将DLL与CPP相同的目录。makefile:
I am not familiar with using
nmake
. Below is a test I did, putting the DLL in the same directory as cpp.makefile: