Cross compiling: link to libx11 - opengl

I am cross compiling an application that uses an OpenGL based library on a x86_64 host for an ARM system.
This OpenGL based library is linked to libx11. The build step is successful.
But at runtime I get the following error:
symbol lookup error: /home/ex/temp/lib64/libOpenglRendx.so: undefined symbol: XOpenDisplay
When building and running for x86_64, this works properly.
My guess is that somehow it fails to dynamically load the x11 library when running on the ARM platform.
Any idea what I can do to fix this?

Related

Cross compile OpenCV for a RaspberryPI

i've been trying to make an application that combines Qt and OpenCV, and then deploy this application on a RaspberryPi.
i managed to cross compile Qt to run applications i built on my host machine on the RaspberryPi but whenever i want to use OpenCV with it, i fail to get to work. The first time i had incompatible libraries with ARM (they were x86-64) and now when i installed ARM version of OpenCV i get this error in Qt Creator (cannot find -lm).
Can u please tell me how to cross compile OpenCV as well ? Thank you

ld warning in mac terminal using skm and c++ compiler

I’ve been getting this warning when using the Mac terminal and skm library to compile a simple hello world program in C++. I’m new to this so not really sure what to do.
ld: warning: dylib (/Users/chriscommon/.splashkit/lib/macos/libSplashKit.dylib) was built for newer macOS version (10.15.4) than being linked (10.15)
ld: warning: object file (/Users/chriscommon/.splashkit/clang++/lib/macos/libSplashKitCpp.a(splashkit.cpp.o)) was built for newer macOS version (10.15.4) than being linked (10.15)
ld: warning: object file (/Users/chriscommon/.splashkit/clang++/lib/macos/libSplashKitCpp.a(adapter_type_mapper.cpp.o)) was built for newer macOS version (10.15.4) than being linked (10.15)
Does anyone know if there is some way I can resolve this so it links to the correct version? I’m running macOS10.15.7 and have tried to update skm, reinstall Xcode command line tools etc and the program works ultimately but the warnings appear each time I compile.
Try to add this flag to Xcode when you build your program:
-mmacosx-version-min=11.0

Cross-compiling c++ project using CMake for AARCH64 Ubuntu system

The current issue I am experiencing is setting up CMAKE for cross-compiling for the AARCH64 environment. The C++ project does reference some other third party libraries such as boost for its compiling.
I have read the documentation, but it is not really clear on the step-by-step procedure on what needs to be done in order to cross-compile using CMAKE for aarch64 on a x86_64 environment.
I have read that I need the rootfs of the aarch64 system, others it states I dont need it and only need the c++ compiler and cross headers/libraries.
At the current moment I am trying to compile the project on a Mustang board. But it runs in to issues with referencing the installed libraries for the x86_64 system.
If there is a person or site that could detail setup by step what would need to be done to this environment in order to get the entire project to cross-compile for aarch64 on a x86_64 system. I would greatly appreciate it.

Stanford Engineering Everywhere CS106B C++ Libraries in XCode 4.6.2

Like many others, I'm taking the CS106B class on iTunes and, although the class is old, I am attempting to use the Stanford C++ libraries that are current. They are found here: http://www.stanford.edu/class/cs106b/.
During the Build Phase of projects, I have inserted into "Link Binary with Libraries" the files "random.h" and "libStanfordCPPlib.a". When I do this, I get the following error messages:
Check dependencies
warning: skipping file '/Users/lewis/Documents/Think Like a Programmer/CS106/VotingSimulation/../../../Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/random.h' (unexpected file type 'sourcecode.c.h' in Frameworks & Libraries build phase)
ld: warning: ignoring file /Users/lewis/Documents/Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/libStanfordCPPLib.a, file was built for archive which is not the architecture being linked (x86_64): /Users/lewis/Documents/Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/libStanfordCPPLib.a
Undefined symbols for architecture x86_64:
"randomChance(double)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am using Mac OS X 10.7.5 and XCode 4.6.2. I have set the Build Settings Base SDK to OS X 10.7 for both the Project and the Target.
It appears to me that the "libStanfordCPPlib.a" file may be an archive file that I have to unarchive before I can link the implementation code for the header files. Is this what I need to do, and if so, how do I do it? Am I doing something else wrong in linking the files?
I'm a noob and I'd appreciate help from anyone who has been successful in getting the current Stanford CS106B C++ libraries to work in XCode 4.6.2.
I just ran into this problem myself after upgrading to the newest version of xcode (ver. 5.0, OSX ver. 10.8.5).
Try switching the architecture of the project to 32-bit Intel (i386). The default is "Standard Architectures 64-bit Intel (x86_64)".
I'm currently using xcode 6.4 and trying to work through the cs 106b course work, I had the same issue of not being able to run the sample files and assignment files (can be found here btw http://web.stanford.edu/class/archive/cs/cs106b/cs106b.1136/ ). After changing the Architectures for both the Project and Target to 32-bit-intel as listed above I still received errors. I had to take the additional step of changing the OSX deployment target from 10.10 to 10.8 under the Project info.
This allowed the program to build but I received a notification that i needed to install the Java Runtime Environment, and there was no consult output. Installing this did not resolve the issue. I was only able to fully execute the code after installing the Java Development Kit. I am now able to compile all files for the course.
I hope this update helps more recent attempts to access this info.
I hope you've found an answer to your problem by now, but as I was suffering from a similar problem, trying to get xcode 5.1 to compile Warmup.cpp, I thought I'd post my solution for those others trying to get xcode to work with the cs106b libraries.
After struggling with xcode 5.1.1 and 5.0.2, I downloaded xcode 4.6.3 off of the apple dev site, www.developer.apple.com, and trashed the later versions. After installing 4.6.3, I still got errors, but after switching the Architecures for the Project and for the Target, to "32-bit-Intel", as messysaurus suggests, the warmupp.cpp compiled fine. Trying this same technique with xcode 5.1.1 and 5.0.2 yielded no results.
Hope this helps anyone else running into problems.

strlen runtime error on Ubuntu

I develop a CGI C++ application that I compiled under Debian. Running this app on an Ubuntu system I am getting the error:
relocation error: /lib32/libresolv.so.2: symbol strlen, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
What can I do now? Should I recomile on the Ubunto system? Can I replace a library?
Edit
I link my application with -static.
Running the command ldd --version on the Ubuntu system showed my that EGLIB is used there.
What this error means is that your program was compiled/linked against an older version of GNU libc, which is not supported on the system where you want to run your executable.
You have few options to solve it:
Make sure you use the same or compatible version of libc when compiling and running.
Link against a static runtime.
Install older version of libc on Ubuntu system to match the Debian's environment.