Hello,
I’m a C++ n00b, so please bare with me.
So far I see that if I want to compile an oF app to windows I must do
the compiling on Windows, similar for Linux.
I’ve tried using virtual machines, but they take a lot of resources and video
emulation isn’t great.
I was wondering if there any options out there.
I did a bit of googling and found this:
http://crossgcc.rts-software.org/doku.php
Has anyone tried this ? Would it be possible to use something like this to compile oF
apps for Windows/Linux from OSX ?
Currently I’ve downloaded they’re pkg files, installed and added the bin paths to .bash_profile,
but initially calling i386-mingw32-gcc / i386-mingw32-g++ didn’t work.
After installing i386-mingw32-gcc using MacPorts calling i386-mingw32-gcc from Terminal
worked, I imagine it must’ve been some dependencies.
There’s a hello world sample provided
#include <iostream>
using namespace std ;
int main (void) {
cout << "Hello world !" << endl ;
return 0 ;
}
with a makefile, but I haven’t managed to run it.
I’ve updated TOOL_DIR to match the path I’ve used:
#------------------------------------------------------------------------------*
# *
# C + + H E L L O W O R L D F O R M I N G W 3 2 O N M A C O S X *
# *
# Updated for Release 2 *
# *
#------------------------------------------------------------------------------*
TOOL_DIR := /usr/local/i386-mingw32-4.3.0/bin
SOURCES := hello_world.cpp
OBJECTS_DIR := objects
EXECUTABLE := hello_world_in_cpp.exe
ALL_OBJECT_FILES := $(patsubst %, $(OBJECTS_DIR)/%.o, $(SOURCES))
all:$(OBJECTS_DIR) $(EXECUTABLE)
#--- Make object dir
$(OBJECTS_DIR):
mkdir $(OBJECTS_DIR)
#--- C++ compile : use gcc
$(OBJECTS_DIR)/%.cpp.o:%.cpp
$(TOOL_DIR)/i386-mingw32-gcc -c $< -o $@
#--- C++ link : use g++
$(EXECUTABLE):$(ALL_OBJECT_FILES)
$(TOOL_DIR)/i386-mingw32-g++ $< -o $@
$(TOOL_DIR)/i386-mingw32-strip --strip-all $@
clean:
rm -f $(EXECUTABLE)
rm -Rf $(OBJECTS_DIR)/
but I get this error:
makefile:27: *** missing separator. Stop.
and I don’t know what it means
Any hints/tips ?
Thanks,
George