Forum Rule: Always post complete source code & details to reproduce any issue!
Page 11 of 11 FirstFirst ... 9 10 11
Results 251 to 259 of 259

Thread: Compiling Teensy Sketches with VisualCode (Win10)

  1. #251
    Junior Member
    Join Date
    Jul 2021
    Posts
    19
    Quote Originally Posted by luni View Post
    Fixed in v1.1.1
    Thanks, I'll try it out. Where do I find the compiled version of v1.1.1? (The link to "latest release" in the Quick Start Guide still points to v1.0.0)

  2. #252
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,643
    I didn't make a release yet (I want to add some other stuff). The current version is in the master branch. Can you compile this yourself or do you need precompiled files?

    Edit: Here you are https://github.com/luni64/VisualTeensy/issues/55
    Last edited by luni; 08-18-2021 at 05:16 PM.

  3. #253
    Junior Member
    Join Date
    Jul 2021
    Posts
    19
    Thanks, works 100% on my PC.

  4. #254
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,643
    Thanks for testing. Added it to v1.2.0 which I just released: https://github.com/luni64/VisualTeensy/releases

    Release notes:

    Bugfixes
    • fixed bug with setting the RTC time for T3.x boards on special PC configurations
    • changed object file name scheme to allow source files with same base name but different extension (e.g. foo.c and foo.cpp)
    • fixed bugs in 'File | New' and 'File | Save As'


    New features
    Until now VisualTeensy was able to either copy or link the Teensyduino core files to the project folder. The source typically was an existing Arduino installation. This version additionally allows to directly 'git clone' the repository (https://github.com/PaulStoffregen/cores) into the project folder.

    Besides removing the dependency on an existing Arduino installation, cloning the Teensyduino core is very convenient for testing new Teensyduino versions or to experiment with the currently worked on version. You can use the native git tools of vsCode or any other git tool to check out all versions experimental pull requests or the current repository master with a few clicks.

  5. #255
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,643
    Problems compiling QNEthernet were reported here: https://forum.pjrc.com/threads/68066...l=1#post289276

    The reason for the issue is that VisualTeensy adds all subdirectories of the <lib>/src folder to the include search path. QNEthernet has a copy of the errno.h header in one of its subdirectories.
    Since GCC includes all include folders specified with -Ipath into the search path BEFORE the system files, the core includes the QNEthernet version of errno.h which causes the issue.

    I therefore restricted the include search path for libraries to
    • <lib>/
    • <lib>/utility
    • <lib>/src


    This works for the reported problem. I also think that this complies to the library specification given here https://arduino.github.io/arduino-cl...specification/. However, it will generate problems for libraries assuming subfolders are included in the search path. I therefore want to publish the changes only after some testing.

    If someone is interested, the beta version can be downloaded here: https://github.com/luni64/VisualTeensy/issues/58

  6. #256
    Senior Member
    Join Date
    Feb 2020
    Posts
    104
    Quote Originally Posted by luni View Post
    Problems compiling QNEthernet were reported here: https://forum.pjrc.com/threads/68066...l=1#post289276

    The reason for the issue is that VisualTeensy adds all subdirectories of the <lib>/src folder to the include search path. QNEthernet has a copy of the errno.h header in one of its subdirectories.
    Since GCC includes all include folders specified with -Ipath into the search path BEFORE the system files, the core includes the QNEthernet version of errno.h which causes the issue.

    I therefore restricted the include search path for libraries to
    • <lib>/
    • <lib>/utility
    • <lib>/src


    This works for the reported problem. I also think that this complies to the library specification given here https://arduino.github.io/arduino-cl...specification/. However, it will generate problems for libraries assuming subfolders are included in the search path. I therefore want to publish the changes only after some testing.

    If someone is interested, the beta version can be downloaded here: https://github.com/luni64/VisualTeensy/issues/58
    Luni,

    Thanks for the quick response. I tried v1.2.1 beta and it still has the issue.

    Steps to repeat

    1. Visual teensy, create new project in empty folder
    2. Add QNEthernet library
    3. Save
    4. Visual Studio opens
    5. Clean
    6. Build

    Code:
    CORE [ASM] memset.S 
    CORE [ASM] memcpy-armv7m.S 
    CORE [CC]  sm_free.c 
    cores\teensy4/sm_free.c: In function 'sm_free_pool':
    cores\teensy4/sm_free.c:15:3: error: 'errno' undeclared (first use in 
    this function)
       errno = EINVAL;
       ^
    cores\teensy4/sm_free.c:15:3: note: each undeclared identifier is reported only once for each function it appears in
    cores\teensy4/sm_free.c:15:11: error: 'EINVAL' undeclared (first use in this function)
       errno = EINVAL;
               ^
    make: *** [makefile:182: .vsteensy/build/core/sm_free.c.o] Error 1
    make: *** Waiting for unfinished jobs....
    CORE [CC]  sm_util.c 
    CORE [CC]  sm_calloc.c 
    CORE [CC]  clockspeed.c 
    CORE [CC]  usb_serial.c 
    CORE [CC]  usb_keyboard.c 
    CORE [CC]  sm_szalloc.c 
    cores\teensy4/sm_szalloc.c: In function 'sm_szalloc_pool':
    cores\teensy4/sm_szalloc.c:14:3: error: 'errno' undeclared (first use 
    in this function)
       errno = EINVAL;
       ^
    cores\teensy4/sm_szalloc.c:14:3: note: each undeclared identifier is reported only once for each function it appears in
    cores\teensy4/sm_szalloc.c:14:11: error: 'EINVAL' undeclared (first use in this function)
       errno = EINVAL;
               ^
    make: *** [makefile:183: .vsteensy/build/core/sm_szalloc.c.o] Error 1
    CORE [CC]  sm_malloc.c 
    cores\teensy4/sm_malloc.c: In function 'sm_malloc_pool':
    cores\teensy4/sm_malloc.c:17:3: error: 'errno' undeclared (first use in this function)
       errno = EINVAL;
       ^
    cores\teensy4/sm_malloc.c:17:3: note: each undeclared identifier is reported only once for each function it appears in
    cores\teensy4/sm_malloc.c:17:11: error: 'EINVAL' undeclared (first use in this function)
       errno = EINVAL;
               ^
    cores\teensy4/sm_malloc.c:101:10: error: 'ENOMEM' undeclared (first use in this function)
      errno = ENOMEM;
              ^
    make: *** [makefile:183: .vsteensy/build/core/sm_malloc.c.o] Error 1  
    CORE [CC]  usb.c 
    CORE [CC]  analog.c 
    CORE [CC]  usb_seremu.c 
    CORE [CC]  usb_joystick.c 
    CORE [CC]  interrupt.c 
    CORE [CC]  delay.c 
    CORE [CC]  sm_zalloc.c 
    The terminal process "C:\Program Files\PowerShell\7\pwsh.exe -Command .../GitHub/VisualTeensy_v1_2_1.beta/make.exe all -j -Otarget" terminated with exit code: 1.

  7. #257
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,643
    Did you add the QNEthernet library to your lib folder or to the shared library folder?

    Edit:
    You probably did, I can reproduce that when including the lib from the shared libraries repository

    Can you try to comment or delete line 143 from the makefile and see if it works then?
    This one:
    Code:
    143  #INCLUDE         += $(foreach d, $(LIB_DIRS_SHARED), -I$d)
    Last edited by luni; 09-24-2021 at 04:28 PM.

  8. #258
    Senior Member
    Join Date
    Feb 2020
    Posts
    104
    Quote Originally Posted by luni View Post
    Did you add the QNEthernet library to your lib folder or to the shared library folder?

    Edit:
    You probably did, I can reproduce that when including the lib from the shared libraries repository

    Can you try to comment or delete line 143 from the makefile and see if it works then?
    This one:
    Code:
    143  #INCLUDE         += $(foreach d, $(LIB_DIRS_SHARED), -I$d)
    Yes, shared library folder.

    The comment in makefile worked, I can compile the blinky. I'll try my full application next and let you know.

    Thank you Luni.

    EDIT: My application compiles now and looks to be working. Thanks again.

  9. #259
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,643
    Ok, I'll update the beta with the fix later today. Have fun with VisualTeensy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •