How to run gcc in pfsense terminal? - package

I need to run a javascript script in pfsense terminal but I don't know how to download the gcc nor node library to run it. And if I do don't know how to export the correct command to use the "gcc [command]" and "node [command]" without using the full path.
Is there anyone who can give me steps to download them, and make them usable without full path, cause I'm trying for months now and noone has helped me.
I've tried the normal way of "pkg install X" and drag&drop the library folder directly to the VM I use for the pfsense. I cant even download side package manager cause pfsense doesn't let me.

Related

What to install and how to run an executable file on Mac?

So I'm in terminal, and have a directory called CAPTURE on my desktop, I'm trying to run a program called 'testme'. I read that you need to have build-essential installed but I think that's only on Linux systems and I'm on a Mac so it wasn't necessary because it's already built in (I think). So, I navigated from ~ with:
cd Desktop/CAPTURE
Then, I tried running a bunch of different commands that I found while looking on the internet:
./testme
which returned zsh: exec format error: ./testme
xcode-select --install
which installed properly and I thought I could run the ./testme command but I got the same error as before. Then I tried navigating to the directory again and used
chmod +x ./testme
./testme
which also did not work. I've never run executables before so I really have no familiarity with these commands so they might be super wrong. If anyone can help me run the file properly, that would be much appreciated.
Since your question is tagged as C and Clang, and you are talking about build-essential, I will assume that you are attempting to build an application from source code.
Instead of build-essential, in macOS, you need Xcode. The Xcode CLI tools will work if the application is text-only or Curses, but you will need the entire Xcode IDE for any graphical application.
If running ./testme is telling you Executable format error is probably because it's a prebuilt executable, very likely a Linux ELF executable that will not run in macOS.
My suggestion is to try to build the software. Most C applications will build if you run make inside the directory. make is installed by default by Xcode. Other applications may need a third-party build system, such as CMake, but I do not know if that's the case.

C library problems installing

I am a beginner C programmer, and recently I have run into a problem that I was unable to solve.
I am struggling to install and use a C library. The message error is:
My OS is Mac OS X and im try install the file with ".command" format.
Can someone help me install this library?
Thanks in advance.
More than help installing the library, you need help in understanding what's going on.
Someone gave you a command to run and you ran it, but they were assuming that you were using a different OS, like Ubuntu.
The first message "apt-get not found" is because you're running MacOS, which doesn't have an "apt-get" command.
The second error is because you also don't have wget.
The rest of the messages indicate a poorly written script file, since it blew up twice and still went on to truncate files and do other things.
While you're not going to be able to install apt-get, you might be able to find a compatible version of wget. If not, you can download whatever it was trying to get using your browser, since wget is typically used to automate web HTTP/HTTPS requests.
Without seeing the file, I don't know what the rest if the script was trying to do, but if you read it you should be able to figure out what it was doing, and do it manually.
An easier way to do all this is to install Virtualbox on your mac and run a copy of Ubuntu inside a virtual machine. Then you can run your class assignments without needing to rewrite them all.

Ocamlfind: Package 'pprz.xlib' not found

I am currently trying to install a set of ocaml packages. However, I cannot seem to find any site that allows me to download the 'pprz.xlib' package. The problem is that I would like to install that package for an ubuntu OS but I can't use the terminal to download it because I don't have internet access on the ubuntu. Therefore, I have to download it on windows, and copy and paste the package in the appropriate file in my project (it's the paparazzi code UAV for what it's worth).
Anyway, I would be greatly appreciative for anyone who may direct me to a solution on how to install such a package.
Thank you

About linking files using Mac terminal

Okay here goes, I'm completely new at this, started learning the terminal just about 2 days ago. I'm slowly but surely getting the hang of it, now I'm stuck on this and I've been trying to fix it for a good hour. It's a rather simple question as I am a newby.
I have a C file in my desktop and a Header file in a folder in my desktop. I'm including that header in my C file. I have to link them (currently doing a tutorial, it tells me to link, but doesn't show me how).
You have a couple of options. First, you will need to install the software development environment - it's called Xcode. I think you can get it for free on the AppStore, if not Google it.
Then you need to decide if you want to develop and compile graphically in the Xcode Integrated Development Environment. If you do, start Xcode and create a new project and open your C file and change the "include path" to match the location of your header file. Then click "Build" and "Run"
If you want to do things at the commandline, you'll need to install "Xcode Command Line Tools" - Google it. That will give you a compiler. Then you can compile. I'm not certain which compiler you will get - it could be "llvm" or "gcc" or something else, but the command you are looking for will be something like:
gcc -o prog -I /path/to/HeaderFileFolder yoursourcecode.c
which will give you a program called "prog" that you can run by typing
./prog
You are likely confusing two different concepts. The "link" mentioned in the tutorial is probably talking about turning the compiled objects into a single executable. See http://www.cprogramming.com/compilingandlinking.html for an explanation of what linking means in this context.
What you've provided examples of doing is file system linking, which is totally unrelated.
Providing more details on the tutorial could help refine this answer.

Why do I get "Header file missing" (make error)?

I'm trying to install a geocoder for a website I'm building. I'm using Geocoder because the query limit for the Google Maps API falls short of my needs. I installed all the gems required and have SQLite3. When I'm actually trying to install the geocoder gem (Geocoder::US) I get an error while running the make file.
I'm getting an error I cannot figure out. It mentions the error (in the title) then talks of an non-existent file (sqlite3ext.h). Here is the error:
I know this is vague but I've been working for 10+ hours trying to install this and have found little help online. Any advice on which direction to go would be appreciated.
This is from the project's Readme:
To build Geocoder::US, you will need gcc/g++, make, bash or equivalent,
the standard *NIX ‘unzip’ utility, and the SQLite 3 executable and
development files installed on your system.
It seems that you lack the SQLite3 development headers.
This is relevant:
NOTE: If you do not have /usr/include/sqlite3ext.h installed, then
your sqlite3 binaries are probably not configured to support dynamic
extension loading. If not, you must compile and install SQLite from
source, or rebuild your system packages. This is not believed to be a
problem on Debian/Ubuntu, but is known to be a problem with Red
Hat/CentOS.
Also they do not mention Windows. You should:
Ask them if someone uses it on Windows and if there are instructions for that.
Evaluate the thing on Linux, Debian/Ubuntu especially.
-fPiC is not your problem. As the log states, the compiled code is already position independent. The problem is, that the sqllite3ext.h is not in the compiler include path.

Resources