Thanks Jocelyn.
I did some tweaking of the header files and using Eiffel 18.11 (but I think I could use any 32-bit version, because this is not an Eiffel problem.) I'm using Eiffel 18.11 in VirtualBox Windows XP running on iMac. I changed the header files to force the defines for i386 platform. (Note: this project used to work when I had a Dell [maybe i386] and likely using Eiffel 14.x)
It now seems to compile but does not link. The tail of the C-compilation output along with my ecf files are below. I think my project cannot find definitions for C++ functions that I call as externals. For example from my MOTOR class:
c_set_forward (obj: POINTER; a_port: INTEGER; a_speed: INTEGER)
-- Wrapper to turn on the motor
require
object_exists: obj /= default_pointer
external
"C++ inline use %"NXT++.h%""
alias
"[
NXT::Motor::SetForward ((Comm::NXTComm *) $obj, (int) $a_port, (int) $a_speed);
]"
end
I attempt to use the "fantom" library. It includes header files (e.g. "comm.h", "NXT++.h", iNXT.h, etc) and libraries (fantom.dll, fantom.lib, and NXT++.lib). So questions:
1) Do I include the .lib files or the .dll file or all of them?
2) Do I include the "includes" in my library file or must I also include the headers in my project file that uses the library?
3) Same question for the external library files. How do I make external libraries visible to my project? Is including my library (that has externals listed in the ecf) enough or must I also include the externals in my project file as well?
Thanks to anyone that read this far,
jjj
C-compilation output:
if [ ! -f ../../../jj_mindstorms_tester.rc ] ; then "C:\Program Files\Eiffel Software\EiffelStudio 18.11 GPL/gcc/windows/msys/1.0/bin/cp" "C:\Program Files\Eiffel Software\EiffelStudio 18.11 GPL/studio/config/windows/mingw/eiffel.rc" ../../../jj_mindstorms_tester.rc ; fi
"C:\Program Files\Eiffel Software\EiffelStudio 18.11 GPL/gcc/windows/mingw/bin/windres" --preprocessor='"C:\Program Files\Eiffel Software\EiffelStudio 18.11 GPL/gcc/windows/mingw/bin/cpp.exe"' -I../../.. ../../../jj_mindstorms_tester.rc -O coff -o jj_mindstorms_tester.res
"C:\Program Files\Eiffel Software\EiffelStudio 18.11 GPL/gcc/windows/msys/1.0/bin/rm" -f jj_mindstorms_tester.exe
"C:\Program Files\Eiffel Software\EiffelStudio 18.11 GPL/gcc/windows/mingw/bin/gcc" -mwindows -o jj_mindstorms_tester.exe E1/emain.o jj_mindstorms_tester.res E1/eparents.o E1/einit.o E1/ececil.o E1/evisib.o E1/enames.o E1/eskelet.o E1/eplug.o E1/ecall.o E1/efrozen.o E1/epattern.o E1/eoption.o C24/Cobj24.o C23/Cobj23.o C22/Cobj22.o C21/Cobj21.o C20/Cobj20.o C19/Cobj19.o C18/Cobj18.o C17/Cobj17.o C16/Cobj16.o C15/Cobj15.o C14/Cobj14.o C13/Cobj13.o C12/Cobj12.o C11/Cobj11.o C10/Cobj10.o C9/Cobj9.o C8/Cobj8.o C7/Cobj7.o C6/Cobj6.o C5/Cobj5.o C4/Cobj4.o C3/Cobj3.o C2/Cobj2.o C1/Cobj1.o "\jj_mindstorms\libraries\NXT++.lib" "\jj_mindstorms\libraries\fantom.lib" "C:\Program Files\Eiffel Software\EiffelStudio 18.11 GPL/studio/spec/windows/lib/mingw/wkbench.a" -luser32 -lws2_32 -ladvapi32 -lgdi32 -lshell32 -lmsimg32 -lcomdlg32 -luuid -lole32 -loleaut32 -lcomctl32 -lmpr -lshlwapi -lwinspool -lstdc++
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x66011): undefined reference to `NXT::Sensor::SetTouch(Comm::NXTComm*, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x66ccd): undefined reference to `NXT::OpenBT(Comm::NXTComm*)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x66ce3): undefined reference to `NXT::Close(Comm::NXTComm*)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x74263): undefined reference to `NXT::Sensor::SetLight(Comm::NXTComm*, int, bool)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x75b07): undefined reference to `NXT::Sensor::SetRaw(Comm::NXTComm*, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x75b21): undefined reference to `NXT::Sensor::GetValue(Comm::NXTComm*, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x7a0af): undefined reference to `NXT::Motor::SetForward(Comm::NXTComm*, int, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x7a0d0): undefined reference to `NXT::Motor::SetReverse(Comm::NXTComm*, int, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x7a0fe): undefined reference to `NXT::Motor::Stop(Comm::NXTComm*, int, bool)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x7a118): undefined reference to `NXT::Motor::GetRotationCount(Comm::NXTComm*, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x7a146): undefined reference to `NXT::Motor::ResetRotationCount(Comm::NXTComm*, int, bool)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x7a160): undefined reference to `NXT::Motor::BrakeOn(Comm::NXTComm*, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x7a17a): undefined reference to `NXT::Motor::BrakeOff(Comm::NXTComm*, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x83e25): undefined reference to `NXT::Sensor::SetDistNx(Comm::NXTComm*, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x83e3f): undefined reference to `NXT::Sensor::GetDistNxValue(Comm::NXTComm*, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x83e59): undefined reference to `NXT::Sensor::GetCleanDistNxValue(Comm::NXTComm*, int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x85f2a): undefined reference to `Wait(int)'
C3/Cobj3.o:big_file_C3_cpp.cpp:(.text+0x8c088): undefined reference to `NXT::Sensor::SetSound(Comm::NXTComm*, int)'
collect2: ld returned 1 exit status
make.exe": *** [jj_mindstorms_tester.exe] Error 1
I tried to use conditions as you said with my ecf file. My project, "mindstorms_tester.ecf" uses my library "jj_mindstorm.ecf".
mindstorms.ecf (my library whose classes use the C++ libary):
<condition>
<platform value="windows"/>
</condition>
</external_include>
<external_include location="$(JJ_GITHUB)/jj_mindstorms/includes">
<condition>
<platform excluded_value="windows"/>
</condition>
</external_include>
<external_library location="$(JJ_GITHUB)\jj_mindstorms\libraries\NXT++.lib">
<condition>
<platform value="windows"/>
</condition>
</external_library>
<external_library location="$(JJ_GITHUB)/jj_mindstorms/libraries/NXT++.lib">
<condition>
<platform excluded_value="windows"/>
</condition>
</external_library>
<external_library location="$(JJ_GITHUB)\jj_mindstorms\libraries\fantom.lib">
<condition>
<platform value="windows"/>
</condition>
</external_library>
<external_library location="$(JJ_GITHUB)/jj_mindstorms/libraries/fantom.lib">
<condition>
<platform excluded_value="windows"/>
</condition>
</external_library>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<cluster name="jj_mindstorms" location=".\" recursive="true"/>
</target>
</system>
The project file that uses the jj_mindstorms library, jj_mindstorms_tester.ecf: