如何在 QuickTime SDK for Windows 中使用 CoreFoundation?
有人可以帮我在 Cygwin / MingW / VS20(05|08|10) 中编译这段代码吗?
事实上,我想在 Windows 版 QuickTime SDK 7.3 中使用 CoreFoundation 框架。
#include <stdio.h>
#include <CoreFoundation.h>
int main () {
CFStringRef hello = CFSTR("Hello, world.");
return 0;
}
我在 Cygwin/MingW 中使用此 MakeFile 进行编译,但出现错误:(
CC = gcc
LDFLAGS = -L"C:/Program Files/QuickTime SDK/Libraries" -lQTMLClient
CFLAGS = -Wall -mwindows -I"C:/Program Files/QuickTime SDK/CIncludes"
all: StringExample.c
$(CC) $(CFLAGS) $(LDFLAGS) -o StringExample StringExample.c -static
无忧无虑的警告消息;)
StringExample.c: In function 'main':
StringExample.c:5:17: warning: unused variable 'hello' [-Wunused-variable]
C:\Users\censored\AppData\Local\Temp\ccJzEryl.o:StringExample.c:(.text+0x16): undefined reference to `_imp____CFStringMakeConstantString'
collect2: ld returned 1 exit status
make: *** [all] Error 1
在 VisualStudio 2010 中,我收到相同的错误:
LNK2019: unresolved external symbol __imp____CFStringMakeConstantString referenced in function _main
我下载了 Cocotron/CFLite/OpenCFLite,但我还没有t编译这个项目或使用那个:( 请帮助我...我已经很努力了!
谢谢你们帮助我。
我的英语很差,对此我感到很抱歉。
Anybody can help me for compile this code in Cygwin / MingW / VS20(05|08|10)?
Indeed i want to use CoreFoundation Framework in QuickTime SDK 7.3 for Windows.
#include <stdio.h>
#include <CoreFoundation.h>
int main () {
CFStringRef hello = CFSTR("Hello, world.");
return 0;
}
i used this MakeFile for compile it, in Cygwin/MingW, but i get an error :(
CC = gcc
LDFLAGS = -L"C:/Program Files/QuickTime SDK/Libraries" -lQTMLClient
CFLAGS = -Wall -mwindows -I"C:/Program Files/QuickTime SDK/CIncludes"
all: StringExample.c
$(CC) $(CFLAGS) $(LDFLAGS) -o StringExample StringExample.c -static
Carefree warning message ;)
StringExample.c: In function 'main':
StringExample.c:5:17: warning: unused variable 'hello' [-Wunused-variable]
C:\Users\censored\AppData\Local\Temp\ccJzEryl.o:StringExample.c:(.text+0x16): undefined reference to `_imp____CFStringMakeConstantString'
collect2: ld returned 1 exit status
make: *** [all] Error 1
In VisualStudio 2010, i get the same error:
LNK2019: unresolved external symbol __imp____CFStringMakeConstantString referenced in function _main
i downloaded the Cocotron/CFLite/OpenCFLite but i havent been to compile this Projects or use that :(
m very tried!
please help me... i
Thanks guys for help me.
My english is very bad, i`m so sorry about this.
是的!!!
我终于成功了!
您可以将 CoreFoundation.dll 静态添加到 LDFLAGS MakeFile。 (如果您的系统中安装了itunes,您可以在“program files/common files/apple...”中找到该文件)
我编译这段代码变得容易多了!
编辑&没问题 makefile:
祝你好运!
YES!!!
I finally succeeded!
You can add CoreFoundation.dll statically to LDFLAGS MakeFile. (if installed itunes in your system, you can find this file on "program files/common files/apple...")
I've Compiled this code so much easier!
Edited & none problem makefile:
Good Luck!