Header file not found

75 views
Skip to first unread message

Jimmy Johnson

unread,
Jan 13, 2025, 12:24:43 AMJan 13
to Eiffel Users
I get this error:

Screen Shot 2025-01-12 at 10.20.09 PM.png

My project settings has the directory that contains the .h file:

Screen Shot 2025-01-12 at 10.22.20 PM.png

So, what am I missing?
Thanks,
jjj

Jimmy Johnson

unread,
Jan 17, 2025, 11:56:40 PMJan 17
to Eiffel Users
To add to the question, here is my file structure, the ecf file that uses the mindstorms library, and my environment variables.  I don't understand why the compiler/linker can't find the include file.

Question:  should includes and library files be added to the project file for a library, or must it be [also] added to a project that uses that library? 

Screen Shot 2025-01-17 at 9.51.20 PM.png

Screen Shot 2025-01-17 at 9.48.16 PM.png

Screen Shot 2025-01-17 at 9.48.57 PM.png

Ilgiz Mustafin

unread,
Jan 18, 2025, 5:28:43 PMJan 18
to Eiffel Users
You can dive into EIFGENs and check what the actual Makefiles contain. There you can check how external include and library locations are inserted into compilation and linking command line parameters.

суббота, 18 января 2025 г. в 05:56:40 UTC+1, eiffe...@gmail.com:

Jimmy Johnson

unread,
Jan 20, 2025, 2:46:49 PMJan 20
to Eiffel Users
These lines look [maybe] relevant:
1.  From Makefile.SH:
INCLUDE_PATH =  -I"\$JJ_GITHUB\jj_mindstorms\includes" -I"\$(ISE_LIBRARY)/library/base/elks/encoding/implementation/include" `$ISE_LIBRARY/library/base/elks/encoding/implementation/unix/Clib/iconv-config --include_path`
2.  From Makefile:
INCLUDE_PATH =  -I"$JJ_GITHUB\jj_mindstorms\includes" -I"$(ISE_LIBRARY)/library/base/elks/encoding/implementation/include" 

So, what does that tell me? 
jjj

Ilgiz Mustafin

unread,
Jan 20, 2025, 3:04:56 PMJan 20
to eiffel...@googlegroups.com
Slashes seem to be inverted. Try to replace $JJ_GITHUB with $(JJ_GITHUB) in ecf.

I think I remember () making a difference for something, but I don't remember... 

пн, 20 янв. 2025 г., 20:46 Jimmy Johnson <eiffe...@gmail.com>:
--
You received this message because you are subscribed to a topic in the Google Groups "Eiffel Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eiffel-users/cvYvdMfLyUY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eiffel-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/eiffel-users/4f16ff4b-04e0-4567-a459-30d758eae727n%40googlegroups.com.

Jocelyn Fiat

unread,
Jan 21, 2025, 2:53:45 AMJan 21
to eiffel...@googlegroups.com
Be careful when using external C code, the directory separators are not the same on Windows, and unices
For an example, check the vision2.ecf you will notice for instance, the conditions

<external_include location="$(ISE_LIBRARY)\library\vision2\spec\include">
  <condition>
    <platform value="windows"/>
  </condition>
</external_include>
<external_include location="$(ISE_LIBRARY)/library/vision2/spec/include">
  <condition>
    <platform excluded_value="windows"/>
  </condition>
</external_include>

You need to do the same for your ecf.

--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/eiffel-users/e0ad86a9-dfe6-44b5-aa3b-83c686424964n%40googlegroups.com.


--
Jocelyn
------------------------------------------------------------------------
Eiffel Software
https://www.eiffel.com
Customer support: https://support.eiffel.com
User group: https://groups.google.com/forum/#!forum/eiffel-users
------------------------------------------------------------------------

Ulrich Windl

unread,
Jan 21, 2025, 8:16:53 AMJan 21
to eiffel...@googlegroups.com
Hi!

If I remember it correctly, Halstenbach Eiffel used "|" as platform-independent path separator. It would be quite nice if _one path specification would work for all platforms.

Kind regards,
Ulrich

Jimmy Johnson

unread,
Jan 29, 2025, 6:24:55 PMJan 29
to Eiffel Users
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):

<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-21-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-21-0 http://www.eiffel.com/developers/xml/configuration-1-21-0.xsd" name="jj_mindstorms" uuid="EA28DC08-87BF-49AD-B060-2A5575CA3E41"
library_target="jj_mindstorms">
<target name="jj_mindstorms">
<root all_classes="true"/>
<file_rule>
<exclude>/CVS$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/\.git</exclude>
<exclude>/\.svn</exclude>
<exclude>/tests$</exclude>
</file_rule>
<option warning="warning" full_class_checking="false" is_attached_by_default="true" is_obsolete_routine_type="true" manifest_array_type="mismatch_warning">
</option>
<setting name="total_order_on_reals" value="false"/>
<setting name="dead_code_removal" value="feature"/>
<capability>
<concurrency support="scoop" use="scoop"/>
<void_safety support="all" use="all"/>
</capability>

<external_include location="$(JJ_GITHUB)\jj_mindstorms\includes">

<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:

<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-21-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-21-0 http://www.eiffel.com/developers/xml/configuration-1-21-0.xsd" name="jj_mindstorms_tester" uuid="2C3E028B-AD6B-4A9C-9ABA-373817552720">
<target name="jj_mindstorms_tester">
<root class="MINDSTORMS_TESTER" feature="make"/>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="jj_mindstorms" location="..\jj_mindstorms.ecf" readonly="false"/>
<cluster name="tests" location=".\" recursive="true">
<file_rule>
<exclude>/../git</exclude>
<exclude>/.svn$</exclude>
<exclude>/CVS$</exclude>
<exclude>/EIFGENs$</exclude>
</file_rule>
</cluster>
</target>
</system>

jf...@eiffel.com

unread,
Feb 12, 2025, 7:18:13 AMFeb 12
to Eiffel Users
note that from Eiffel 25.02 , the compiler supports the $(path_separator) in external locations within ECF files.
Reply all
Reply to author
Forward
0 new messages