在完全安装了Mono 2.10附带的Ubuntu 11.10之后,我发现自己有点傻瓜:即使我安装了XSP4,也无法运行ASP.Net 4.0项目.它几乎就像它期望那里只有一个xsp2 ......
这是错误:
Could not launch web server. The "xsp2" web server cannot be started. Please ensure that it is installed.
Run Code Online (Sandbox Code Playgroud)
细节:
MonoDevelop.Core.UserException: The "xsp2" web server cannot be started. Please ensure that it is installed.
at MonoDevelop.AspNet.AspNetExecutionHandler.GetXspPath (MonoDevelop.AspNet.AspNetExecutionCommand cmd) [0x00000] in <filename unknown>:0
at MonoDevelop.AspNet.AspNetExecutionHandler.Execute (MonoDevelop.Core.Execution.ExecutionCommand command, IConsole console) [0x00000] in <filename unknown>:0
at MonoDevelop.Core.Execution.DefaultExecutionHandler.Execute (MonoDevelop.Core.Execution.ExecutionCommand command, IConsole console) [0x00000] in <filename unknown>:0
at MonoDevelop.AspNet.AspNetAppProject.DoExecute (IProgressMonitor monitor, MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector config) [0x00000] in <filename unknown>:0
Run Code Online (Sandbox Code Playgroud)
知道这个问题可能是什么?XSP4只与MonoDevelop …
有没有具体的方法来做到这一点?我说的是一般用途.当我尝试在GDB中启动我的程序时,我收到此通知:
Reading symbols from /home/amsterdam/Code/c++/opengl_03/bin/opengl_03...(no debugging symbols found)...done.
Run Code Online (Sandbox Code Playgroud)
这让我想知道我是否必须为此找到一个特定的文件?
更新
注意:我已经尝试过以下命令:
nm --debug-sym <your_executable> | grep debug
没有成功; 它拒绝显示任何东西.
这是我的Makefile:
BIN = bin/
OBJ = obj/
TARGET = opengl_03
DEPS = main.o displayinit.o initializer.o algorithms.o matrix3f.o window.o vertex3.o
CC = g++
CFLAGS = -g -ggdb
LIBS = -lglut -lGLEW -lGL
INCLUDEPATH = -L/usr/include/ -L/usr/lib/ -L/usr/lib/x86_64-linux-gnu/
$(TARGET) : $(DEPS)
$(CC) $(CFLAGS) -o $(BIN)$(TARGET) $(DEPS) $(LIBS) $(INCLUDEPATH)
displayinit.o : displayinit.cpp displayinit.h
$(CC) $(CFLAGS) -c displayinit.cpp $(LIBS) $(INCLUDEPATH) #&& mv displayinit.o $(OBJ)displayinit.o
initializer.o …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用VC++编译器和Visual Studio在Win32 API中打开一个简单的窗口.我想知道课程失败的原因; 我已经尝试在没有指针的情况下分配它,并将其作为指针分配并将其作为参考发送给函数.然而,无论我尝试什么,该RegisterClassEx
函数都拒绝返回true.
为什么会这样,可以做些什么呢?
从 WinMain
WNDCLASSEX* wc = new WNDCLASSEX;
HWND hwnd;
MSG msg;
bool done;
wc->style = CS_HREDRAW | CS_VREDRAW;
wc->lpfnWndProc = WndProc;
wc->cbClsExtra = 0;
wc->cbWndExtra = 0;
wc->hInstance = hInstance;
wc->hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc->hCursor = LoadCursor(NULL, IDC_ARROW);
wc->hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc->lpszClassName = L"someclass";
if (!RegisterClassEx(wc)) {
MessageBox(NULL, L"Class registration has failed!", L"Error!", MB_OK | MB_ICONINFORMATION);
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我正在编译VC++ 2010.以下代码用于作业:
#include <iostream>
#include <map>
#include "PaintJobEst.h"
using namespace std;
int main( void )
{
map< string, double > data;
double numRooms = 0, costPerGallon = 0, sqrFtWallSpace = 0;
cout << "How many rooms wil you be painting today? " << endl;
cin >> numRooms;
const bool numRoomsAtLeastOne = ( numRooms >= 1 );
if ( !numRoomsAtLeastOne )
{
cout << "INVALID ENTRY: Please enter a value greater than or equal to 1 for the amount of rooms …
Run Code Online (Sandbox Code Playgroud) 假设我有以下函数(其中mVertexShader
是一个std::shared_ptr< ID3D11VertexShader >
类成员,并且mRenderData
只是POD持有其他D3D的东西):
void VertexShader::CreateShader( void )
{
GVertexShader* raw_VertexShader = mVertexShader.get();
mRenderData->Device->CreateVertexShader(
mCompiledShader->GetBufferPointer(),
mCompiledShader->GetBufferSize(),
NULL,
&raw_VertexShader
);
delete raw_VertexShader;
raw_VertexShader = NULL;
}
Run Code Online (Sandbox Code Playgroud)
因为mVertexShader.get()
返回原始指针,会删除raw_VertexShader
指针内部的 效果mVertexShader.get()
,或者,当指向的内存相同时,指针本身是完全不同的?
我猜测后者,因此首先存在引用指针的原因,但我想确定我有正确的想法.
注意:我目前正在使用MSVC++,尽管很高兴听到MSVC++和MinGW/GCC如何实现这一点有很大的不同.
注2:如果我不清楚,我道歉 - 我根本没有提到D3D的语义,但更多的是关于内存管理,数据传输和动态内存分配的C++语言本身的语义.从这个意义上说,我正在试图准确理解从函数返回原始指针时会发生什么.
即,假设mVertexShader
存储一个简单的原始指针指向任意VertexShader,当我调用它的get()
方法时,它是否返回一个复制指针,该指针指向与shared_ptr
容器内部相同的内存地址,或者它是全新的已经复制并返回的指针,内存指向不同的地址?
假设我有两个表,并且它们的主要标识符都使用名称"id".如果我想用这两个表执行连接,我将如何id
为要与前一个表连接的表的别名进行别名?
例如:
SELECT * FROM `sites_indexed` LEFT JOIN `individual_data` ON `sites_indexed`.`id` = `individual_data`.`site_id` WHERE `url` LIKE :url
Run Code Online (Sandbox Code Playgroud)
现在,site_id应该与之链接sites_indexed.id
.实际id
它代表一行individual_data
但具有相同的标题为sites_indexed
.
就个人而言,我喜欢只使用名称id
,因为它保持一致.然而,当编写服务器端脚本时,它会让事情变得混乱.
例如
$var = $result['id'];
鉴于前面提到的查询,这不会混淆解释器吗?
无论如何,这是如何实现的?
我已经用Java和C#编写了大约4-5个月的编码.很棒的语言,但我觉得我已经准备好迈出下一步了.我急于开始学习c ++,而且我已经开始学习c ++了,但我确实很难接受它.在使用它时,学习和完成任何事情确实需要付出更多的努力,我觉得我真的无处可去.我该怎么办?我应该继续使用Java编程吗?如果是这种情况,请给出一个很好的理由:我真的很想学习C++,因为它迫使我去做,以及我在这个过程中可以学到的东西.
如果我应该用C++继续,这里的问题是......我应该在哪里开始呢?我一直在研究的大多数教程(Memory Pools,XML Parsing等)都是我脑海中浮现的东西.
我也只运行Linux,因此就任何.NET而言,它几乎仅限于MonoDevelop 2.4.
这可能吗?根据我想要完成的事情,似乎并非如此.
功能
static std::string str_repeat(std::string * str, int num_times) {
std::string * str_rep = new std::string;
for (int n = 1; n <= num_times; n++) {
str_rep = str_rep + str;
}
std::string ret = *str_rep; //error
delete str;
delete str_rep;
return ret;
}
Run Code Online (Sandbox Code Playgroud)
更新
对不起,我没有首先发布错误,因为我认为这是一个普遍的C++问题,我做错了.这里是.
error: invalid operands of types ‘std::string* {aka std::basic_string<char>*}’ and ‘std::string* {aka std::basic_string<char>*}’ to binary ‘operator+’
Run Code Online (Sandbox Code Playgroud) 我有以下函数,它只是一个构造函数.它的作用是为二维浮动指针数组分配内存.我很想知道是否,当我将这个数组添加到一个vector
实例时,如果我删除了数组的原始初始化,它是否也会删除该向量中的数组?
这是代码:
Evaluator::Evaluator(int row, Column col) {
this->verticies = new std::vector();
float* matrix = NULL;
switch(col) {
case ONE:
matrix = new float[row][1];
break;
case TWO:
matrix = new float[row][2];
break;
case THREE:
matrix = new float[row][3];
break;
case FOUR:
matrix = new float[row][4];
break;
}
this->verticies->push_back(matrix);
delete matrix;
}
Run Code Online (Sandbox Code Playgroud) 我的代码最初看起来像这样:
int SomeObject::operator[]( const string& key ) const
{
return ( *m_Map )[ key ];
}
int SomeObject::operator()( const string& key ) const
{
return ( *m_Map2 )[ key ];
}
Run Code Online (Sandbox Code Playgroud)
这两张地图都有以下签名:
std::map< std::string, int >
然后我读了一些关于STL容器真的不需要显式堆分配(即std::map< ... >* map = new std::map< ... >
),这就是我正在做的事情.
只要我将映射更改为堆栈分配并删除指针取消引用,它就像这样:
int SomeObject::operator[]( const string& key ) const
{
return m_Map[ key ];
}
int SomeObject::operator()( const string& key ) const
{
return m_Map2[ key ];
}
Run Code Online (Sandbox Code Playgroud)
编译器抱怨以下错误(对于两个映射):
Error 1 error C2678: binary …
Run Code Online (Sandbox Code Playgroud) c++ ×5
visual-c++ ×3
pointers ×2
alias ×1
asp.net ×1
gdb ×1
hashmap ×1
heap ×1
left-join ×1
memory ×1
monodevelop ×1
mysql ×1
server-side ×1
shared-ptr ×1
stack ×1
stl ×1
winapi ×1
xsp ×1