Restore build on Linux, Mac OS
BradyBrenot opened this issue · comments
NB to others who are trying to build Huestacean on Linux / Mac OS
Huestacean in Master currently doesn't build on any platform but Windows because I'm working on a rewrite on the Master branch directly. Please use tag v2.6 for now.
I don't intend to take PRs against 2.6 any longer, hence my not making a keeping a branch going for it.
Added a 100$ bounty in bountysource: https://www.bountysource.com/issues/73426604-restore-build-on-linux-mac-os
I know it's not much, but maybe it helps getting the project going again.
I started working on this on my fork: https://github.com/jglauche/huestacean
I can get it compiled now with the exception of adding an #ifdef _WIN32 on the ::LoadLibrary part of chroma.cpp. This is windows specific and I need help refactoring this.
The thing I got stuck with is the linker.
[100%] Linking CXX executable huestacean /usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../lib/Scrt1.o: in function _start': (.text+0x24): undefined reference to main' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/huestacean.dir/build.make:115: huestacean] Error 1 make[1]: *** [CMakeFiles/Makefile2:804: CMakeFiles/huestacean.dir/all] Error 2 make: *** [Makefile:161: all] Error 2
I'm currently lost at what causes it and my brain needs a pause from solving this puzzle.
Fun fact (I just stumbled upon this by complete accident and was curious, I have absolutely none of the necessary equipment to do a physical test for this program 😅😅): on my machine (Arch Linux, x86_64), adding set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -shared")
to @jglauche's fork as per https://stackoverflow.com/questions/11116399/crt1-o-in-function-start-undefined-reference-to-main-in-linux leads in both cases to a successful link, but an immediate segfault, no warnings from ld
(unlike the accepted solution)...
Not sure if this is of any use to anyone, but this is my 2 cents, might be useful to check this idea, I might continue digging later
@chilledfrogs I also tried to link it with -shared, it also segfaulted for me.