I am still new to C programming, but I think that I can handle all major parts of it as pointers, functions, arrays... . Now I am looking forward for GUI programming. I want something that can handle crossplatform. So I decided to go for GTK+. I found this on their website:
First, make sure that your system meets the requirements as mentioned above, then download and run the installation script (gtk-osx-build-setup.sh). If your application already has a module, everything you need to build your application is handled by jhbuild. The build page has detailed instructions.
So my system meets the requirements. I have downloaded the file.I opened up my terminal and wrote:
sh gtk-osx-build-setup.sh
My terminal returned:
Checking out jhbuild (7c8d34736c3804) from git...
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Deleted branch stable (was 7c8d347).
Already up-to-date.
Switched to a new branch 'stable'
Installing jhbuild...
-n WARNING: aclocal not available (usually part of package 'autoconf')
-n WARNING: automake not available (usually part of package 'automake')
-n WARNING: autopoint not available (usually part of package 'gettext')
-n WARNING: pkg-config not available (usually part of package 'pkgconfig')
-n WARNING: yelp-tools not available (usually part of package 'yelp-tools')
-n Configuring jhbuild without autotools
-n Now type `make' to compile jhbuild
Installing jhbuild configuration...
Installing gtk-osx moduleset files...
PATH does not contain /Users/myname/.local/bin, it is recommended that you add that.
Done.
What should I do know guys? Please help!
I was also trying to do all in one bundle... So i went to the directory wich i downloaded. And than run make install. I should type something more than make install or it is everything?
Related
Sure, I've "chosen the wrong OS," Fedora instead of RHEL or CentOS, but I am where I am and there's no rtmp module in the standard distribution of nginx for Fedora since both RHEL and CentOS DO have the rtmp module available as a standard package.
So, I downloaded the source and did a build. While the call make install does the build (and I didn't see any errors in the 817 lines of output), it DOES NOT do the installation?!
At first I went down the wrong garden path, which is not totally wrong (see below as "Part II") but while writing "Part II" for this posting, I realized that I can't even find ANY evidence that it compiled ANY of the source for the rtmp module?! I followed the directions in the module's github readme file.
Of course, I kept a log of the run - too long to post here.
Having decades of coding experience I knew to check for a Makefile for that code and didn't find any?! STRANGE, right?
If anyone asks for info from that log, I have it and will provide it, but IDK what you may want to see from it.
Part II
I figured the installation didn't happen because the source code is written generically and doesn't pay any attention to the OS it's being installed on, and that's what "packaging" is all about and what package maintainers have to deal with...
I don't really have time to learn ALL the ins and outs of these packages, but I do know that the standard nginx packages provide these modules:
usr/lib64/nginx/modules/ngx_http_perl_module.so
usr/lib64/nginx/modules/ngx_http_image_filter_module.so
usr/lib64/nginx/modules/ngx_mail_module.so
usr/lib64/nginx/modules/ngx_http_naxsi_module.so
usr/lib64/nginx/modules/ngx_stream_module.so
usr/lib64/nginx/modules/ngx_http_xslt_filter_module.so
usr/lib64/nginx/modules/ngx_http_vhost_traffic_status_module.so
However, I don't see the compilation creating ANY .so files, much less moving them where they go on Fedora (the default is apparently /etc/nginx/modules). Further, the log output directed me to look to /usr/local/nginx, and there no .o or .so files at all but rather a single binary. That's fine, but doesn't help me, I presume, unless I want to screw around with moving files from where they're "expected" from the OS vs nginx point's of view and that sounds to me like a time-sink of massive proportions.
However, this IS a one-off installation at the moment and I'd rather not have a lot of pain whenever this box (and likely others to follow if this works) needs an upgrade. So, I found this gem of a blog posting. It touches on this problem but also seems rather involved as I don't fully grock it yet.
If I could simply learn how to build the correct file, which I presume is intended to be (once installed):
/usr/lib64/nginx/modules/ngx_rtmp_module.so
...from the .c source files, then I'm pretty sure I could "figure it out from there."
(Another possibility might be to find a way to prove from some sort of analysis that the GetPageSpeed people didn't alter the source when providing their package. Or, perhaps I could convince the package maintainer to include the rtmp package in with the standard packages available for Fedora, but, well, at best that's a long wait.)
It turns out that the build from source skips the .o and .so file stages and just builds an executable.
It's not set up for running in the normal, modern Fedora environment, however, as already noted above.
Not finding another answer and wanting to move on to other things, I simply got this from-source version working and it wasn't that hard. Note that this presumes you've installed the standard nginx package(s), which in this case hook in your man pages, systemd interfaces and so on so you can manage it as usual. In your favorite shell, as root:
# First, for my own sanity:
#
cd /etc
mv nginx nginx.from_FC_distro
ln -s /usr/local/nginx
cd /usr/local/nginx/logs
mv error.log error.log.orig
ln -s /var/log/nginx/error.log
#
# Now, get it to run and STAY running:
#
cd /usr/sbin
mv nginx nginx.from_FC_Distro
# Then EITHER this:
cp -p /usr/local/nginx/sbin/nginx /usr/sbin/nginx.from_src
ln -s nginx.from_src nginx
# OR this:
ln -s /usr/local/nginx/sbin/nginx
# Either vi or the echo works:
# vi /etc/nginx/conf/nginx.conf
echo "pid /run/nginx.pid;" >> /etc/nginx/conf/nginx.conf
#
# Finally:
systemctl enable nginx.service
systemctl start nginx.service
And now you have a running installation of the nginx server with whatever config you set up in the config file WITH the rtmp service! AND, you can manage it as usual. Upgrades aren't so hard, either, just don't bother with upgrading the nginx package the usual way. I'm sure the script-kiddies can figure out how to script it based on this article.
I need to backup iphone with libimobiledevice, using ubuntu, the device is detected but going to launch the backup commands the following error is displayed:
Started "com.apple.mobilebackup2" service on port 49343.
Could not perform backup protocol version exchange, error code -1
What could it depend on?
Several Github issues have reported this problem, like this one.
Solution:
you need to use latest version of idevicebackup and libimobiledevice
Indeed, if you use Ubuntu 20.04 (for instance), the libimobiledevice package is outdated, as of now.
If that's your case, you'll have to either wait for the next Ubuntu release (22.04) or compile it from source, what may become necessary at some point after the release of Ubuntu 22.04 anyway.
Disclaimer: downside of compiling yourself is that your binaries are not managed by the package manager. You'll have to update yourself, git pulling or downloading the newest source code releases and re-compiling everything everytime. You might have to redo all of this after a distribution upgrade. Upside is that your binaries do work...
Note: compilation steps are described on the official site only for debian; I could perform them equally well on a Linux Mint 20.3 (based on Ubuntu, based on debian). OP does not mention the OS he or she uses, but debian based seem to be the only ones available for now, so what follows should work on debian based OSes.
Compilation from source, step by step:
uninstall the official package and its dependencies and:
install the build dependencies: sudo apt install build-essential checkinstall git autoconf automake libtool-bin libplist-dev libusbmuxd-dev libssl-dev usbmuxd (see "from source" here)
get libimobiledevice source code from its repo, using for instance git clone https://github.com/libimobiledevice/libimobiledevice.git. You might get to the releases page and use the latest tar.gz instead (1.3 at the moment).
also get source code of other libraries required by libimobiledevice: libplist, libimobiledevice-glue and libusbmuxd. (I also compiled usbmuxd instead of using the official package, but I am not sure it is necessary). For each one of them, you can git clone it or download and untar the latest source code release, if available.
choose a prefix directory, where libraries and binaries will go. Create it if necessary (official libimobiledevice site suggests /opt/local and I will use this too in the next steps; in order for the compilation to work, you'll have to sudo mkdir /opt/local and export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig before starting the first compilation)
to compile and install, cd to the root of each git-cloned (or source-downloaded) directory (in this order: lipblist, libimobiledevice-glue, libusbmuxd and libimobiledevice, because each one depends on the previous one) and execute, in each one of them: ./autogen.sh --prefix=/opt/local, then make and finally sudo make install. (Note, the autogen line for libimobiledevice may be ./autogen.sh --prefix=/opt/local --enable-debug, as suggested here).
Having done all of this, the iphone was not mounted automatically, I had to manually run idevicepair pair and then could mount it using ifuse ./iphone_mount_point/ (do sudo apt install ifuse if necessary) and perform a backup using idevicebackup2 backup --full iphone_backup/. Read the help of idevicebackup2 for more information.
So I've upgraded to a newer version of Linux kernel using Yocto. The new kernel version is for 4.1.15 and runs on an iMX6 chip. I've also included openssh-server, tools-sdk, and tools-debug for development recipes. The problem is that when I connect to build I get the following error:
loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof
(_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))'
failed
Now if I type into the command prompt sh -c "LANG=en_US" I get the same error as above. If I type in sh -c "LANG=/usr/lib/locale/en_US" then I do not get an error. When I type locale everything is listed as POSIX and when I type locale -a I get:
C
POSIX
en_GB
en_US
The last two are stored under /usr/lib/locale. My version of gcc is 5.2 and my glibc is v2.22. I've looked all over the internet for other solutions but they are either for Ubuntu where the package manager comes in handy or it's some really specific fix like editing a file that I don't have in my Yocto build.
Edit:
The machine is for a SMARC-FiMX6 SoM and the instructions are here. I'm not sure what branch of Yocto is being pulled down.
After troubleshooting the problem is from the glibc library. A patch, #114739, is on the openembedded website which details what to do to fix this issue. Just patch the file, rebuild, and the issue is fixed. See here for details, the patch is at the bottom of the page.
I'm new to macports, and I'm really lost. I am trying to download PSPP (statistical software) via the GNU open software project using MacPorts, and installation completed without hiccups but I do not know how to proceed. How do I configure the application I just installed? Also, how do I get it to start up at automatically at boot?
I know this is a basic question, but I'd really appreciate the help! The MacPort QuickStart help questions are very confusing to me. Thanks!
The real question here is how to start the application. This largely depends on the application you installed, so PSPP in your case. Consult the documentation of PSPP (e.g. on their Website) to learn more.
In most cases, software installs a number of executables that you should run to start it. You can get a list of all files installed by PSPP using MacPorts by running
$> port contents pspp
Since this list will likely be huge, you can limit it to the locations where executables are usually installed:
$> port contents pspp | grep -E '/s?bin/'
For the PSPP port, it seems MacPorts also creates an .app wrapper. Check for /Applications/MacPorts/ – there should be a PSPP.app there.
I am a begineer trying to get code in C. I am working on a Mac and using xcode. My only past experience has been with java using eclipse and everything was pretty straight forward. I have almost no experience with terminal.
I am required to learn a bit of C for a project I will be working on and the learning of syntax is coming along okay, but I am at a point where I need to include some libraries in my c program. Specifically I am attempting to make plots with gnuplots.
I have downloaded gnuplot-4.6.3 from their repository and I do not even know how to install the files. I have been looking around and have tried using terminal to use the ./configure command when I am in the gnuplot-4.6.3 directory. But I really don't know what I am doing so I don't even know where to go next or what to do next.
Sorry if this is so trivial, I honestly just have never done this before and I cannot find a good tutorial on what to do.
Thanks for any help you can offer.
I would recommend using MacPorts for installing third-party tools and libraries. It knows the dependencies required and will install them as part of the installation.
Download it from macports.org.
Install it, and allow it to modify your ~/.profile so that /opt/local/bin is in your $PATH (any issue then just do export PATH=/opt/local/bin:$PATH from the command line).
sudo port selfupdate
sudo port install gnuplot
Now that will install the library into /opt/local/lib with the include files in /opt/local/include, so now just add that library to your Xcode project. Select the target and in the Build Phases tab open up the Link Binary With Libraries and press the + button and select Add Other. Now find /opt/local/lib/libgnuplot.a (I am assuming that's what it's called; I don't have it installed my self):
Now add /opt/local/include to your Header Search Paths so the compiler can find the gnuplot header files. Select the target and in Build Setting type in "header search" in the search box. Now double-click on the Header Search Path in the target column (or the project column to the right) and add /opt/local/include:
It's fine! You're learning then! Keep up! When I hit this kind of problem you may want to learn about the basis for linux gcc/g++ compilation and linking processes. Then you should learn Cmake and Automake, which are basically packages to configure projects before compiling building.
A typical (good) project in Unix systems build with commands
./configure
make
sudo make install
or
cmake CMakelists.txt
make all
sudo make install
That's what you need to do after downloading a source tarball online to install unix programs.
Now since you are using Mac, there are so-called package installers, one which is macports and homebrew. I personally suggest homebrew than macports here (I've tried both, although macports still outnumber homebrew with the number of repos, homebrew has the newest support, especially when upgrading to a new OS). So to install homebrew you can do
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Execute that in your terminal (see http://brew.sh/) for more information.
Then you could simply install GNUplot by
brew install gnuplot