在cygwin中编译新的mingw二进制文件
Compiling in cygwin with new mingw binaries
我更新了我的mingw二进制文件以支持c++11,现在我无法编译我的代码。
我正在使用cygwin,并将二进制文件包含在PATH环境变量中。
这是我的include和main的第一行:
#include "icm/icmCpuManager.hpp"
#include "Instruction.hpp"
#include "MicroblazeInstruction.hpp"
#include "CpuManager.hpp"
#include "File.hpp"
#include "Utils.hpp"
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <sstream>
#include <cstdint>
将我带到File.hpp
中的第一行#ifndef FILE_HPP
#define FILE_HPP
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <sstream>
#include <cstdint>
这是我的makefile:
IMPERAS=$(IMPERAS_HOME)
ifndef IMPERAS
IMPERAS := $(error "IMPERAS paths not defined")
endif
SUFFIX=.cpp
CC=g++
CFLAGS=-O2 -Wall -c -I $(IMPERAS_HOME)/ImpPublic/include/host/ -std=c++11
LDFLAGS=-m32 -L$(IMPERAS_HOME)/bin/$(IMPERAS_ARCH) -lRuntimeLoader
EXECUTABLE=./faith.exe
SRC=./main.cpp ./CpuManager.cpp ./Instruction.cpp ./File.cpp ./Utils.cpp
OBJS=$(SRC:.cpp=.o)
DEPS=
#SHAREDOBJ=$(SRC:.c=.so)
.PHONY: all
#all: $(EXECUTABLE) $(SHAREDOBJ)
all: $(EXECUTABLE)
# platform
$(EXECUTABLE): $(OBJS)
@ echo "# Linking Platform $@"
$(V) $(CC) $(OBJS) $(LDFLAGS) -o $@
# platform objects
%.o: %.cpp $(DEPS)
@ echo "# Compiling Platform source: $@"
$(V) $(CC) $(LDFLAGS) $(CFLAGS) $< -o $@
# dynamic lib
#$(SHAREDOBJ): $(OBJS)
# @ echo "# Host Linking Platform object $@"
# $(V) $(CC) -shared -o $@ $^ $(LDFLAGS)
.PHONY: clean
clean:
$(V) - rm -f $(EXECUTABLE) $(OBJS)
这是我的编译错误:
$ make
# Compiling Platform source: main.o
g++ -m32 -LC:Imperas/bin/Windows32 -lRuntimeLoader -O2 -Wall -c -m32 -I C:Imperas/ImpPublic/include/host/ -std=c++11 main.cpp -o main.o
In file included from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/bits/ios_base.h:43:0,
from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/ios:43,
from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/ostream:40,
from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/iostream:40,
from File.hpp:4,
from main.cpp:5:
c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/bits/locale_classes.h:45:1: error: expected unqualified-id before 'namespace'
In file included from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/cwctype:52:0,
from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/bits/locale_facets.h:41,
from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/bits/basic_ios.h:39,
from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/ios:45,
from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/ostream:40,
from c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/include/c++/iostream:40,
from File.hpp:4,
from main.cpp:5:
c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/include/wctype.h:15:32: error: expected '}' before end of line
c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/include/wctype.h:15:32: error: expected unqualified-id before end of line
c:mingwmingw64bin../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/include/wctype.h:15:32: error: expected declaration before end of line
makefile:29: recipe for target 'main.o' failed
make: *** [main.o] Error 1
您在文件"CpuManager.hpp"末尾缺少分号
缺少的分号会在紧接分号的代码中触发错误,该错误会在编译器错误中识别。
相关文章:
- 正在读取二进制文件(is_open)
- 在C++中将类(带有Vector成员)保存为二进制文件
- 如何从二进制文件中读取字符串
- 保存/加载大量短数组到二进制文件
- 从二进制文件中读取整数数组
- Android 在编译二进制文件时重建静态库
- 在 C++ 中将双精度变量写入二进制文件
- clang 的 libFuzzer 可以在同一二进制文件中测试超过 1 个 API 吗?
- C++:实际上不是从二进制文件中读取
- 如何从二进制文件中的给定符号中获取调用程序图
- 将内部带有矢量的结构保存/读取到二进制文件中
- 编译多个C++文件.调用二进制文件以运行代码
- 如何使用位字段将数据从二进制文件复制到结构中?
- uint8_t同一二进制文件的不同十进制值
- C++单个生成文件多个二进制文件
- 尝试将数字写入二进制文件时引发异常
- 在MinGW编译的项目中使用MSVC编译的Boost二进制文件
- 为MinGW提升二进制文件
- c++ windows二进制文件:使用MinGW的条件
- 在cygwin中编译新的mingw二进制文件