https://github.com/arahaan/bin2c
bin2c Conversion Tool.
https://github.com/arahaan/bin2c
bin2c cpp17orlater linux macos windows
Last synced: about 2 months ago
JSON representation
bin2c Conversion Tool.
- Host: GitHub
- URL: https://github.com/arahaan/bin2c
- Owner: AraHaan
- License: mit
- Created: 2016-10-20T01:45:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-20T07:03:13.000Z (3 months ago)
- Last Synced: 2025-03-27T09:52:24.915Z (2 months ago)
- Topics: bin2c, cpp17orlater, linux, macos, windows
- Language: C++
- Homepage:
- Size: 101 MB
- Stars: 11
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[/badge.svg)](https://github.com/AraHaan/bin2c/actions)
[/badge.svg)](https://github.com/AraHaan/bin2c/actions)
[/badge.svg)](https://github.com/AraHaan/bin2c/actions)
[/badge.svg)](https://github.com/AraHaan/bin2c/actions)
[/badge.svg)](https://github.com/AraHaan/bin2c/actions)
[/badge.svg)](https://github.com/AraHaan/bin2c/actions)
[](https://www.codacy.com/app/AraHaan/bin2c?utm_source=github.com&utm_medium=referral&utm_content=AraHaan/bin2c&utm_campaign=Badge_Grade)
[](https://github.com/AraHaan/bin2c/watchers)
[](https://github.com/arahaan/bin2c/network)
[](https://github.com/arahaan/bin2c/releases)
[](https://github.com/arahaan/bin2c/stargazers)
[](https://raw.githubusercontent.com/weiboad/adbase/master/LICENSE)
[](https://bestpractices.coreinfrastructure.org/projects/778)
[](https://webchat.freenode.net/)> This program takes any sort of binary file (such as a PNG image file) and processes it into a file that contains its data in a C array allowing it to be embedded in the contents of a program.
The Channel is #bin2c on freenode so be sure to do ``/JOIN #bin2c`` on the main status part of freenode.
bin2c v0.15.0 - Windows/Linux/MAC - [FINAL]:
Windows (Requires Visual Studio 2015 or newer with command line tools):
- open bin2c.sln in Visual Studio 2015 or newer.
- select the configuration platform you want and Build the Release Configuration. You can pick 32 or 64 bit.
- then open the Developer Command Prompt x86 (for 32-bit compile) or x64 (for 64-bit compile).
- and then to build the tests create a batch file named compile.bat in the folder you downloaded bin2c to with this content:
```cmd
@echo off
cd tests
..\\Release\\bin2c.exe /custvar "IMAGE_VP" /nohead /infile ".\\VP.jpg" /outfile ".\\VP.hpp"
cl.exe /nologo /Ox /Tp "VP.cpp" /link /NOLOGO /OUT:"VP.exe" /SUBSYSTEM:CONSOLE /FIXED
cd ..
```- after the file is (compile.bat) created maximize the Developer command prompt(s) you opened and type in:
```cmd
cd path\to\where\you\downloaded\bin2c
path\to\where\you\downloaded\bin2c>compile.bat
```This *should* Generate working tests.
*Note: since v0.2.0 the generated output will contain the name of the original files.*
MAC:
- To build you need either gcc/g++ 6.3.0 (or latest) or clang 3.9.1 (or latest).
*Also you need latest libc++ and you also need libc++experimental. Both of which can be obtained from ``brew install llvm``.*
Update: Seems with the latest xcode or compilers on brew you do not need the libc++experimental nor link with ``-lstdc++fs`` on both gcc or clang (which on apple default on xcode is clang for the gcc). So to compile ensure you got a version of xcode compatible and is able to compile this. Minimum version is unknown atm.
*Note: Don't forget to use the rc file. (which might need some changes) This should hopefully allow you to have a resource section.*
*Also Since I do not work for apple nor do I even own a mac I do not know for sure how to compile an resoruce script on a mac for a .rsrc section on the compiled binary.*Linux:
- To build you need either gcc/g++ 6.3.0 (or latest) or clang 3.9.1 (or latest).
*I assume you have the libstdc++fs library for to work on most linux distributions.*