相关疑难解决方法(0)

寻找一个跨平台,端到端的C++到WPF/Cocoa互操作性的例子

首先,一些背景:

我决定开始一个新设计的项目,在多个平台(Windows,iOS,OSX,Linux,Android)上运行.由于我的背景主要是C++,我打算用C++ 11编写核心功能.话虽这么说,在每个平台上我都需要编写一个特定于平台的UI,它可以与C++核心互操作.

我所针对的第一个平台是Windows(第二个是iOS).我将把数据存储在SQLite数据库中,以及用户提供的数据,这些数据将使用WPF DataGrid输入(插入行,操作现有数据等).这是我第一次使用WPF(虽然我使用过Windows Forms),而且我第一次在托管环境中使用C++.我打算把它变成一个MVC风格的架构,所以在我看来,SQLite是Model,WPF是View,C++代码是Controller.

我的问题是:

是否有任何示例说明如何从C++接口获取数据并使用C#和WPF显示它而不破坏/破坏C++代码本身(因为它必须在多个平台上工作)?我已经阅读了一些关于P/Invoke(繁琐,但有效)和混合程序集(可行,但会破坏我的C++?)的一些内容,但Google在具体示例(特别是涉及填充WPF控件的那些示例)方面没有帮助通过C++ DLL获得的数据).

谢谢!

编辑:在寻找这个问题的方法时,我遇到了CXXI.我不是很熟悉它,但似乎它可能是我的问题的简单解决方案.有什么想法吗?我对所有这些概念的把握是有限的.

c# c++ wpf pinvoke cross-platform

5
推荐指数
1
解决办法
343
查看次数

为iPhone编译C lib

我正在尝试编译ZeroMQ C绑定以便能够在iPhone上使用它,这是我的配置选项:

./configure --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 CFLAGS="-pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.1.2 -gdwarf-2 -mthumb -I/Library/iPhone/include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -mdynamic-no-pic" CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar AS=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/as LIBTOOL=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool STRIP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/strip RANLIB=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ranlib

它实际上配置和编译很好,但是当我将它添加到Xcode Frameworks部分时,我收到警告:ld: warning: in /path/to/app/libzmq.a, file was built for unsupported file format which is not the architecture being linked (armv7)并且发现很多符号错误.

如果我将当前活动架构从armv6更改为armv7,警告消息会将其更改为armv6.我究竟做错了什么 ?

谢谢,丹

iphone xcode compilation configure zeromq

4
推荐指数
1
解决办法
7165
查看次数

标签 统计

c# ×1

c++ ×1

compilation ×1

configure ×1

cross-platform ×1

iphone ×1

pinvoke ×1

wpf ×1

xcode ×1

zeromq ×1