Firefly开源社区

标题: stdafx.h问题 [打印本页]

作者: Ostrich    时间: 2015-4-28 19:42
标题: stdafx.h问题
请问高手,我将VC程序移植到ubuntu时,
ostrich@ostrich-ThinkPad-X230:~/test/OMRONPlc$ g++ OMRONPlc.cpp
OMRONPlc.cpp:4:20: fatal error: stdafx.h: 没有那个文件或目录
#include "stdafx.h"
                    ^
compilation terminated.
请问该怎么处理。
作者: error结构体    时间: 2015-4-29 10:27
#include "stdafx.h"
这个是VC专有的头文件,好像是加载图形界面用的,你要把他去掉,另外你的程序里面只能调用标准C或C++的库函数。
作者: Ostrich    时间: 2015-4-30 13:56
1.c:3:17: fatal error: string: 没有那个文件或目录
#include<string>
                 ^
compilation terminated.
请问# include <string.h>怎么处理。
作者: error结构体    时间: 2015-5-4 09:47
#include<string>是STL库中的,# include <string.h>是一般的字符串操作函数集合,一个是C++用的,一个是C用的。
作者: lr6410    时间: 2015-5-7 17:32
stdafx.h s是windows的头文件,搞到linux下当然不行




欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1