B4R Question how to have more traces on issues during compilation ?

candide

Active Member
Licensed User
at compilation with a new library under development, i have a compilation issue with linker and it stop without message:
B4X:
C:\Users\mpage\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/cont_util.cpp:65: multiple definition of `cont_can_yield'; D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\cont_util.c.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/cont_util.c:58: first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
DEBUG StatusLogger Stopping LoggerContext[name=1e6f5c3, org.apache.logging.log4j.core.LoggerContext@8ef162]
DEBUG StatusLogger Stopping LoggerContext[name=1e6f5c3, org.apache.logging.log4j.core.LoggerContext@8ef162]...

do we have a way to have more traces during B4R compilation, to understand what is the Linker issue ?
with arduino, we have 4 levels of compilation messages, do we have the same with B4R?

other question, can we use Arduino to compile directly a B4R project in project directory with "myapplication\Objects\src\src.ino" ?
my first try is not OK...

thanks for your help
 

Daestrum

Well-Known Member
Licensed User
Longtime User
I may be reading the message wrong, but isn't it telling you that "cont_can_yield" has been defined in two places.

Once in
C:\Users\mpage\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/cont_util.cpp at line 65
and in
D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/cont_util.c: at line 58 - which was defined first

so the linker doesn't know which one to use.
 
Upvote 0

candide

Active Member
Licensed User
i am not sure it is my issue : yes, cont.h it is define in 2 places, in esp8266 package and in directory of work.
But because i use #include "cont.h", only local file will be used.
=> at end of line from linker we have first defined here and only this locale version should be selected

it what i understand, but it can be a mistake...
 
Upvote 0

candide

Active Member
Licensed User
after some tests and removal of cont.h and cont_util.c from my directory, i am using files from esp8266 package and it solved a part of my problem.
last issue is around a class declaration and is not solved yet :
with this code in wrapper, i have compilation issue:
B4X:
 class Task1 : public Task
    { 
      public:
       void setup();
       void loop();
    } MyTask_001;

Vérification...
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\B4RCore.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: multiple definition of `MyTask_001'; D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\B4RArduino.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: first defined here
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\B4RStream.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: multiple definition of `MyTask_001'; D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\B4RArduino.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: first defined here
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\Scheduler.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: multiple definition of `MyTask_001'; D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\B4RArduino.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: first defined here
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\b4r_main.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: multiple definition of `MyTask_001'; D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\B4RArduino.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: first defined here
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\rScheduler2.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: multiple definition of `MyTask_001'; D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\B4RArduino.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: first defined here
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\src.ino.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: multiple definition of `MyTask_001'; D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch\B4RArduino.cpp.o:D:\B4R\B4R_AP~1\TEST_D~1\Objects\bin\sketch/rScheduler2.h:32: first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
[/code}
it seems "MyTask_001" is in rScheduler.cpp.o but alos in B4RArduino.cpp.o. (i don't know why...)

if i change my code in this way:
[code]
 class Task1 : public Task
    { 
      public:
       void setup();
       void loop();
    }; //MyTask_001;
Executable segment sizes:
IROM   : 236320          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 26892   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 
DATA   : 1252  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 852   ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 26176 )         - zeroed variables      (global, static) in RAM/HEAP 
Téléversement...
=> compilation is OK, but i need "MyTask_001" object in a other part of library.
I am now searching a solution for this part...
 
Upvote 0

candide

Active Member
Licensed User
i found how to configurate level of traces provided by B4R during compilation: it is depending of arduino configuration

configuration of trace level at compilation is done in Arduino, in File => Preferences => Compiler Warnings => None/Default/More/All
 
Upvote 0
Top