我已经厌倦了 MSVC++6 以及每个人总是告诉我它是一个糟糕的编译器等等。
所以现在我决定尝试使用 vim 加上 g++ 和 makefile。这是我的问题;我有以下生成文件:
# This is supposed to be a comment..
CC = g++
# The line above sets the compiler in use..
# The next line sets the compilation flags
CFLAGS=-c -Wall
all: main.exe
main.exe: main.o Accel.o
$(CC) -o main.exe main.o Accel.o
main.o: main.cpp Accel.h
$(CC) $(CFLAGS) main.cpp
Accel.o: Accel.cpp Accel.h
$(CC) $(CFLAGS) Accel.cpp
clean:
del main.exe *.o
这在尝试时会出错make
,因为我需要链接到一个名为 的 Windows 库Ws2_32.lib
,这是Winsock2.h
我include
在我的一个.h
文件中需要的。
那么我该怎么做呢?我已经尝试过这个-l
选项,但我无法让它工作。它如何与有空格的路径一起工作?