好的,所以我知道你可以使用Objective-C制作一个NSTask来运行命令行工具:
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/usr/bin/gdb"];
[task launch];
Run Code Online (Sandbox Code Playgroud)
我只是想知道是否有办法与交互式命令行工具进行通信gdb.这将涉及使基于用户交互的命令输入(如run,kill或quit用gdb),然后在此基础上输出该信息反应.
我正在尝试Xtend.是否可以制作构造函数?看起来很简单,但是当我尝试这样的事情时,我遇到了错误:
class Scope extends Rect {
public Scope(){
super()
}
}
Run Code Online (Sandbox Code Playgroud) 显然,这是你在mac上构建和安装它的方式:
CPPFLAGS="-I/usr/X11R6/include" ./configure --prefix="${PWD}/../"
make
make install
Run Code Online (Sandbox Code Playgroud)
不幸的是,当我执行make命令时,这本身就会给我一个错误:Undefined symbols for architecture x86_64
做完工作后,我发现第一行的改进是:
CPPFLAGS="-I/usr/X11R6/include -L/usr/X11R6/lib" LDFLAGS="-L/usr/X11R6/lib" ./configure --prefix="${PWD}/../"
Run Code Online (Sandbox Code Playgroud)
不幸的是,当我执行make命令时,我仍然收到错误:
gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/X11R6/include -L/usr/X11R6/lib -I../../../include -g -O2 -Wall -pedantic -MT smooth_opengl3-smooth_opengl3.o -MD -MP -MF .deps/smooth_opengl3-smooth_opengl3.Tpo -c -o smooth_opengl3-smooth_opengl3.o `test -f 'smooth_opengl3.c' || echo './'`smooth_opengl3.c
smooth_opengl3.c:101: error: redefinition of typedef ‘PFNGLGENBUFFERSPROC’
/usr/X11R6/include/GL/glext.h:5080: error: previous declaration of ‘PFNGLGENBUFFERSPROC’ was here
smooth_opengl3.c:102: error: redefinition of typedef ‘PFNGLBINDBUFFERPROC’
/usr/X11R6/include/GL/glext.h:5078: error: previous …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的Xcode项目中使用glew,但我得到了这个: Apple Mach-O Linker (Id) Error... Undefined symbols for architecture x86_64
我正在使用我从sourceforge网站下载的当前版本的glew .

我试图在OSX 10.7上运行它:
/**
* simple.d
*/
import std.stdio;
import derelict.sdl.sdl;
import derelict.sdl.macinit.SDLMain;
import derelict.opengl.gl;
pragma(lib, "/usr/local/src/Derelict2/lib/libDerelictUtil.a");
pragma(lib, "/usr/local/src/Derelict2/lib/libDerelictSDL.a");
pragma(lib, "/usr/local/src/Derelict2/lib/libDerelictGL.a");
int main(string[] args) {
// Load Derelict
writeln("Loading SDL...");
DerelictSDL.load();
// Initialise SDL
if( SDL_Init( SDL_INIT_EVERYTHING ) == -1 ) {
throw new Exception("SDL initialization failed");
}
// Enable Double Buffering
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
// Set up the screen
SDL_Surface* screen = SDL_SetVideoMode(640, 480, 0, SDL_OPENGL);
if (screen == null) {
throw new Exception("Screen is null");
}
SDL_WM_SetCaption("Simple", "Simple");
// Print …Run Code Online (Sandbox Code Playgroud) 我使用Derelict3和GLFW 3在使用Lion(osx 10.7.4)上运行OpenGL 3.2时遇到了麻烦.
这是我的测试程序:
module glfw3Test;
import std.stdio, std.conv;
import derelict.glfw3.glfw3;
import derelict.opengl3.gl3;
string programName = "glfw3Test";
int width = 640;
int height = 480;
GLFWwindow window;
void main() {
// load opengl
DerelictGL3.load();
// load GLFW
DerelictGLFW3.load();
if(!glfwInit()) {
glfwTerminate();
throw new Exception("Failed to create glcontext");
}
writefln("GLFW: %s", to!string(glfwGetVersionString()));
window = glfwOpenWindow(width, height, GLFW_WINDOWED, programName.ptr, null);
if(!window) {
glfwTerminate();
throw new Exception("Failed to create window");
}
// Request opengl 3.2 context
// based off the GLFW FAQ: …Run Code Online (Sandbox Code Playgroud) 在Ada中,您可以定义所谓的" mod "和" range "类型:
type Unsigned_n is mod 2**n;
type Range_Type is range -5 .. 10;
Run Code Online (Sandbox Code Playgroud)
这些是如何在语言机器级别实现的?在对这些类型执行操作时,您会遇到什么样的性能损失?
我正在使用Derelict来完成我的OpenGL工作,而且我已经厌倦了不得不cast(GLvoid*) Vec3.sizeof像glVertexAttribPointer这样的功能.所以我以为我会做一个功能,glsizeof
import std.stdio;
alias void GLvoid;
struct Vec3 {
float x, y, z;
}
GLvoid* glsizeof(T)(T t) {
return cast(GLvoid*) t.sizeof;
}
void main() {
Vec3 vec = { x: 2.5, y: 4.8, z: 3.2 };
writeln(cast(GLvoid*) vec.sizeof); // prints 'C'
writeln(cast(GLvoid*) Vec3.sizeof); // prints 'C'
writeln(cast(GLvoid*) int.sizeof); // prints '4'
// Now to try using glsizeof :)
GLvoid* size_vec = vec.glsizeof; // call glsizeof using a uniform function call
GLvoid* size_vec3 = Vec3.glsizeof;
GLvoid* size_int …Run Code Online (Sandbox Code Playgroud)