Windowsプラットフォームでobjective-cソースコードをコンパイルするときに問題が発生します。もちろん、WindowsプラットフォームでObjective-cソースコードをコンパイルします。通常はgnustep環境(gccobjecitve-cコンパイラ。gnusteplibojc動的ライブラリ。gnustepファンデーションフレームワークなど)を使用します。
しかし、クリーンな環境が必要なのは、コンパイラのObjective-cを試して、別のlibobjcライブラリを使用することです。
mac osx10.6以降。アップルはmacosxシステムをx86プラットフォームに移動し(ppcはもうサポートしていません)、そしてcocoatech.includeiTunesによるシステムアプリケーションを書き直します。
とiTunesにはWindows版があります。
iTunes.iのインストール後にシステムフォルダを検索すると、次の場所にサポートdllファイルが見つかりました。
C:\Program Files (x86)\Common Files\Apple\Apple Application Support
ちなみに、私のシステムはWindows7x86_64です。
私はそれが持っていることを発見しました:
ApplePushService.dll
AppleVersions.dll
APSDaemon_main.dll
ASL.dll
AVFoundationCF.dll
CFNetwork.dll
CoreAudioToolbox.dll
CoreFoundation.dll
CoreGraphics.dll
CoreMedia.dll
CoreText.dll
CoreVideo.dll
Foundation.dll
icudt46.dll
icuin40.dll
icuuc40.dll
JavaScriptCore.dll
libcache.dll
libdispatch.dll
libicuin.dll
libicuuc.dll
libtidy.dll
libxml2.dll
libxslt.dll
MediaToolbox.dll
objc.dll
pthreadVC2.dll
QTMovieWin.dll
QuartzCore.dll
SQLite3.dll
VideoToolbox.dll
WebKit.dll
WebKitQuartzCoreAdditions.dll
YSCrashDump.dll
YSUtilities.dll
zlib1.dll
アップルは、これらの低レベルのフレームワークをWindowsプラットフォームに実装しているように見えます。
CFNetwork.framework -> CFNetwork.dll
CoreGraphics.framework -> CoreGraphics.dll
Foundation.framework -> Foundation.dll
libobjc.a.dylib -> objc.dll
WebKit.framework -> WebKit.dll
だから、私はアップルのlibobjcリリースバージョンを使用する方が良いと思います(iTunesはうまく動作しています)。他のライブラリファイルも便利です。
Objective-Cの初心者(クラスメートと私)のための学習環境を構築したいと思います。
だから私はobjc.dllをコピーしてlibobjc.dllに名前を変更します
mingwツール「pexports」を使用してlibobjc.dllのdefをlibobjc.defにエクスポートし、次にVisualStudioコマンドツール「lib.exe」を使用して.defファイルをlibobjc.libに変換します。
それから私はダウンロードします
- mingw64のx86(32ビット)コンパイラdngプリコンパイル済みパッケージ。
- mingw64のclang+llvm(32ビット)コンパイラdngプリコンパイル済みパッケージ。
- mingw64のmsys環境のプリコンパイル済みパッケージ。
これらの3つのパッケージをシステムにインストールします。次に、libobjc.dll、libobjc.libを/ libにコピーします(Windowsプラットフォームでは、同じbin形式を使用する.aと.lib)。
それから私はサンプルのobjective-cソースコードを書きました。コードはここにあります:file:test.m
#import <stdio.h>
@interface Foo {
int count;
}
+ (void)fooWithBar;
@end
@implementation Foo
+ (void)fooWithBar {
printf("abc");
}
@end
int main(){
[Foo fooWithBar];
return 0;
}
単にそれをコンパイルします:
clang test.m
エラーが発生した場合、-vオプションを使用すると詳細が表示されます。
clang version 3.1 (branches/release_31)
Target: i686-w64-mingw32
Thread model: posix
"c:/mingw64w32/bin/clang.exe" -cc1 -triple i686-w64-mingw32 -S -disable-free -main-file-name test.m -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.20.51.0.2 -momit-leaf-frame-pointer -v -resource-dir "c:/mingw64w32/bin\\..\\lib\\clang\\3.1" -fmodule-cache-path "C:/Users/Joe/AppData/Local/Temp\\clang-module-cache" -fno-dwarf-directory-asm -fdebug-compilation-dir C:/MINGW64-X86-MSYS-20111123/home/Joe -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-use-cxa-atexit -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fobjc-exceptions -fdiagnostics-show-option -o C:/Users/Joe/AppData/Local/Temp/test-709512.s -x objective-c test.m
clang -cc1 version 3.1 based upon LLVM 3.1 default target i686-w64-mingw32
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "c:/mingw64w32/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
ignoring nonexistent directory "c:/mingw/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
c:/mingw64w32/bin/../lib/clang/3.1/include
c:/mingw64w32/bin/../lib/clang/3.1/../../../i686-w64-mingw32/include
c:/mingw64w32/bin/../lib/clang/3.1/../../../include
End of search list.
"c:/mingw64w32/bin/i686-w64-mingw32-gcc.exe" -v -c -o C:/Users/Joe/AppData/Local/Temp/test-709513.o -x assembler C:/Users/Joe/AppData/Local/Temp/test-709512.s
Using built-in specs.
COLLECT_GCC=c:/mingw64w32/bin/i686-w64-mingw32-gcc.exe
Target: i686-w64-mingw32
Configured with: /home/drangon/work/mingw-w64-dgn_32/source/gcc/configure --host=i686-w64-mingw32 --target=i686-w64-mingw32 --disable-nls --enable-languages=c,c++,objc,obj-c++ --with-gmp=/home/drangon/work/mingw-w64-dgn_32/build/for_target --enable-twoprocess --disable-libstdcxx-pch --disable-win32-registry --prefix=/home/drangon/work/mingw-w64-dgn_32/target --with-sysroot=/home/drangon/work/mingw-w64-dgn_32/target
Thread model: win32
gcc version 4.7.2 20120823 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'C:/Users/Joe/AppData/Local/Temp/test-709513.o' '-mtune=generic' '-march=pentiumpro'
c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/as.exe -v -o C:/Users/Joe/AppData/Local/Temp/test-709513.o C:/Users/Joe/AppData/Local/Temp/test-709512.s
GNU assembler version 2.23.51 (i686-w64-mingw32) using BFD version (GNU Binutils) 2.23.51.20120823
COMPILER_PATH=c:/mingw64w32/bin/../libexec/gcc/i686-w64-mingw32/4.7.2/;c:/mingw64w32/bin/../libexec/gcc/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/
LIBRARY_PATH=c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/;c:/mingw64w32/bin/../lib/gcc/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/../lib/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../lib/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../
COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'C:/Users/Joe/AppData/Local/Temp/test-709513.o' '-mtune=generic' '-march=pentiumpro'
"c:/mingw64w32/bin/i686-w64-mingw32-gcc.exe" -v -o a.out C:/Users/Joe/AppData/Local/Temp/test-709513.o
Using built-in specs.
COLLECT_GCC=c:/mingw64w32/bin/i686-w64-mingw32-gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw64w32/bin/../libexec/gcc/i686-w64-mingw32/4.7.2/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: /home/drangon/work/mingw-w64-dgn_32/source/gcc/configure --host=i686-w64-mingw32 --target=i686-w64-mingw32 --disable-nls --enable-languages=c,c++,objc,obj-c++ --with-gmp=/home/drangon/work/mingw-w64-dgn_32/build/for_target --enable-twoprocess --disable-libstdcxx-pch --disable-win32-registry --prefix=/home/drangon/work/mingw-w64-dgn_32/target --with-sysroot=/home/drangon/work/mingw-w64-dgn_32/target
Thread model: win32
gcc version 4.7.2 20120823 (prerelease) (GCC)
COMPILER_PATH=c:/mingw64w32/bin/../libexec/gcc/i686-w64-mingw32/4.7.2/;c:/mingw64w32/bin/../libexec/gcc/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/
LIBRARY_PATH=c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/;c:/mingw64w32/bin/../lib/gcc/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/../lib/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../lib/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/;c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../
COLLECT_GCC_OPTIONS='-v' '-o' 'a.out' '-mtune=generic' '-march=pentiumpro'
c:/mingw64w32/bin/../libexec/gcc/i686-w64-mingw32/4.7.2/collect2.exe --sysroot=/home/drangon/work/mingw-w64-dgn_32/target -m i386pe -Bdynamic -o a.out c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/../lib/crt2.o c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/crtbegin.o -Lc:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2 -Lc:/mingw64w32/bin/../lib/gcc -Lc:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/../lib -Lc:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../lib -Lc:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib -Lc:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../.. C:/Users/Joe/AppData/Local/Temp/test-709513.o -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/crtend.o
C:/Users/Joe/AppData/Local/Temp/test-709513.o:fake:(.text+0x4d): undefined reference to `objc_lookup_class'
C:/Users/Joe/AppData/Local/Temp/test-709513.o:fake:(.text+0x62): undefined reference to `objc_msg_lookup'
C:/Users/Joe/AppData/Local/Temp/test-709513.o:fake:(.text+0x9e): undefined reference to `__objc_exec_class'
c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: C:/Users/Joe/AppData/Local/Temp/test-709513.o: bad reloc address 0x14 in section `.data'
c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
グーグル検索で、objc_lookup_classがgnustepのlibobjcライブラリで定義されているメソッドであることがわかりました。アップルのlibojbc.dllの.defファイル: "libojbc.def"で、"objc_lookUpClass"という名前の別のメソッドが見つかりました。グーグル検索again.so、アップルのlibojbcはgnustepのlibobjcとは異なります。NextStepライブラリinterface.gnustepを使用したアップルのlibojbcは別のものを作成しました。
man gcc
gccにはこれに関して2つのオプションがあります。
-fgnu-runtime
。これは、gnuスタイルのランタイムを使用したgccのデフォルトオプションです。
-fnext-runtime
、これはnextstep(現在はアップル)スタイルの実行を使用しています。
だから私はnextstepスタイルのオプションをclang(またはgcc?)に渡します。
clang -fnext-runtime
エラーなしで.oを.sにコンパイルします。ld.exeがアップルのlibobjcライブラリファイルから必要なすべてのメソッドを見つけるように見えますが、-vオプションを使用すると、別のエラーが発生します。詳細は次のとおりです。
clang version 3.1 (branches/release_31)
Target: i686-w64-mingw32
Thread model: posix
"c:/mingw64w32/bin/clang.exe" -cc1 -triple i686-w64-mingw32 -S -disable-free -main-file-name test.m -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.20.51.0.2 -momit-leaf-frame-pointer -v -resource-dir "c:/mingw64w32/bin\\..\\lib\\clang\\3.1" -fmodule-cache-path "C:/Users/Joe/AppData/Local/Temp\\clang-module-cache" -fno-dwarf-directory-asm -fdebug-compilation-dir C:/MINGW64-X86-MSYS-20111123/home/Joe -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-use-cxa-atexit -fobjc-fragile-abi -fobjc-exceptions -fdiagnostics-show-option -o C:/Users/Joe/AppData/Local/Temp/test-467378.s -x objective-c test.m
clang -cc1 version 3.1 based upon LLVM 3.1 default target i686-w64-mingw32
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "c:/mingw64w32/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
ignoring nonexistent directory "c:/mingw/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
c:/mingw64w32/bin/../lib/clang/3.1/include
c:/mingw64w32/bin/../lib/clang/3.1/../../../i686-w64-mingw32/include
c:/mingw64w32/bin/../lib/clang/3.1/../../../include
End of search list.
"c:/mingw64w32/bin/i686-w64-mingw32-gcc.exe" -fnext-runtime -v -c -o C:/Users/Joe/AppData/Local/Temp/test-467379.o -x assembler C:/Users/Joe/AppData/Local/Temp/test-467378.s
Using built-in specs.
COLLECT_GCC=c:/mingw64w32/bin/i686-w64-mingw32-gcc.exe
Target: i686-w64-mingw32
Configured with: /home/drangon/work/mingw-w64-dgn_32/source/gcc/configure --host=i686-w64-mingw32 --target=i686-w64-mingw32 --disable-nls --enable-languages=c,c++,objc,obj-c++ --with-gmp=/home/drangon/work/mingw-w64-dgn_32/build/for_target --enable-twoprocess --disable-libstdcxx-pch --disable-win32-registry --prefix=/home/drangon/work/mingw-w64-dgn_32/target --with-sysroot=/home/drangon/work/mingw-w64-dgn_32/target
Thread model: win32
gcc version 4.7.2 20120823 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-fnext-runtime' '-v' '-c' '-o' 'C:/Users/Joe/AppData/Local/Temp/test-467379.o' '-mtune=generic' '-march=pentiumpro'
c:/mingw64w32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/as.exe -v -o C:/Users/Joe/AppData/Local/Temp/test-467379.o C:/Users/Joe/AppData/Local/Temp/test-467378.s
GNU assembler version 2.23.51 (i686-w64-mingw32) using BFD version (GNU Binutils) 2.23.51.20120823
C:/Users/Joe/AppData/Local/Temp/test-467378.s: Assembler messages:
C:/Users/Joe/AppData/Local/Temp/test-467378.s:4: Error: unknown pseudo-op: `.lazy_reference'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:57: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:57: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:67: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:67: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:76: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:76: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:92: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:92: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:99: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:99: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:107: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:107: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:123: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:123: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:128: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:128: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:133: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:133: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:137: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:137: Error: junk at end of line, first unrecognized character is `,'
C:/Users/Joe/AppData/Local/Temp/test-467378.s:146: Error: bad or irreducible absolute expression
C:/Users/Joe/AppData/Local/Temp/test-467378.s:146: Error: junk at end of line, first unrecognized character is `,'
clang: error: assembler (via gcc) command failed with exit code 1 (use -v to see invocation)
アセンブラー言語がわかりませんが、アセンブラーアプリがこの.sファイルを理解できなかったようです。だから私は.sファイルを保持するために-Sオプションを使用しています.oneは-fgnu-runtimeでclangです。もう1つは-fnext-runtimeを使用したclangです。
//test.s、-fgnu-runtimeオプション付きのclang
.def __c_Foo__fooWithBar;
.scl 3;
.type 32;
.endef
.text
.align 16, 0x90
__c_Foo__fooWithBar:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl 12(%ebp), %eax
movl 8(%ebp), %ecx
leal L_.str, %edx
movl %ecx, -4(%ebp)
movl %eax, -8(%ebp)
movl %edx, (%esp)
calll _printf
movl %eax, -12(%ebp)
addl $16, %esp
popl %ebp
ret
.def _main;
.scl 2;
.type 32;
.endef
.globl _main
.align 16, 0x90
_main:
pushl %ebp
movl %esp, %ebp
pushl %esi
subl $20, %esp
calll ___main
leal L_.class_name, %eax
movl $0, -8(%ebp)
movl %eax, (%esp)
calll _objc_lookup_class
leal _.objc_selector_list, %ecx
movl %eax, (%esp)
movl %ecx, 4(%esp)
movl %eax, -12(%ebp)
calll _objc_msg_lookup
movl $0, %ecx
leal _.objc_selector_list, %edx
movl -12(%ebp), %esi
movl %esi, (%esp)
movl %edx, 4(%esp)
movl %ecx, -16(%ebp)
calll *%eax
movl -16(%ebp), %eax
addl $20, %esp
popl %esi
popl %ebp
ret
.def _.objc_load_function;
.scl 3;
.type 32;
.endef
.align 16, 0x90
_.objc_load_function:
.cfi_startproc
pushl %ebp
Ltmp2:
.cfi_def_cfa_offset 8
Ltmp3:
.cfi_offset %ebp, -8
movl %esp, %ebp
Ltmp4:
.cfi_def_cfa_register %ebp
pushl %eax
leal ___unnamed_1, %eax
movl %eax, (%esp)
calll ___objc_exec_class
addl $4, %esp
popl %ebp
ret
.cfi_endproc
.data
L_.str:
.asciz "abc"
.globl ___objc_class_name_Foo
.align 4
___objc_class_name_Foo:
.long 0
L___unnamed_2:
.asciz "count"
L___unnamed_3:
.asciz "i"
.globl ___objc_ivar_offset_value_Foo.count
.align 4
___objc_ivar_offset_value_Foo.count:
.long 0
.align 4
_.ivar.offsets:
.long ___objc_ivar_offset_value_Foo.count
.lcomm _.objc_property_list,8,8
L___unnamed_4:
.asciz "v8@0:4"
L___unnamed_5:
.asciz "fooWithBar"
.align 16
_.objc_method_list:
.long 0
.long 1
.long L___unnamed_5
.long L___unnamed_4
.long __c_Foo__fooWithBar
.align 8
_.objc_ivar_list:
.long 1
.long L___unnamed_2
.long L___unnamed_3
.long 0
.globl ___objc_ivar_offset_Foo.count
.align 4
___objc_ivar_offset_Foo.count:
.long _.objc_ivar_list+12
L_.class_name:
.asciz "Foo"
.globl __OBJC_METACLASS_Foo
.align 16
__OBJC_METACLASS_Foo:
.long 0
.long 0
.long L_.class_name
.long 0
.long 18
.long 72
.long 0
.long _.objc_method_list
.long 0
.long 0
.long 0
.long 0
.long 0
.long 1
.long 0
.long 0
.long 0
.long 0
.lcomm _.objc_protocol_list,8,8
.globl __OBJC_CLASS_Foo
.align 16
__OBJC_CLASS_Foo:
.long __OBJC_METACLASS_Foo
.long 0
.long L_.class_name
.long 0
.long 17
.long 4
.long _.objc_ivar_list
.long 0
.long 0
.long 0
.long 0
.long _.objc_protocol_list
.long 0
.long 1
.long _.ivar.offsets
.long _.objc_property_list
.long 1
.long 1
.section .rdata$__objc_class_ref_Foo,"r"
.linkonce discard
.globl ___objc_class_ref_Foo
.align 4
___objc_class_ref_Foo:
.long ___objc_class_name_Foo
.data
L___unnamed_6:
.asciz "AnotherHack"
L___unnamed_7:
.asciz "__ObjC_Protocol_Holder_Ugly_Hack"
.lcomm _.objc_protocol_list1,8,8
.align 16
___unnamed_8:
.long L___unnamed_6
.long L___unnamed_7
.long 0
.long 0
.long _.objc_protocol_list1
.section .rdata$.objc_sel_namefooWithBar,"r"
.linkonce discard
.globl _.objc_sel_namefooWithBar
_.objc_sel_namefooWithBar:
.asciz "fooWithBar"
.data
.align 8
_.objc_selector_list:
.long _.objc_sel_namefooWithBar
.long L___unnamed_4
.zero 8
.align 16
___unnamed_9:
.long 1
.long _.objc_selector_list
.short 1
.short 1
.long __OBJC_CLASS_Foo
.long ___unnamed_8
.long 0
.long 0
L_.objc_source_file_name:
.asciz "./test.m"
.align 8
___unnamed_1:
.long 8
.long 16
.long L_.objc_source_file_name
.long ___unnamed_9
.section .ctors,"w"
.align 4
.long _.objc_load_function
//test.s、-fnext-runtimeオプション付きのclang
.objc_class_name_Foo=0
.globl .objc_class_name_Foo
.lazy_reference .objc_class_name_Foo
.def _2B__5B_Foo_20_fooWithBar_5D_;
.scl 3;
.type 32;
.endef
.text
.align 16, 0x90
_2B__5B_Foo_20_fooWithBar_5D_:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl 12(%ebp), %eax
movl 8(%ebp), %ecx
leal L_.str, %edx
movl %ecx, -4(%ebp)
movl %eax, -8(%ebp)
movl %edx, (%esp)
calll _printf
movl %eax, -12(%ebp)
addl $16, %esp
popl %ebp
ret
.def _main;
.scl 2;
.type 32;
.endef
.globl _main
.align 16, 0x90
_main:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
calll ___main
movl $0, %eax
movl $0, -4(%ebp)
movl L_OBJC_CLASS_REFERENCES_, %ecx
movl L_OBJC_SELECTOR_REFERENCES_, %edx
movl %ecx, (%esp)
movl %edx, 4(%esp)
movl %eax, -8(%ebp)
calll _objc_msgSend
movl -8(%ebp), %eax
addl $16, %esp
popl %ebp
ret
.data
L_.str:
.asciz "abc"
.section __TEXT,__cstring,cstring_literals,"w"
L_OBJC_METH_VAR_NAME_:
.asciz "fooWithBar"
L_OBJC_METH_VAR_TYPE_:
.asciz "v8@0:4"
L_OBJC_CLASS_NAME_:
.asciz "Foo"
.section __OBJC,__cls_meth,regular,no_dead_strip,"w"
.align 4
L_OBJC_CLASS_METHODS_Foo:
.long 0
.long 1
.long L_OBJC_METH_VAR_NAME_
.long L_OBJC_METH_VAR_TYPE_
.long _2B__5B_Foo_20_fooWithBar_5D_
.section __OBJC,__meta_class,regular,no_dead_strip,"w"
.align 4
L_OBJC_METACLASS_Foo:
.long L_OBJC_CLASS_NAME_
.long 0
.long L_OBJC_CLASS_NAME_
.long 0
.long 2
.long 48
.long 0
.long L_OBJC_CLASS_METHODS_Foo
.long 0
.long 0
.long 0
.long 0
.section __TEXT,__cstring,cstring_literals,"w"
L_OBJC_METH_VAR_NAME_1:
.asciz "count"
L_OBJC_METH_VAR_TYPE_2:
.asciz "i"
.section __OBJC,__instance_vars,regular,no_dead_strip,"w"
.align 4
L_OBJC_INSTANCE_VARIABLES_Foo:
.long 1
.long L_OBJC_METH_VAR_NAME_1
.long L_OBJC_METH_VAR_TYPE_2
.long 0
.section __OBJC,__class,regular,no_dead_strip,"w"
.align 4
L_OBJC_CLASS_Foo:
.long L_OBJC_METACLASS_Foo
.long 0
.long L_OBJC_CLASS_NAME_
.long 0
.long 1
.long 4
.long L_OBJC_INSTANCE_VARIABLES_Foo
.long 0
.long 0
.long 0
.long 0
.long 0
.section __OBJC,__cls_refs,literal_pointers,no_dead_strip,"w"
.align 4
L_OBJC_CLASS_REFERENCES_:
.long L_OBJC_CLASS_NAME_
.section __OBJC,__message_refs,literal_pointers,no_dead_strip,"w"
.align 4
L_OBJC_SELECTOR_REFERENCES_:
.long L_OBJC_METH_VAR_NAME_
.section __TEXT,__cstring,cstring_literals,"w"
L_OBJC_CLASS_NAME_3:
.zero 1
.section __OBJC,__symbols,regular,no_dead_strip,"w"
.align 4
L_OBJC_SYMBOLS:
.long 0
.long 0
.short 1
.short 0
.long L_OBJC_CLASS_Foo
.section __OBJC,__module_info,regular,no_dead_strip,"w"
.align 4
L_OBJC_MODULES:
.long 7
.long 16
.long L_OBJC_CLASS_NAME_3
.long L_OBJC_SYMBOLS
重要な問題は、.sファイルの作成方法にあると思います。
誰かが私がこの問題を解決するのを手伝ってくれる?これらの.dllファイルを使用しても、ビジネス用のアプリケーションを作成できませんでした。
しかし、これらの.dllを使用することで、ウィンドウプラットフォーム上に優れたココア学習環境を構築できます。すべてのフレームワークのWindowsバージョンは、gnustepよりも安定していて便利です。
ありがとう。