【问题标题】:GNUSetup objective-c , can't find libxml/tree.h' file not foundGNUSetup objective-c,找不到 libxml/tree.h' 文件未找到
【发布时间】:2013-01-13 13:35:23
【问题描述】:

我尝试使用 Objective-C 在 Windows 中的 GNUsetup 中使用 libxml2 用clang编译。 它一直给我错误:

$ make CC=clang 
This is gnustep-make 2.6.2. Type 'make print-gnustep-make-help' for help.
Making all for tool sample_app...
 Compiling file HtmlParser.m ...
In file included from HtmlParser.m:1:
./HtmlParser.h:2:9: fatal error: 'libxml/tree.h' file not found
#import <libxml/tree.h>
        ^
1 error generated.
make[3]: *** [obj/sample_app.obj/HtmlParser.m.o] Error 1
make[2]: *** [internal-tool-all_] Error 2
make[1]: *** [sample_app.all.tool.variables] Error 2
make: *** [internal-all] Error 2

文件确实存在于 :c:\GNUstep\include\libxml2\libxml\

这是我编译文件的 GNUsetup 文件

include $(GNUSTEP_MAKEFILES)/common.make



TOOL_NAME = sample_app

sample_app_HEADERS = HttpManager.h UT.h HtmlParser.h
sample_app_OBJC_FILES = main.m HttpManager.m UT.m HtmlParser.m
sample_app_RESOURCE_FILES =

include $(GNUSTEP_MAKEFILES)/tool.make

这是我的包含 libxml2 标头的文件

#import <Foundation/Foundation.h>
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/HTMLparser.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>

@interface HtmlParser
{
    NSString* encoding;
}


-(id)init
{
    self = [super init];
    if(self) {
        encoding = @"UTF-8";
    }

    return self;

}


-(void)ExtractInnerSiteLinks:(NSString*) PageHtml:(NSString*) url;


@end

【问题讨论】:

    标签: objective-c windows gnustep


    【解决方案1】:

    您可以尝试在 GNUmakefile 中添加更多标志,例如。

    ADDITIONAL_INCLUDE_DIRS += c:\GNUstep\include\libxml2\ .. 我真的不知道如何在 Windows 上的 makefile 中指定路径..

    可能你会有链接问题,玩一下

    ADDITIONAL_LIB_DIRS += -L*你的 dll 路径..*

    ADDITIONAL_OBJC_LIBS += -lxml2

    【讨论】:

    • 添加:ADDITIONAL_INCLUDE_DIRS +=c:/GNUstep/include/libxml2 ADDITIONAL_LIB_DIRS += -Lc:/GNUstep/lib ADDITIONAL_OBJC_LIBS += -lxml2 但仍然出现错误
    • 您可以使用 -n 并 grep 实际执行编译的命令并找出问题所在。
    猜你喜欢
    • 2012-01-18
    • 1970-01-01
    • 1970-01-01
    • 2016-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-20
    相关资源
    最近更新 更多