vs2010c++boost编写客户端,编译通过,启动就报应用程序无法启动(0xc000007b)
2013-07-16 17:35
525 查看
代码如下:
#include <iostream>
#include "../Share/comm.h"
/************************************************************************/
/* 客户端 */
/************************************************************************/
void proc_connect(socket_type sock, ip::tcp::endpoint& ep)
{
bool bConnectFlag = false;
while (true)
{
//当没有连接上服务器时,每隔一秒连接一次
try
{
if (!bConnectFlag)
{
cout<<"connecting..."<<endl;
//阻塞的timer
io_service ios;
deadline_timer timer(ios, posix_time::seconds(1));
timer.wait(); //进行同步等待
sock->connect(ep);
}
else
{
//向服务器发送数据
cout<<endl<<"please input:";
string str;
cin>>str;
sock->write_some(buffer(str));
//读取服务器发送的数据
vector<char> recvbuf(100, 0);
sock->read_some(buffer(recvbuf));
cout<<"recv from server:"<<&recvbuf[0]<<endl;
}
bConnectFlag = true;
}
//捕获网络异常
catch(std::exception& e)
{
sock->close();
bConnectFlag = false;
cout<<e.what()<<endl;
}
}
}
int main(int argc, int argv[])
{
//初始化ios对象
io_service ios;
//初始化连接服务器的socket
socket_type sock(new ip::tcp::socket(ios));
//初始化需要连接的服务器的地址以及端口号
ip::tcp::endpoint ep(ip::address::from_string("127.0.0.1"), PORT_NUM);
thread t1(proc_connect, sock, ep);
t1.join();
return 0;
}
我的系统为window764位,导入的boost库为32位的。
请问各位大侠如何解决?
已经解决:
1.boost编译未完全编译
bjam --toolset=msvc-10.0 architecture=x86 address-model=64 --build-type=complete stage debug release
--build-type=complete
stage 参数为全部编译
重新编译boost库
2.
这三个lib文件放到工程的静态编译目录就可以了
#include <iostream>
#include "../Share/comm.h"
/************************************************************************/
/* 客户端 */
/************************************************************************/
void proc_connect(socket_type sock, ip::tcp::endpoint& ep)
{
bool bConnectFlag = false;
while (true)
{
//当没有连接上服务器时,每隔一秒连接一次
try
{
if (!bConnectFlag)
{
cout<<"connecting..."<<endl;
//阻塞的timer
io_service ios;
deadline_timer timer(ios, posix_time::seconds(1));
timer.wait(); //进行同步等待
sock->connect(ep);
}
else
{
//向服务器发送数据
cout<<endl<<"please input:";
string str;
cin>>str;
sock->write_some(buffer(str));
//读取服务器发送的数据
vector<char> recvbuf(100, 0);
sock->read_some(buffer(recvbuf));
cout<<"recv from server:"<<&recvbuf[0]<<endl;
}
bConnectFlag = true;
}
//捕获网络异常
catch(std::exception& e)
{
sock->close();
bConnectFlag = false;
cout<<e.what()<<endl;
}
}
}
int main(int argc, int argv[])
{
//初始化ios对象
io_service ios;
//初始化连接服务器的socket
socket_type sock(new ip::tcp::socket(ios));
//初始化需要连接的服务器的地址以及端口号
ip::tcp::endpoint ep(ip::address::from_string("127.0.0.1"), PORT_NUM);
thread t1(proc_connect, sock, ep);
t1.join();
return 0;
}
我的系统为window764位,导入的boost库为32位的。
请问各位大侠如何解决?
已经解决:
1.boost编译未完全编译
bjam --toolset=msvc-10.0 architecture=x86 address-model=64 --build-type=complete stage debug release
--build-type=complete
stage 参数为全部编译
重新编译boost库
2.
这三个lib文件放到工程的静态编译目录就可以了
相关文章推荐
- 应用程序无法正常启动0Xc000007b opencv+vs2010 编译通过,运行出错
- QT编译发布程序后报错如缺少dll、“应用程序无法正常启动(0xc000007b)”的可能解决方法
- vs2010编译出的exe“应用程序无法正常启动(0xc0150002)”
- 应用程序无法正常启动0Xc000007b opencv+vs2010 编译通过,运行出错
- 编译的文件放在其他电脑上出现应用程序无法正常启动(0xc000007b)
- VS2010运行opencv的程序,出现“应用程序无法正常启动0xc000007b”的解决方法
- 解决Win7 64bit + VS2010 使用opencv时出现提“应用程序无法正常启动(0xc000007b)”错误
- [置顶] vs2015编译运行程序遇到应用程序无法正常启动0xc000007b的问题
- 在Windows平台用visual studio编译的可执行文件部署时报:应用程序无法正常启动0xc000007b(跟DirectX9无关的原因)
- 在Windows平台用visual studio编译的可执行文件部署时报:应用程序无法正常启动0xc000007b(跟DirectX9无关的原因)
- 解决Win7 64bit + VS2010 使用opencv时出现提“应用程序无法正常启动(0xc000007b)”错误
- 应用程序无法正常启动0xc000007b错误
- 应用程序无法正常启动(0xc000007b)。请单击“确定”关闭应用程序。解决方案
- win7系统debug调试出现“应用程序无法正常启动(0xc000007b)。请单击“确定”关闭应用程序。”的解决方法
- 应用程序无法正常启动(0xc000007b)。请单击“确定”关闭应用程序。解决方案
- 应用程序无法正常启动(0xc000007b)。请单击确定关闭应用程序
- opencv vs2010 应用程序无法正常启动(oxc000007b) 解决
- 应用程序无法正常启动(0xc000007b)
- 应用程序无法正常启动(0xc000007b)
- 应用程序无法正常启动0xc000007b怎么解决