Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

having trouble with windows and vs code setup #2

Open
midicdj1000 opened this issue Aug 9, 2023 · 13 comments
Open

having trouble with windows and vs code setup #2

midicdj1000 opened this issue Aug 9, 2023 · 13 comments
Labels
documentation Improvements or additions to documentation

Comments

@midicdj1000
Copy link

HI,
I just built my picocomputer and I am trying to setup on windows with vs code.
when I press F7 this is my output
[main] Building folder: picotest1-main [build] Starting build [proc] Executing command: "C:\Program Files\CMake\bin\cmake.exe" --build c:/pico6502/picotest1-main/build --config Debug --target all -j 18 -- [build] [ 3%] �[32mBuilding ASM object rp6502-sdk/CMakeFiles/rp6502.dir/src/crt0.s.obj�[0m [build] [ 7%] �[32mBuilding C object rp6502-sdk/CMakeFiles/rp6502.dir/src/close.c.obj�[0m [build] [ 11%] �[32mBuilding ASM object rp6502-sdk/CMakeFiles/rp6502.dir/src/initenv.s.obj�[0m [build] [ 14%] �[32mBuilding C object rp6502-sdk/CMakeFiles/rp6502.dir/src/lseek.c.obj�[0m [build] [ 18%] �[32mBuilding ASM object rp6502-sdk/CMakeFiles/rp6502.dir/src/mainargs.s.obj�[0m [build] [ 22%] �[32mBuilding C object rp6502-sdk/CMakeFiles/rp6502.dir/src/open.c.obj�[0m [build] [ 25%] �[32mBuilding ASM object rp6502-sdk/CMakeFiles/rp6502.dir/src/oserrlist.s.obj�[0m [build] C:/pico6502/picotest1-main/rp6502-sdk/src/lseek.c(11): Error: Include file 'errno.h' not found [build] 2 errors and 0 warnings generated. [build] C:/pico6502/picotest1-main/rp6502-sdk/src/lseek.c(25): Error: Call to undeclared function '_mappederrno' [build] make[2]: *** [rp6502-sdk/CMakeFiles/rp6502.dir/build.make:127: rp6502-sdk/CMakeFiles/rp6502.dir/src/lseek.c.obj] Error 1 [build] make[2]: *** Waiting for unfinished jobs.... [build] [ 29%] �[32mBuilding ASM object rp6502-sdk/CMakeFiles/rp6502.dir/src/oserror.s.obj�[0m [build] [ 33%] �[32mBuilding C object rp6502-sdk/CMakeFiles/rp6502.dir/src/read.c.obj�[0m [build] [ 37%] �[32mBuilding C object rp6502-sdk/CMakeFiles/rp6502.dir/src/randomize.c.obj�[0m [build] C:/pico6502/picotest1-main/rp6502-sdk/src/read.c(2): Error: Include file 'errno.h' not found [build] C:/pico6502/picotest1-main/rp6502-sdk/src/read.c(17): Error: Call to undeclared function '_mappederrno' [build] 2 errors and 0 warnings generated. [build] make[2]: *** [rp6502-sdk/CMakeFiles/rp6502.dir/build.make:192: rp6502-sdk/CMakeFiles/rp6502.dir/src/read.c.obj] Error 1 [build] make[1]: *** [CMakeFiles/Makefile2:126: rp6502-sdk/CMakeFiles/rp6502.dir/all] Error 2 [build] make: *** [Makefile:91: all] Error 2 [build] Build finished with exit code 2

I have made sure my project has the correct files in rp6502-sdk
new install of cc65
I am a casual programmer and don't use vscode all that much, but I did use cc65 for the c64.

also not sure what to do with the pyserial and my device manager has a issue with the device
picoprobe
pyserial

@midicdj1000
Copy link
Author

Just a note to say the python upload worked for basic.py after I changed the monitor port to windows com3.

@rumbledethumps
Copy link
Contributor

Picoprobe is only used for developing the Pi Pico software. It's OK to not have a device driver for 6502 development. It's also OK to not have a device driver if you're using USB/IP.

EhBASIC doesn't have a maintainer right now. It needs to be updated for the SDK which has arguments for selecting the serial port.

I don't think anyone is using the SDK under Windows right now. If they are, they haven't shared any documentation.

Congratulations on the successful build.

@rumbledethumps rumbledethumps added the documentation Improvements or additions to documentation label Aug 9, 2023
@midicdj1000
Copy link
Author

I made some progress on the vscode and the errno.h error was because it couldn't find the cc65 include files and I am not show how to fix that so I just copied them into the project include. Next problem is Unresolved external '___mappederrno' referenced and Unresolved external '___seterrno' referenced in:

then not sure how to connect it via the terminal.
[main] Building folder: picotest1-main [build] Starting build [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/pico6502/picotest1-main/build --config Debug --target all -j 18 -- [build] [ 48%] Built target rp6502 [build] [ 51%] �[32m�[1mLinking C executable hello�[0m [build] Unresolved external '___mappederrno' referenced in: [build] C:/pico6502/picotest1-main/rp6502-sdk/src/write.s(254) [build] C:/pico6502/picotest1-main/rp6502-sdk/src/write.s(118) [build] C:/pico6502/picotest1-main/rp6502-sdk/src/read.s(282) [build] C:/pico6502/picotest1-main/rp6502-sdk/src/read.s(102) [build] C:/pico6502/picotest1-main/rp6502-sdk/src/open.s(134) [build] C:/pico6502/picotest1-main/rp6502-sdk/src/lseek.s(205) [build] C:/pico6502/picotest1-main/rp6502-sdk/src/lseek.s(110) [build] C:/pico6502/picotest1-main/rp6502-sdk/src/close.s(60) [build] Unresolved external '___seterrno' referenced in: [build] C:/pico6502/picotest1-main/rp6502-sdk/src/open.s(55) [build] ld65: Error: 2 unresolved external(s) found - cannot create output file [build] make[2]: *** [CMakeFiles/hello.dir/build.make:276: hello] Error 1 [build] make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/hello.dir/all] Error 2 [build] make: *** [Makefile:91: all] Error 2 [build] Build finished with exit code 2

@midicdj1000
Copy link
Author

what does $ git submodule update --init do ?
That is the only part I have not run

@midicdj1000
Copy link
Author

midicdj1000 commented Aug 11, 2023

I am still suck with these errors
[build] Unresolved external '___mappederrno' referenced in:
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/write.s(254)
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/write.s(118)
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/read.s(282)
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/read.s(102)
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/open.s(134)
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/lseek.s(205)
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/lseek.s(110)
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/close.s(60)

[build] Unresolved external '___seterrno' referenced in:
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/open.s(55)

from write.s
if (ax < 0)
return _mappederrno(RIA_ERRNO_LO);

from errno.h
#if CC65_STD >= CC65_STD_CC65
/* define the name with just one underscore for backwards compatibility */
#define _mappederrno __mappederrno
#endif

so it my problem still related to the cc65 librarys ?

@rumbledethumps
Copy link
Contributor

Yes, a lot of these errors look like problems finding the CC65 includes.
https://github.com/picocomputer/rp6502-sdk/blob/882173aefd62373d2a39e6b38f2720e2eae3b40b/CMakeLists.txt#L8-L12

@thegouldfish
Copy link

Was trying to help and got an environment under windows working.
but I was getting a linker error, not sure if something has changed with CC65.
but I had to edit the oserror.s as the linker was looking for
___osmaperrno
where what it had was:
__osmaperrno

notice the 2 _ rather then the 3 the compiler and errno.inc was asking for
.global ___osmaperrno

@rumbledethumps
Copy link
Contributor

So much for stability and backwards compatibility of 20 year old software.
cc65/cc65@5d39048

@midicdj1000
Copy link
Author

After adding this to the cmakelists.txt
if(DEFINED ENV{CC65_INCLUDE})
set(CC65_INCLUDE $ENV{CC65_INCLUDE})
else()
set(CC65_INCLUDE "c:\pico6502\cc65\include")
endif()

this one worked
[build] [ 3%] �[32mBuilding ASM object rp6502-sdk/CMakeFiles/rp6502.dir/src/crt0.s.obj�[0m

this one has the Errol when it uses my local project
C:/pico6502/picotest1-main/rp6502-sdk/src/write.s(254)

it compiled ok until it tried to link
build] [ 92%] �[32mBuilding C object CMakeFiles/hello.dir/rp6502-sdk/src/write.c.obj�[0m
[build] [ 96%] �[32mBuilding C object CMakeFiles/hello.dir/rp6502-sdk/src/randomize.c.obj�[0m
[build] [100%] �[32m�[1mLinking C executable hello�[0m
[build] Unresolved external '___mappederrno' referenced in:
[build] C:/pico6502/picotest1-main/rp6502-sdk/src/write.s(254)

could cygwin64 have anything to so with it ?
CMAKE_ADDR2LINE:FILEPATH=C:/cygwin64/bin/addr2line.exe

@midicdj1000
Copy link
Author

Capture
with helps from @thegouldfish and @rumbledethumps I have the hello world compiled and uploaded.

Next is trying to document everything.

@rumbledethumps
Copy link
Contributor

Looking at both versions of the online docs (sigh) it seems like the Windows installer may (or may have in the past) set the CC65_HOME environment variable. If it doesn't, or you need CC65 somewhere else like drive D:, then setting this environment variable is much better then editing the SDK CMakeLists.txt.

https://github.com/picocomputer/rp6502-sdk/blob/b1343f48e3bc1117720bd0064af26ab47ed99e14/CMakeLists.txt#L8-L12

It's also possible to configure this in VSCode settings.json instead of your OS environment:

"cmake.configureEnvironment": {
    "CC65_HOME": "D:/CC65"
},

@midicdj1000
Copy link
Author

Thanks, I have setup a VM with windows and have recorded a setup that worked start to end.

@midicdj1000
Copy link
Author

I have a video showing how I setup VScode

https://youtu.be/zJpz16XDL9c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants