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

Compiling issues #1

Open
twenta opened this issue Aug 26, 2018 · 7 comments
Open

Compiling issues #1

twenta opened this issue Aug 26, 2018 · 7 comments
Labels
good first issue Good for newcomers

Comments

@twenta
Copy link

twenta commented Aug 26, 2018

Hi,

thanks for sharing. Can you provide more detail on how to get this running on a pi?
Running "make" results in errors due to missing references in the Makefile (nbprojects folder)

@ahettlin
Copy link
Owner

ahettlin commented Aug 27, 2018

Honestly, it's been so long since I've had to deal with make files that I've forgotten how to use them properly. I used Netbeans to set up this project, which created a whole bunch of files unrelated to the core code. I decided not to commit those files since they weren't really relevant, but I must have not noticed the reference to the project folder in the makefile.

For my projects that use this "library", I have been referencing the source files directly. I have not configured it to compile into any sort of true library file to link against.

Now for getting it to run on a Pi, I have set up Netbeans to use the Pi as a build and run target. Here's an article I found that should get you started. It looks pretty close to the setup I have.

https://pirobotblog.wordpress.com/2017/03/18/setting-up-netbeans-for-the-raspberry-pi/

You will need to link with the wiringPi library (-lwiringPi).

With the basic setup I have, the built executable gets placed in ./home/pi/.netbeans/remote/{RPi IP Address}/{Host name of machine with Netbeans}/{path to project folder}/dist/Release/GNU-Linux. It's a long and complicated path, but it works and I haven't spent the time to simplify it.

Hopefully this helps.

@ahettlin ahettlin added the good first issue Good for newcomers label Aug 30, 2018
@zinefer
Copy link

zinefer commented Dec 4, 2018

I'm also struggling to get the example to compile:

/tmp/cc2HIuvo.o: In function `random8()':
DemoReel100.cpp:(.text+0xb4): undefined reference to `rand16seed'
/tmp/cc2HIuvo.o: In function `random16()':
DemoReel100.cpp:(.text+0x10c): undefined reference to `rand16seed'
/tmp/cc2HIuvo.o: In function `main':
DemoReel100.cpp:(.text+0x66c): undefined reference to `PiLED::PiLED(CRGB*, int)'
/tmp/cc2HIuvo.o: In function `rainbow()':
DemoReel100.cpp:(.text+0x8e4): undefined reference to `fill_rainbow(CRGB*, int, unsigned char, unsigned char)'
/tmp/cc2HIuvo.o: In function `confetti()':
DemoReel100.cpp:(.text+0x9e0): undefined reference to `fadeToBlackBy(CRGB*, unsigned short, unsigned char)'
DemoReel100.cpp:(.text+0xa68): undefined reference to `hsv2rgb_rainbow(CHSV const&, CRGB&)'
/tmp/cc2HIuvo.o: In function `sinelon()':
DemoReel100.cpp:(.text+0xaa8): undefined reference to `fadeToBlackBy(CRGB*, unsigned short, unsigned char)'
DemoReel100.cpp:(.text+0xb2c): undefined reference to `hsv2rgb_rainbow(CHSV const&, CRGB&)'
/tmp/cc2HIuvo.o: In function `bpm()':
DemoReel100.cpp:(.text+0xc3c): undefined reference to `ColorFromPalette(CRGBPalette16 const&, unsigned char, unsigned char, TBlendType)'
DemoReel100.cpp:(.text+0xc84): undefined reference to `PartyColors_p'
/tmp/cc2HIuvo.o: In function `juggle()':
DemoReel100.cpp:(.text+0xca8): undefined reference to `fadeToBlackBy(CRGB*, unsigned short, unsigned char)'
DemoReel100.cpp:(.text+0xd4c): undefined reference to `hsv2rgb_rainbow(CHSV const&, CRGB&)'
/tmp/cc2HIuvo.o: In function `__static_initialization_and_destruction_0(int, int)':
DemoReel100.cpp:(.text+0xde0): undefined reference to `PiLED::PiLED()'
/tmp/cc2HIuvo.o: In function `PiLED::show()':
DemoReel100.cpp:(.text._ZN5PiLED4showEv[_ZN5PiLED4showEv]+0x20): undefined reference to `PiLED::show(unsigned char)'
collect2: error: ld returned 1 exit status

@ahettlin
Copy link
Owner

ahettlin commented Dec 7, 2018

@zinefer It looks like the compiler isn't seeing the PiLED/FastLED source. Make sure it's been added to your project properly. I'm afraid I can't be much help other than that since there are so many ways to set up a project and I'm not even that familiar with how it works inside NetBeans, which is the IDE I used.

@zinefer
Copy link

zinefer commented Dec 7, 2018

It is finding the files. If I change the path it throws a different error about that.

It's alright - I am worried this isn't going to work outside netbeans and that's not something I am interested in using for this project. Thanks anyway! :)

@ahettlin
Copy link
Owner

ahettlin commented Dec 7, 2018

Understood. I have no particular ties to NetBeans. It just happens to be the thing I found instructions for compiling code remotely on the Pi and my first attempt worked, so I never went looking for anything else. The code itself has nothing that relies on a particular IDE/compiler though.

@Reaper35
Copy link

Reaper35 commented Jan 30, 2019

@twenta @zinefer @ahettlin:
Hi there!
First thanks for porting FastLED for the RPi! I was wondering that nearly no one else wants to use FastLED on an RPi. But back to topic.
I had the exact same issue, haven't used C++ for years, never was good in using its utilities and always struggles with its IDEs - and so I guess we four are all the same C++ newbies. But.. I got it working!

If you need to compile it by yourself without any IDE you need to add any(?) .cpp file by your own. So for the DemoReel100.cpp in the examples folder try following:
g++ DemoReel100.cpp ../PiLED.cpp ../FastLED/*.cpp -lwiringPi
The asterisk works as well. I guess you need to just add everything that way, the needed libraries or .cpp files and its location should be easy to find via Google, so I did.

Btw: An information on which version of FastLED it's based would be good. Would also make it easier to keep it up to date.

Best regards,
#Reaper

@ahettlin
Copy link
Owner

Great job figuring that out. Looks like a simple enough command too.

I haven't updated the FastLED code since my initial commit here, so It may be a bit out-of-date. I can check in the next few days to see if I can find what version I downloaded from their repository and add that info to the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants