Protues can't build file asm to HEX on Protues [Error make 2 ] process_begin: CreateProcess - proteus

The problem 2
I'm trying to install GCC to fix that but that's not a problem. Another way I try to add MinGW the PATH to the environment so it's not working. Install any version have the same problem.

Related

Homebrew Mac M1 can't find installs

I just switched to a M1 MacBook Air and I'm having trouble with Homebrew. The installation went fine I think, and then I added it to my path with the given commands:
Run these two commands in your terminal to add Homebrew to your PATH:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/xxx/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
I also did brew install cunit and then when I typed brew list CUnit was listed there so I'm assuming the brew install of cunit worked.
But when I run my C test code this is what I get:
test/test.c:3:10: fatal error: 'CUnit/Basic.h' file not found
#include <CUnit/Basic.h>
^~~~~~~~~~~~~~~
1 error generated.
make: *** [test_compile] Error 1
I have been sitting with this for three days, called Apple support, searched every page related to this and still can't find a solution that works.
Has anyone had the same problem? PLEASE help
Homebrew installs into /opt/homebrew by default on M1 Macs, and no longer links into /usr/local by default (to prevent clashes with Rosetta library installs). This means that include files and libraries can't be found without explicitly telling the compiler/linker where your Homebrew packages are installed.
The easiest way of doing this is by setting the CPATH environmental variable before compiling:
export CPATH=/opt/homebrew/include
Add the above line to your shell profile (.zprofile for zsh, or .bash_profile for bash) and it will be used in all future compilations.
For dependencies which also require shared libraries, you will need to also signpost the location of Homebrew's new lib path:
export LIBRARY_PATH=/opt/homebrew/lib

Compiling through macOS Terminal, fatal error: stdio.h: No such file or directory

So was trying to compile a c file (via a makefile) and got the "fatal error: stdio.h: No such file or directory" . This compiles on just fine via cygwin and a remote linux box just not my mac (so the files are okay).
I have installed the mac command line tools as mentioned in this question. When I do gcc --version I am getting 5.3 but if i do brew info gcc i get 8.2. When I do a find through terminal I can the file, so not sure what is up.
If you run:
which gcc
you will get /usr/bin/gcc which is the compiler supplied by Apple as part of macOS.
Presumably, since you mention homebrew, you mean to use the compiler installed by homebrew. So, you need to look in /usr/local/bin and see what homebrew has installed:
ls -l /usr/local/bin/gcc*
lrwxr-xr-x 1 mark admin 29 17 Sep 10:53 /usr/local/bin/gcc-8 -> ../Cellar/gcc/8.2.0/bin/gcc-8
So, the answer to your question is:
firstly, you need to have /usr/local/bin at the start of your PATH, and
secondly, you need to use the following command to compile:
gcc-8 main.c -o main
try running following:
xcode-select --install
See:
GCC fatal error: stdio.h: No such file or directory
for details.
With Mojave and XCODE 10, the problem is that the "include" folder is no longer automatically included when you install the command line tools. Instead, you need to do an "open" on /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
That solved the identical problem for me, anyway.
I ran into this issue and this is how I resolved it.
softwareupdate --all --install --force
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Basically developer framework is likely to be broken. But simply running xcode-select --install may not work because it will say the xcode developer tools are already installed (despite its broken status). So I had to completely wipe out any existing installation and install the developer framework again.
FYI if everything is installed correctly, the header files should be found at:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

Struggling to get PortAudio to Work with MinGW

I have the MinGW install previously working fine with MSYS. They are installed properly and functioning just well.
I installed the PortAudio library and did the install and got the success message after:
./configure
make
make install
When I try to compile samples:
c:\c>gcc patest_mono.c -o pa.exe
patest_mono.c:50:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
I'm new. I have a feeling I might be doing something fundamentally wrong with the way I'm trying to create the exe from compiling. It's been somewhat of a puzzle quest so far, but I've tried to figure it out and think I am close but completely missing something.
PATH variable ?
In the PortAudio MinGW build instructions I noticed
"The above should create a working version though you might want to
provide '–prefix=<path-to-install-dir>' to configure. "
I've tried adding C:\MingW\PortAudio into the user path. Doesn't work.
I've also tried running the commands in Bash and they come back with an error message "No Rule to make target 'paexpink'" either with the make command, and with gcc .c -o .exe I just get the same error message as compiling straight from the cmd prompt.
I found another source on stack overflow thread with no answers, but the user had commented that http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio provided them a solution but I tried installing the 5 cpython binaries and under the assumption I did it right, it didn't work either.
Thanks for your help,
Julian
To build and install portaudio, you need to add -prefix=/c/<"path to base of the MinGW directory"> to the ./configure line.
For example: ./configure -prefix=/c/MinGW/
then continue the installation by doing
make
After that, do the
make install
and that should install the portaudio files into MinGW.
After it has finished installing, you need to add -lportaudio to the compile command whenever you compile any programs that you want to use PortAudio in.
For example: gcc -o test test.c -lportaudio
I just figured out how to do this today, so I may have accidentally forgotten a few steps.

How to handle problems with RPATH on Mac OS X while installing cmocka?

I am trying to install and run cmocka library for unit testing on Mac OSX Yosemite 10.10.3, but I've got some problems with the RPATH settings.
Update:
Thanks to #baf, I was able to include cmocka.h in my CMakeLists.txt manually like this:
set(CMAKE_C_FLAGS_DEBUG "-I/usr/local/include/cmocka.h")
However, why is it so that I have to do it manually?
I've already tried many different ways of installing it:
What I've done so far:
Download cmocka from here: here. Version 1.0.
tar xvf cmocka-1.0.1.tar.xz
cd cmocka-1.0.1, mkdir build and cd build
sudo cmake ..
I get a message like this here:
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
cmocka_shared
This warning is for project developers. Use -Wno-dev to suppress it.
Question #1: How can I set the rpath so that there is no warning like the one above?
sudo make
sudo make install
cmocka should be installed now, right?
Running cmake for my program which is using cmocka library.
So now I run cmake for my program and my main CMakeList.txt file has lines like this:
find_library (CMOCKA cmocka)
if (NOT CMOCKA)
message (WARNING "Cmocka library not found.")
endif (NOT CMOCKA)
But the warning doesn't show up during this phase, so I believe that find_libarary(CMOCKA cmocka) has successfully located cmocka on my computer.
Running make for my program.
While running make I get an error like this:
fatal error:<br>
'cmocka.h' file not found<br>
#include <cmocka.h>
^
1 error generated.
So I guess that cmocka cannot be found...
Question #2: Why cmocka library cannot be found?
Additional notes:
I've tried running
$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
but it didn't helped. I guess it is a solution for Linux, not Mac.
I've tried to learn something about RAPTH on Mac in cmake from their official documentation here: http://www.cmake.org/Wiki/CMake_RPATH_handling. However I understood very little and I wasn't able to come up with a solution for my problem.
I've tried installing cmocka using brew but I got the same result.
Moreover, I've read many questions at SO about RPATH, linking and cmocka, but I couldn't find a suitable solution as well. Nevertheless, here is the list of related threads:
How to set the runtime path (-rpath) of an executable with gcc under Mac OSX?
https://stackoverflow.com/questions/29721183/getting-undefined-symbols-for-architecture-x86-64-when-trying-to-build-on-osx
How to configure scons to link using rpath on mac?
mariadb install failure: make (Mac OSX 10.6.8)
I've run otool -L cmocka. Here's what I got:
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file: cmocka (No such file or directory)
I was able to successfully compile my program (thanks to baf) when I added the -I/usr/local/include flag to my debug flags:
set(CMAKE_C_FLAGS_DEBUG "-std=gnu99 -Wall -pedantic -g -I/usr/local/include/cmocka.h")

"-bash: gcc: command not found" using cygwin when compiling c?

I just installed the latest version of Cygwin ans for some reason when I try to compile code, it always flashes me this error:
-bash: gcc: command not
I also don't seem to have the gcc.exe that people are referring to and when I try installing stuff like mingw as suggested by other forum answers, it always gives me this error that ti couldn't install the repository.txt.... Looking for help on this matter!
You can install gcc by running setup-x86.exe or setup-x86_64.exe again. The gcc package is in the Devel category:
Then you must go to System properties, System variables, and append the path to "C:\cygwin64\bin" in PATH
If you have already added the gcc package you want you may also need to setup a symbolic link to a different gcc.exe binary. For example:
$cd /usr/bin/
$ln -s i686-pc-cygwin-gcc.exe gcc
$which gcc
$/usr/bin/gcc
You can add the gcc package through the 'Add Package' batch file.
Related issue.
I received below error:
'g++' is not recognized as an internal or external command,
Did the below to resolve:
Downloaded & installed setup-x86_64.exe from https://cygwin.com/install.html
selected below:
gcc-g++: GNU Compiler Collection (C++)
make: The GNU version of the 'make' utility
gdb: The GNU Debugger
Appended ';C:\cygwin64\bin' to PATH environment variable
All errors are gone.
when selecting packages at installation or update search for 'gcc' in searchbox and select the boxes showing 'gcc' mostly found in devel package.
Try installing cygwin from a mirror you did not use earlier(preferably the first one). Some of the servers hold older versions of cygwin which have many problems. Also, search for gcc and install the devel package.
I had the same problem when I installed cygwin from the iitm mirror(closest to my home), and it got resolved when I reinstalled the whole thing from the cygwin mirror.

Resources