Devnol / ShiftRegister74HC595-Pico

Port of the ShiftRegister74HC595 library to the Raspberry Pi Pico
Other
2 stars 0 forks source link

Can't add library to my code #1

Open craigyjp opened 1 year ago

craigyjp commented 1 year ago

I successfully compiled your example and I'm flashing LEDs from a 595, however, I tried to integrate the library into my code and I'm failing miserably. The cmake works fine, but the nmake fails.

[ 23%] Building C object CMakeFiles/pico-dco-dac-YD.dir/pico-dco-dac-YD.c.obj In file included from C:\Users\Craig\Documents\Pico\pico-dco-dac-YD\pico-dco-dac-YD.c:5: c:\users\craig\documents\pico\pico-dco-dac-yd\src\shiftregister74hc595.h:13:9: error: expected '=', ',', ';', 'asm' or attribute' before '<' token 13 | template | ^ In file included from c:\users\craig\documents\pico\pico-dco-dac-yd\src\shiftregister74hc595.h:34, from C:\Users\Craig\Documents\Pico\pico-dco-dac-YD\pico-dco-dac-YD.c:5: c:\users\craig\documents\pico\pico-dco-dac-yd\src\ShiftRegister74HC595.hpp:8:10: fatal error: cstring: No such file or directory 8 | #include | ^~~~~ compilation terminated. NMAKE : fatal error U1077: 'C:\PROGRA~2\GNUARM~1\102021~1.10\bin\AR19DD~1.EXE' : return code '0x1' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2' Stop. CMakeLists.txt

Devnol commented 1 year ago

Hi, thanks for reaching out.

I've never used or even heard of Nmake but what it seems like is that it is not able to find the cstring standard library. Now, I don't see exactly where it is utilised in the code so the first thing you could try was removing the line altogether. For me it appears to compile, at least with cmake. Again, I don't quite know how Nmake works but if that doesn't work you should look into why the cstring library isn't in your nmake library paths or whatever equivalent it uses.

I am really sorry I couldn't be of any more help, but if you do find a solution I'd be interested in hearing it.

I hope you have a lovely new year's eve and a great year in front of you. Devnol

craigyjp commented 1 year ago

Many thanks for the speedy reply, I changed to cmake ../ and make, but the make fails now

C:\Users\Craig\Documents\Pico\pico-dco-dac-YD\build>cmake ../ PICO_SDK_PATH is C:/Users/Craig/Documents/Pico/pico-sdk PICO platform is rp2040. Build type is Release PICO target board is pico. Using board configuration from C:/Users/Craig/Documents/Pico/pico-sdk/src/boards/include/boards/pico.h TinyUSB available at C:/Users/Craig/Documents/Pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB. cyw43-driver available at C:/Users/Craig/Documents/Pico/pico-sdk/lib/cyw43-driver lwIP available at C:/Users/Craig/Documents/Pico/pico-sdk/lib/lwip -- Configuring done -- Generating done -- Build files have been written to: C:/Users/Craig/Documents/Pico/pico-dco-dac-YD/build

C:\Users\Craig\Documents\Pico\pico-dco-dac-YD\build>make Makefile:32: *** missing separator. Stop.

C:\Users\Craig\Documents\Pico\pico-dco-dac-YD\build>

Devnol commented 1 year ago

Well that just says there is a syntax error in your makefile at line 32, doesn't seem to have anything to do with the other error.