0

clangでコンパイルするobjective-Cを使用して、WindowsのGNUsetupでlibxml2を使用しようとしています。それは私にエラーを与え続けます:

$ 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
4

1 に答える 1

0

GNUmakefileにさらにフラグを追加してみることができます。

ADDITIONAL_INCLUDE_DIRS + = c:\ GNUstep \ include \ libxml2\..よく私はWindowsのmakefileでパスを指定する方法を本当に知りません。

リンクの問題があるかもしれません、遊んでください

ADDITIONAL_LIB_DIRS + =-L*あなたのdllパス..*

ADDITIONAL_OBJC_LIBS + = -lxml2

于 2013-01-13T14:18:05.343 に答える