- Posts: 19
Error building emulator on mac os X
- Pixel166
- Topic Author
- Offline
I'm trying to build the emulator on mac os X, and I have this error :
+ Compiling 'target/common_emu/fltk.cpp'
target/common_emu/fltk.cpp: In function ‘void CLOCK_Init()’:
target/common_emu/fltk.cpp:461: error: ‘CLOCK_REALTIME’ was not declared in this scope
target/common_emu/fltk.cpp:461: error: ‘timer_create’ was not declared in this scope
target/common_emu/fltk.cpp:466: error: aggregate ‘itimerspec in’ has incomplete type and cannot be defined
target/common_emu/fltk.cpp:466: error: aggregate ‘itimerspec out’ has incomplete type and cannot be defined
target/common_emu/fltk.cpp:472: error: ‘timer_settime’ was not declared in this scope
make: *** [objs/emu_devo8/fltk.o] Error 1
I've search on Google, on the forum, without finding any solution.
I know the cross compiling environnement doesn't help for the emulator, but I just want to say that I successfully compile (on mac os X) the devo6 dfu file
Any idea to help me ?
Thx
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
Please Log in or Create an account to join the conversation.
- Pixel166
- Topic Author
- Offline
- Posts: 19
ifdef WINDOWS
#CROSS=i586-mingw32msvc-
FLTK_DIR = /usr/local
ifdef CROSS
FLTK_DIR = /opt/fltk-w32
PORTAUDIO_DIR = /opt/portaudio-w32
LFLAGS += -mno-cygwin
CFLAGS += -mno-cygwin
endif
LFLAGS := -L$(FLTK_DIR)/lib -L$(PORTAUDIO_DIR)/lib $(LFLAGS) -lole32 -luuid -lcomctl32 -lwsock32 -lgdi32 -lcomdlg32 -lportaudio
CFLAGS += -I$(FLTK_DIR)/include -I$(PORTAUDIO_DIR)/include -DWIN32
EXEEXT = exe
ODIREXT = -w32
else
LFLAGS := $(LFLAGS) -lrt
ifndef SOUND
CFLAGS += -DNO_SOUND
else
LFLAGS := $(LFLAGS) -lportaudio
endif
endif
It seems it won't help too much for my problem, but I will try it.. as I haven't any other solution for now.
About the version (commit), I try with a lot of them (even the last one), but the code where it makes an error don't change accross all the versions, so the error is still there
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
If I compile the emulator (on Windows XP) without this argument, I also get errors (file not found).
+ Compiling 'target/common_emu/fltk.cpp'
target/common_emu/fltk.cpp:28:19: schwerwiegender Fehler: FL/Fl.H: No such file or directory
Kompilierung beendet.
make: *** [objs/emu_devo8/fltk.o] Error 1
Please Log in or Create an account to join the conversation.
- RandMental
- Offline
- Posts: 521
May I ask why you want to build the emulator on a Mac? Even if you are succsfull by crosscompiling it on a MAc for Windows, you will need to copy the .exe file to a Windows PC to run it.
Without WINDOWS=1, you cross compile for the STM32 processors in the Devo TX
Adding WINDOWS=1 you compile for Windows for a Intel 586 processor, and the Windows operating system.
Please Log in or Create an account to join the conversation.
- Pixel166
- Topic Author
- Offline
- Posts: 19
I want to compile the emulator on my Mac, because I own a Mac, and don't have Windows. So I don't want a cross-compilation for windows, but I want a mac executable, to be launched on mac OS.
In my first most, I say I successfully compile the devo6 dfu file (with the cross compilation environnement), not the emulator
I have an Ubuntu at work, and I don't need the WINDOWS=1 to compile the emulator.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
1) A unix compliant one using signals and timers
2) A windows specific implementation because Windows isn't POSIX compliant
So you definitely do not want to use WINDOWS=1 (unless you compile with and run in Wine)
But MacOSX should be POSIX compliant, so the normal build should work.
Try adding:
#include <sys/time.h>
near the other includes and see if that helps.
you might also do:
find /usr/include -name "*.h" | xargs grep CLOCK_REALTIME
To see which file it is included from.
Please Log in or Create an account to join the conversation.
- FDR
- Offline
PhracturedBlue wrote: Well, we have 2 timer systems available:
1) A unix compliant one using signals and timers
2) A windows specific implementation because Windows isn't POSIX compliant
Could this difference cause the emulator's sound issue on Windows:
www.deviationtx.com/forum/7-development/...r-s-sounds-are-false
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- Pixel166
- Topic Author
- Offline
- Posts: 19
returns nothing.
find /usr/include -name "*.h" | xargs grep timer_t
return nothing.
After some searchs with Google, it seems mac os uses BSD time instead of POSIX time
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
It looks like you can use setitimer
here is a setitimer implementation for you:
#include <sys/time.h>
void CLOCK_Init()
{
timer_callback = NULL;
signal(SIGALRM, _ALARMhandler);
struct itimerval in;
in.it_value.tv_usec = 100 * 1000; //100msec
in.it_value.tv_sec = 0;
in.it_interval.tv_usec = 1000; //1msec
in.it_interval.tv_sec = 0;
setitimer(ITIMER_REAL, &in, NULL);
}
replace the code in fltk.cpp with that.
If it works let me know. It seems to be ok on Linux too so I can just make the change.
Please Log in or Create an account to join the conversation.
- Pixel166
- Topic Author
- Offline
- Posts: 19
The compilation passed this previous error, but now, I have an error with 32b/64b libraries (as I understand)
Undefined symbols for architecture x86_64:
"_objc_msgSendSuper2", referenced from:
-[FLWindow initWithFl_W:contentRect:styleMask:] in libfltk.a(Fl_cocoa.o)
-[FLView init] in libfltk.a(Fl_cocoa.o)
... CUT ...
"_CGRectUnion", referenced from:
Fl_Graphics_Driver::clip_box(int, int, int, int, int&, int&, int&, int&)in libfltk.a(fl_rect.o)
"_CGRectEqualToRect", referenced from:
Fl_Graphics_Driver::clip_box(int, int, int, int, int&, int&, int&, int&)in libfltk.a(fl_rect.o)
"_CGContextAddArc", referenced from:
Fl_Graphics_Driver::circle(double, double, double)in libfltk.a(fl_vertex.o)
Fl_Graphics_Driver::arc(int, int, int, int, double, double)in libfltk.a(fl_arci.o)
Fl_Graphics_Driver::pie(int, int, int, int, double, double)in libfltk.a(fl_arci.o)
"_CGGetActiveDisplayList", referenced from:
screen_init() in libfltk.a(screen_xywh.o)
"_CGDisplayBounds", referenced from:
screen_init() in libfltk.a(screen_xywh.o)
"_CGDisplayScreenSize", referenced from:
screen_init() in libfltk.a(screen_xywh.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [emu_devo8.elf] Error 1
The error seems to be a bad version of libfltk.a, but if I check, it's an x86_64 version. I don't understant
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
You can try building it yourself, it is reasonably easy to do.
Please Log in or Create an account to join the conversation.
- vanwadiver
- Offline
- Posts: 15
I'd be interested in any tips on how you succeeded in building it, if possible.
Thanks..
Please Log in or Create an account to join the conversation.
- Pixel166
- Topic Author
- Offline
- Posts: 19
No, I can't build the emulator on mac os X. But to be honnest, I give up very little time after the last post of this topic
Please Log in or Create an account to join the conversation.
- vanwadiver
- Offline
- Posts: 15
Thanks!
Please Log in or Create an account to join the conversation.
- Lyndros
- Offline
- Posts: 57
Please Log in or Create an account to join the conversation.
- mwm
- Offline
One thing you'll want to do is create a bin specifically for building deviation firmware and emulators. The makes fail if cc isn't gcc like it is on FreeBSD, and OS X seems to do the same.
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Please Log in or Create an account to join the conversation.
- Lyndros
- Offline
- Posts: 57
On the other hand it looks like the 2011 version of portaudio it is a nightmare to compile with MacOS SDK 10.10 anyhow I downloaded the latest stable portaudio and compile it ... but now another nightmare ... so I will keep going with my virtual machine
On the other hand, stupid question I fixed some typos in the spanish translation but I can not create pull request to deviation main repo, any clue?
Please Log in or Create an account to join the conversation.
- mwm
- Offline
What are you doing, and what's going wrong? The more detail, the better. With that, we might be able to sort out what's wrong.
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Error building emulator on mac os X