lex/bison compiling error after ubuntu 18.04 upgrade - g++

I'm trying to start the next phase of my compiler project and I get this error when compiling
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
Makefile:82: recipe for target 'gpl' failed
i went back to previous phases, did a make clean and recompiled and none of it compiles now, same error (it did before). This happened after I upgraded to Ubuntu 18.04. I checked for further upgrades afterwords to see if any of the required packages needed an update and there's none. Does anyone have any idea why this stopped working after the update? (possibly config file or something?)

You can either link the static library (libfl.a) or use the --as-needed linker flag.

Related

Custom build command does not work with `cargo publish` because CMake says the path would exceed CMAKE_OBJECT_PATH_MAX

My project can be built and run locally, but when running cargo publish I get an error:
PS C:\Users\jonat\Projects\vulkano_blas> cargo publish
Updating crates.io index
Packaging vulkano_blas v0.1.0 (C:\Users\jonat\Projects\vulkano_blas)
Verifying vulkano_blas v0.1.0 (C:\Users\jonat\Projects\vulkano_blas)
Compiling autocfg v1.0.0
Compiling lazy_static v1.4.0
Compiling maybe-uninit v2.0.0
Compiling libc v0.2.73
Compiling cfg-if v0.1.10
Compiling cc v1.0.58
Compiling proc-macro2 v1.0.19
Compiling scopeguard v1.1.0
Compiling unicode-xid v0.2.1
Compiling syn v1.0.35
Compiling vulkano v0.19.0
Compiling either v1.5.3
Compiling smallvec v1.4.1
Compiling vk-sys v0.5.2
Compiling half v1.6.0
Compiling fnv v1.0.7
Compiling itertools v0.9.0
Compiling crossbeam-utils v0.7.2
Compiling memoffset v0.5.5
Compiling crossbeam-epoch v0.8.2
Compiling shared_library v0.1.9
Compiling cmake v0.1.44
Compiling quote v1.0.7
Compiling shaderc-sys v0.6.2
Compiling crossbeam-queue v0.2.3
Compiling crossbeam-channel v0.4.3
Compiling crossbeam-deque v0.7.3
Compiling crossbeam v0.7.3
The following warnings were emitted during compilation:
warning: System installed library not found. Falling back to build from source
error: failed to verify package tarball
Caused by:
failed to run custom build command for `shaderc-sys v0.6.2`
Middle part removed due to its size
--- stderr
CMake Warning in spirv-tools/source/reduce/CMakeLists.txt:
The object file directory
C:/Users/jonat/Projects/vulkano_blas/target/package/vulkano_blas-0.1.0/target/debug/build/shaderc-sys-81aff4f7b9007197/out/build/spirv-tools/source/reduce/CMakeFiles/SPIRV-Tools-reduce.dir/./
has 191 characters. The maximum full path to an object file is 250
characters (see CMAKE_OBJECT_PATH_MAX). Object file
remove_unreferenced_instruction_reduction_opportunity_finder.cpp.obj
cannot be safely placed under this directory. The build may not work
correctly.
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_ASM_COMPILER
CMAKE_ASM_FLAGS
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', C:\Users\jonat\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.44\src\lib.rs:885:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Where does the problem lie? And how could I approach fixing this?
As the error says, the path is too long for CMake / Windows.
You might try to enable Long Paths support in Windows, or put your project in a shallower path.
Building in a shallower directory worked for me:
#.cargo/config.toml
[build]
# fixes CMAKE_OBJECT_PATH_MAX
target-dir = "C:/temp/crate_name"
While this can also be done with a compiler flag, that is not recommended because cargo clean etc will not work as expected.
A side note, Ive had some runtime linker errors using this method with embuild and an esp32. The solution there was to move the entire repo closer to root and keep the default target dir, its a bummer but no two ways about it.

Make77 error while installing Darknet on Windows

I am facing the Make77 problem. Can somebody help me out?
mingw32-make
gcc -Iinclude/ -Isrc/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast obj/captcha.o obj/lsd.o obj/super.o obj/art.o obj/tag.o obj/cifar.o obj/go.o obj/rnn.o obj/segmenter.o obj/regressor.o obj/classifier.o obj/coco.o obj/yolo.o obj/detector.o obj/nightmare.o obj/instance-segmenter.o obj/darknet.o libdarknet.a -o darknet -lm -pthread libdarknet.a
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: obj/go.o:go.c:(.text+0x329f): undefined reference to `__WSAFDIsSet#8'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: obj/go.o:go.c:(.text+0x32e1): undefined reference to `select#20'
collect2.exe: error: ld returned 1 exit status
Makefile:77: recipe for target 'darknet' failed
mingw32-make: *** [darknet] Error 1
I was in your shoes a few weeks ago and managed to fix that.
I am confident, you are trying to compile the original repository of Darknet on a Windows machine.
Cause
Unfortunately, one of the libraries used in go.c is *nix-only. It has a counterpart in Windows called winsock.h, but apparently it is not enough and the problem still persists.
Solution
Instead what you should do is use another repo of Darknet which is ported to Windows properly and has a lot of support. It has exactly the same functionality as the original repo except for very little changes which only makes the framework better. Instead of compiling with make command, you should build it with Microsoft Visual Studio. You may go with the latest version of MVS. If you want to use a GPU and install correctly, make sure you follow the instructions here https://github.com/AlexeyAB/darknet#requirements . To avoid any weird errors, install the requirements in order.
When all requirements are installed, navigate to build/darknet and open darknet.sln. Switch to Release and x64 and build the project.
That should be it. If you have any issues, let me know so I can help you. Also, if this solution works for you, make sure to mark my reply as the best answer.

library not found for -lReact

I'm getting this error in all my app builds now and I can't seem to figure it out.
I am using the .xcworkspace file
I had to rename the app. Used: react-native-app-id ...
This morning I was able to build/run on emulator. I tried to setup xcode to run on an actual device and now the universe hates me.
I can't even react-native start and react-native run-ios without getting these errors:
ld: warning: directory not found for option '-L/Users/gmike/Projects/promiscue/tribeoffive/TribeOfFive/ios/build/Build/Products/Debug-iphonesimulator/React'
ld: library not found for -lReact
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/tribe-of-five.app/tribe-of-five normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/tribe-of-five.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/tribe-of-five.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I've checked out a bunch of other stackoverflow articles.
I think this is telling:
Thoughts on how to un-mess up my env?
The error goes away when you remove libReact.a from the Xcode file tree (for me, it was under the Frameworks folder).
I also removed other files (they all had a transparent/white overlay on them which probably mean they were missing, actually couldn't open them in the finder neither)
Ok let's resolve this:
What to look for:
Here's a list of all the sub projects (or their products) that will cause XCode to throw that error when building a react-native project w/ cocoapods:
[
RCTActionSheet,
ART,
RCTBlob,
RCTCameraRoll,
RCTGeolocation,
RCTImage,
RCTLinking,
RCTAnimation,
RCTNetwork,
RCTPushNotification,
RCTTest,
RCTSettings,
RCTText,
RCTVibration,
RCTWebSocket,
]
Where to look for those weird project names:
First of all you'll look in the actual error message.
Here's a typical library not found error
Notice the ... /libART.a part?
That fellow is causing that error on my end.
In your case it can be any of the strings in the array above.
Found the troublemaker, what to do now?
Step 1: Remove the troublemaker project.
Let's try the lucky shot first:
Open the Project Navigator, and check if you can see the linked project that corresponds to the troublemaker string. In my case it was an XCode project called ART.
If you find it there, just remove it's reference, and you should be fine.
If that didn't work:
Open {Project Target} > Build Phases > Link binary with libraries and check wether you can see the troublemaker string in there. (It could be something like libArt.a depending on what's causing the issue on your end)
If that worked, forget the next step, otherwise move on:
Step 2: Delete the derived data directory, clean and rebuild
In my case (as seen in the raw error above) the derived data directory was /Users/sudoplz/Library/Developer/Xcode/DerivedData/MySuperApp-haxjchilyksewvdfcnnxwrulvyvy/Build/Products/Debug-iphonesimulator/
find yours in the error log, and delete it.
You can then clean XCode, shut it down, launch it again, and re-build.
Hopefully that should either fix the issue, or help you move on with fixing other stuff that may have gone wrong.
That's all folks.
Try to add that file to the libraries by finding libReact.a from the project, then clean and run Xcode.
or
Try to add libReact.a to your project "Build Phases" > Link binary with libraries, then clean and run Xcode.

CocoaFob - linker command failed with exit code 1

This is a weird error! I'm getting:
ld: framework not found CocoaFob
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've checked all my build settings - and they appear correct. CocoaFob.framework is in my Linked Frameworks and Libraries - showing healthy and black. For some reason though, the damned framework isn't found when I try to link. Does anyone have any ideas?
Once possible clue is that when I try to the cocoafob application ( from here: https://github.com/glebd/cocoafob ) I get exactly the same error. I'm using Xcode 8.2.1
Okay. So the solution for me (and hopefully this will help anyone else who's experiencing a similar problem) was to:
build CocoaFob as release (I'd already done this, but in the interests of completeness) copy the resultant built framework to /Library/Frameworks and use it from there.
Do not attempt to use it in the location where it was built! Neither should you create a symlink in /Library/Frameworks to the location where it was built.
This done, all works well. Phew!

Tensorflow on Raspberry Pi 3 make error

I have been attempting a fresh install of Tensorflow on my Raspberry Pi 3 and have been running into an issue I can't solve.
I am following the guide here and have been able to complete all of the steps up until the make -f tensorflow/contrib/makefile/Makefile HOST_OS=PI TARGET=PI OPTFLAGS="-Os" CXX=g++-4.8 command.
However when attempting to run this command I am left with several errors.
The full output is rather long, but the main recurring error is similar to:
test_log.pb.cc:(.text+0x784): undefined reference to `google::protobuf::internal::fixed_address_empty_string'
This kind of error is repeated several times throughout the output for the make -f command with test_log.pb.cc:(.text+0x784): being replaced with different designations. The output ends with the Following error state:
step_stats_collector.cc:(.text+0x46c): undefined reference to `google::protobuf::internal::fixed_address_empty_string'
/home/pi/makevoicedemo/tf/tensorflow/tensorflow/contrib/makefile/gen/lib/libtensorflow-core.a(debug_io_utils.o):debug_io_utils.cc:(.text+0x8e8): more undefined references to `google::protobuf::internal::fixed_address_empty_string' follow
collect2: error: ld returned 1 exit status
tensorflow/contrib/makefile/Makefile:501: recipe for target '/home/pi/makevoicedemo/tf/tensorflow/tensorflow/contrib/makefile/gen/bin/benchmark' failed
make: *** [/home/pi/makevoicedemo/tf/tensorflow/tensorflow/contrib/makefile/gen/bin/benchmark] Error 1
I feel like the problem is likely do to an error with protobuf, however I am using the latest version and had no errors installing it. I am using the most recent version of tensorflow and followed the Before you start section in the guide to make sure all dependencies were installed and up to date.
What exactly might be causing this error and how would I go about fixing it?