installing/accessing openGL on MacOSX Monterey - c

I am trying to compile an X11-based program to visualize atomic structures called v_sim on MacOSX Monterey (12.6) on a M1 Apple system. I am compiling the program using a command line environment and there is an option in the configure program to specify Apple's openGL framework "--with-apple-opengl-framework". The configure program stops, however, with the error
configure: error: "No 'GL/glx.h' header file."
How can I specify the location of this header file? There doesn't seem to be an option in the configure command to do so. There also does not seem to be header files in the Framework subdirectories. Any suggestions as to what to try next?

Related

C with Eclipse on Ubuntu: why is an .exe and no linux executable created?

I am using Neon.3 Release (4.6.3) Eclipse IDE for C/C++ Developers under Ubuntu 15.5. When I build an run my C-program the program
the program executes without any errors/warnings
delivers the expected output in the eclipse-console
and generates an .exe file in the the debug folder
For me it is very much surprising that an .exe file is generated using an Linux OS (I thought these files can only be created under Windows?). How can I configure Eclipse to generate a typical Linux-executable instead?
Many thanks!
Extensions don't matter much in Linux. You can name an executable something.exe and it won't change how it runs...

X264: How to compile x264 with swscale support?

Objective
I am trying to build:
an x264 static library (.lib) with swscale support. I would like to use this library in a Visual Studio project where 24-bit RGB bitmap images are:
Converted from RGB to YUV2
The converted image is sent to the x264 encoder
and the output of the encoder is streamed to a remote IP-endpoint via UDP.
an x264 executable (.exe) with swscale support. I would like to use the executable for the same purpose as described above. In another Visual Studio project, I will start the x264.exe up as a separate process and pipe bitmap data to the x264 process via its stdin and read out the encoded data from the process's stdout.
Problem
I am having some trouble figuring out how to compile with swscale support. I need swscale support for both the executable and the library.
Status
So far I have downloaded the latest x264 source from the x264 website.
I have installed MINGW on my machine and when I run 'configure' and 'make' I get the x264 static library - but without swscale support.
I haven't been able to find a detailed step-by-step guide on how to include swscale in the x264 library. The closest I've come to a description is this discussion:
http://forum.doom9.org/showthread.php?t=165350
So I downloaded libpack from:
http://komisar.gin.by/mingw/index.html
and extracted it to my harddrive:
Then I executed 'make' and 'configure' (again) in my x264 directory:
./configure --extra-cflags="-I/m/somePath/libpack/libpack/libpack/include" --extra-ldflags="-L/m/somePath/libpack/libpack/libpack/lib"
I have the following in the lib and include directory:
When I execute the above 'configure' I get:
platform: X86
system: WINDOWS
cli: yes
libx264: internal
shared: no
static: no
asm: yes
interlaced: yes
avs: avisynth
lavf: no
ffms: no
mp4: lsmash
gpl: yes
thread: win32
opencl: yes
filters: crop select_every
debug: no
gprof: no
strip: no
PIC: no
bit depth: 8
chroma format: all
You can run 'make' or 'make fprofiled' now.
bash.exe"-3.1$
When I execute 'make' I end up with this error:
gcc.exe: error: unrecognized command line option '-fomit-frame-poin'
gcc.exe: fatal error: no input files
compilation terminated.
make: *** [.depend] Error 1
bash.exe"-3.1$
Question
What am I doing wrong??
A couple of things I would point to:
MinGW can sometimes cause compilation issues (because of Windows-based compatibility requirements - I am not saying MinGW is not good). I try to compile on native UNIX system when ever possible.
ffmpeg has built in support for swscale. If you cannot find a way to fix your problem you may want to consider using ffmpeg with x264 support. How to compile here or use a static build.
ffmpeg libswscale source can be obtained here. You could want to download it and compile x264 with a configure pointing at it.
you can always check ./configure --help for more information
1) You can't build "an x264 static library (.lib) with swscale support" because they are separate libraries and should be used together in project not by building one in another. Also you can't build libx264 static library useable by MSVS unless you build with ICL because you will have a lot of problems trying to mix MinGW build libraries (.a) into MSVS projects. I will recommend to use shared library (.dll) in case you want to use libx264 in MSVS project. You can find how to build .lib for libx264.dll using Google.
2) To build x264 executable with swscale support you need to provide x264's configure with path to swscale library and headers which are part of ffmpeg/libav project and build with them.
As for problems while building with komisar's libpack. Your configure command line looks correct but it still didn't configured it with swscale (resize filter is missing from configure output). To find out reason you need to look into config.log file which is created by configure but most likely swscale was outdated (and don't have some API values used by x264) in libpack you used.
As for gcc.exe: error: unrecognized command line option '-fomit-frame-poin' I am dunno from where you get this wrong option because it should be -fomit-frame-pointer but you didn't posted full command line of gcc that resulted in error. May be you specified it somehow yourself (environment CFLAGS) or it is some truncation of command line (too long command line).

Not able to upload code on CC2538dk board from Ubuntu 12.04 command line

I have a CC2538dk board. I am using Ubuntu 12.04 and cloned Contiki repository from github. I was able to compile all the code in Contiki using make TARGET=cc2538dk hello-world, but I'm not able to upload the code to the CC2538dk board from command line.
The error I'm getting when I ran make TARGET=cc2538dk hello-world.upload is as below.
make: No rule to make target `hello-world.upload'. Stop.
I used to use TI's Uniflash tool (CCS_Uniflash v2.2) to upload the the .elf binary, but it is not available in Contiki.
There is no make target for uploading to CC2538dk boards. According to the documentation one should use TI's UniFlash.
I had success compiling the contiki examples on a separate computer, then using Code Compose Studio v 5.4 to import my binaries (ELF files) to an empty CC2538 project, then debug it from there in order to get it loaded onto the board. Definitely not ideal, but it works.
Setup:
Compile contiki source and examples from instantContiki
move the example directory, included blink.elf to windows machine with CCS 5.4 installed
make a new project in CCS, select Other Examples->Empty CC2538 Project
Import a C/C++ executable, then using the GNU Elf reader, select the blink.elf file you moved over
copy+paste the CC2538SF53.ccxml and the cx2538xf53_ccs.cmd to the new project, and try to debug using those configurations.
The reason this seems to work is that the xds100v3 drivers that come with the board's install disc and the uniflash tool don't seem to work right and just give me any number of errors. There's a black-magic-configuration-combination of the CCS 5.4 for Window's drivers/Other Example's CC2538SF53.ccxml that was the only way I was able to connect to the target.

Can not use gtk3 FileChooser on Mac OSX?

I migrated my program built with gtk+3.0 from linux to Mac OS X(10.6.8).
And I compiled the program without errors.
However, after I started the program and I chose to open a file, the terminal shows following message.
GLib-GIO-CRITICAL **: Settings schema 'org.gtk.Settings.FileChooser' is not installed
Then, the program ends with Segmentation fault.
How to solve it?
Thanks for any helps.
Seems you're not the one having this problem, and it also happens on Windows on MinGW. Luckily, that person gave a solution:
The thing, as it seems as I was running the test-widget example (that I
built with gtksourceview-3.0.0 using MSVC), was that I need to compile the
org.gtk.Settings.FileChooser.gschema.xml file (from GTK+-3.x, under
$(srcroot)/gtk) with the glib-compile-schemas utility that is from GLib,
which will generate gschemas.compiled in the same folder.
After that, place that gschemas.compiled file in the this folder:
$(parent_folder_of_the_gtk3_dll)\share\glib-2.0\schemas
and one will be set to use the gtkfilechooser without the puzzling
[GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser'
is not installed] error.
I will add to my GLib project files to compile the glib-compile-schemas
utility and add to my GTK+-3.x project files to compile the
the org.gtk.Settings.FileChooser.gschema.xml shortly.
I ran in to this problem with a program that I crosscompiled with mingw for windows, the solutions is to run glib-compile-schemas [path to org.gtk.Settings.FileChooser.gschema] in my case was that file in ./share/glib-2.0/schemas.It will generate gschemas.compiled, that is the file FileChooser is looking for.

How to build an iPhone static library based on a Makefile?

I have managed to build a static C library on OSX using make on the command line.
I have tried to use the same Makefile (with ARCHFLAGS=-arch armv6 -arch armv7) to build a static library for iOS, but it fails with:
gcc-4.2: error trying to exec '/usr/bin/arm-apple-darwin10-gcc-4.2.1': execvp: No such file or directory
I guess it is not working because I'm using the OSX SDK make instead of a some part of the iOS SDK. Any clues?
N.B. For more details on the library in question (levmar) and for the Makefile, please refer to this Stack Overflow answer.
You need to find:
the location of the iOS compiler
the command line options that are used in the command line invocation
The easiest way is to create a test iPhone/iPad app in XCode, build it, and then look at the build log to find how XCode invokes the compiler.
Can you just make an Xcode project and invoke Xcode on the command line or from a script? If you don't want the fuss of maintaining an Xcode project, an easier approach might be to use CMake to generate an Xcode project and then invoke Xcode on the command line or from a script. This way you can stay in the text-file and script domain the whole time.

Resources