Coder Social home page Coder Social logo

minilibx's Introduction

Minilibx

Build Status

This is a mirror of the minilibx library.

What is minilibx?

Minilibx is a very basic graphical library writting in C used in 42 (also exported in US in the Silicon Valley, see 42 US) and in Epitech for infography project such like fdf and Raytracer.

You can find a mirror to the native version for Mac OSX here.

Compile

  1. Add a variable named PKG_CONFIG_PATH containing the path to the minilibx directory.
  2. Compile and install with
make && sudo make install

Tutorials

Here some tutorials and articles (in French):

Related projects

Licence

Licence BSD: Copyright Olivier Crouzet - 2014

Minilibx

Ce dépot est un mirroir pour la librairie graphique minilibx.

Qu'est-ce que minilibx ?

Minilibx est une librairie graphique très basique écrite en C utilisée à 42 (aussi exporté aux USA dans la Silicon Valley, voir 42 US) et à Epitech

Vous pouvez trouver un mirroir pour la version native pour Mac OSX ici.

Compiler

  1. Ajouter une variable PKG_CONFIG_PATH contenant le chemin vers le dossier de la minilibx.
  2. Compilation and installation avec
make && sudo make install

Tutoriels

Ici des articles et des tutoriels (en français):

Projets connexes

License

License BSD: Copyright Olivier Crouzet - 2014

Original README

This is the MinilibX, a simple X-Window (X11R6) programming API in C, designed for students, suitable for X-beginners.

Contents

  • source code in C to create the mlx library
  • man pages (in man/ directory)
  • a test program (in test/ directory) is built with the library
  • a public include file mlx.h
  • a tiny configure script to generate an appropriate Makefile.gen

Requirements

  • MinilibX only support TrueColor visual type (8,15,16,24 or 32 bits depth)
  • clang
  • X11 include files
  • XShm extension must be present

Compile MinilibX

  • run ./configure or make both will make a few tests, create Makefile.gen and then automatically run make on this generated Makefile.gen . libmlx.a and libmlx_$(HOSTTYPE).a are created. test/mlx-test binary is also created.

Install MinilibX

  • no installation script is provided. You may want to install
    • libmlx.a and/or libmlx_$(HOSTTYPE).a in /usr/X11/lib or /usr/local/lib
    • mlx.h in /usr/X11/include or /usr/local/include
    • man/man3/mlx*.1 in /usr/X11/man/man3 or /usr/local/man/man3
  • or make DESTDIR=/usr/local install

Olivier CROUZET - 2014-01-06 -

minilibx's People

Contributors

ttshivhula avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

minilibx's Issues

Issue with minilibx

When i try to compile my project with the libary I get this error message:

./minilibx/libmlx.a(mlx_init.o): In function mlx_int_deal_shm': mlx_init.c:(.text+0x2c): undefined reference to XShmQueryVersion'
mlx_init.c:(.text+0x11c): undefined reference to XShmPixmapFormat' ./minilibx/libmlx.a(mlx_init.o): In function mlx_init':
mlx_init.c:(.text+0x14f): undefined reference to XOpenDisplay' mlx_init.c:(.text+0x2de): undefined reference to XCreateColormap'
./minilibx/libmlx.a(mlx_new_window.o): In function mlx_new_window': mlx_new_window.c:(.text+0x92): undefined reference to XCreateWindow'
mlx_new_window.c:(.text+0xbb): undefined reference to XStoreName' mlx_new_window.c:(.text+0xe6): undefined reference to XCreateGC'
mlx_new_window.c:(.text+0x113): undefined reference to XMapRaised' ./minilibx/libmlx.a(mlx_loop.o): In function mlx_loop':
mlx_loop.c:(.text+0x4b): undefined reference to XPending' mlx_loop.c:(.text+0x6a): undefined reference to XNextEvent'
./minilibx/libmlx.a(mlx_int_anti_resize_win.o): In function mlx_int_anti_resize_win': mlx_int_anti_resize_win.c:(.text+0x55): undefined reference to XGetWMNormalHints'
mlx_int_anti_resize_win.c:(.text+0x80): undefined reference to XSetWMNormalHints' ./minilibx/libmlx.a(mlx_int_wait_first_expose.o): In function mlx_int_wait_first_expose':
mlx_int_wait_first_expose.c:(.text+0x2e): undefined reference to XWindowEvent' mlx_int_wait_first_expose.c:(.text+0x39): undefined reference to XPutBackEvent'
./minilibx/libmlx.a(mlx_int_get_visual.o): In function mlx_int_get_visual': mlx_int_get_visual.c:(.text+0x61): undefined reference to XGetVisualInfo'
./minilibx/libmlx.a(mlx_new_image.o): In function mlx_int_new_xshm_image': mlx_new_image.c:(.text+0xa7): undefined reference to XShmCreateImage'
mlx_new_image.c:(.text+0x142): undefined reference to XSetErrorHandler' mlx_new_image.c:(.text+0x152): undefined reference to XShmAttach'
mlx_new_image.c:(.text+0x160): undefined reference to XSync' mlx_new_image.c:(.text+0x174): undefined reference to XSetErrorHandler'
mlx_new_image.c:(.text+0x1a0): undefined reference to XCreatePixmap' mlx_new_image.c:(.text+0x1d6): undefined reference to XSetErrorHandler'
mlx_new_image.c:(.text+0x214): undefined reference to XFlush' mlx_new_image.c:(.text+0x23d): undefined reference to XShmCreatePixmap'
./minilibx/libmlx.a(mlx_new_image.o): In function mlx_int_new_image': mlx_new_image.c:(.text+0x2c9): undefined reference to XCreateImage'
mlx_new_image.c:(.text+0x305): undefined reference to XCreatePixmap' mlx_new_image.c:(.text+0x324): undefined reference to XFlush'
./minilibx/libmlx.a(mlx_new_image.o): In function mlx_new_image': mlx_new_image.c:(.text+0x3fb): undefined reference to XCreateImage'
mlx_new_image.c:(.text+0x43a): undefined reference to XCreatePixmap' mlx_new_image.c:(.text+0x460): undefined reference to XFlush'
./minilibx/libmlx.a(mlx_new_image.o): In function mlx_new_image2': mlx_new_image.c:(.text+0x53b): undefined reference to XCreateImage'
mlx_new_image.c:(.text+0x57a): undefined reference to XCreatePixmap' mlx_new_image.c:(.text+0x5a0): undefined reference to XFlush'
./minilibx/libmlx.a(mlx_put_image_to_window.o): In function mlx_put_image_to_window': mlx_put_image_to_window.c:(.text+0x33): undefined reference to XSetClipOrigin'
mlx_put_image_to_window.c:(.text+0x6c): undefined reference to XCopyArea' mlx_put_image_to_window.c:(.text+0xd5): undefined reference to XPutImage'
mlx_put_image_to_window.c:(.text+0x113): undefined reference to XShmPutImage' mlx_put_image_to_window.c:(.text+0xb3): undefined reference to XFlush'
./minilibx/libmlx.a(mlx_clear_window.o): In function mlx_clear_window': mlx_clear_window.c:(.text+0xb): undefined reference to XClearWindow'
mlx_clear_window.c:(.text+0x25): undefined reference to XFlush' ./minilibx/libmlx.a(mlx_destroy_window.o): In function mlx_destroy_window':
mlx_destroy_window.c:(.text+0x6a): undefined reference to XDestroyWindow' mlx_destroy_window.c:(.text+0x77): undefined reference to XFreeGC'
mlx_destroy_window.c:(.text+0xd1): undefined reference to XFlush' ./minilibx/libmlx.a(mlx_int_param_event.o): In function mlx_int_param_KeyPress':
mlx_int_param_event.c:(.text+0x101): undefined reference to XkbKeycodeToKeysym' ./minilibx/libmlx.a(mlx_int_param_event.o): In function mlx_int_param_KeyRelease':
mlx_int_param_event.c:(.text+0x141): undefined reference to XkbKeycodeToKeysym' ./minilibx/libmlx.a(mlx_int_set_win_event_mask.o): In function mlx_int_set_win_event_mask':
mlx_int_set_win_event_mask.c:(.text+0x2e2): undefined reference to XChangeWindowAttributes' ./minilibx/libmlx.a(mlx_hook.o): In function mlx_do_key_autorepeatoff':
mlx_hook.c:(.text+0x24): undefined reference to XAutoRepeatOff' ./minilibx/libmlx.a(mlx_hook.o): In function mlx_do_key_autorepeaton':
mlx_hook.c:(.text+0x34): undefined reference to XAutoRepeatOn' ./minilibx/libmlx.a(mlx_hook.o): In function mlx_do_sync':
mlx_hook.c:(.text+0x46): undefined reference to `XSync'
collect2: error: ld returned 1 exit status

Issue with minilibx

Salut, j'ai suivis les instructions pour la minilibx sur ubuntu, mais quand j'éssaye de la compiler, voici ce que j'obtient dernierement:

Package libbsd was not found in the pkg-config search path.
Perhaps you should add the directory containing `libbsd.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libbsd', required by 'mlx', not found
gcc -o mlx-test main.o 
main.o : Dans la fonction « expose_win2 » :
main.c:(.text+0x3f) : référence indéfinie vers « mlx_put_image_to_window »
main.o : Dans la fonction « color_map_1 » :
main.c:(.text+0x219) : référence indéfinie vers « mlx_pixel_put »
main.o : Dans la fonction « color_map_2 » :
main.c:(.text+0x38f) : référence indéfinie vers « mlx_get_color_value »
main.o : Dans la fonction « expose_win1 » :
main.c:(.text+0x1b) : référence indéfinie vers « mlx_put_image_to_window »
main.o : Dans la fonction « expose_win2 » :
main.c:(.text+0x62) : référence indéfinie vers « mlx_put_image_to_window »
main.o : Dans la fonction « key_win3 » :
main.c:(.text+0x168) : référence indéfinie vers « mlx_destroy_window »
main.o : Dans la fonction « main » :
main.c:(.text.startup+0x45) : référence indéfinie vers « mlx_init »
main.c:(.text.startup+0xa8) : référence indéfinie vers « mlx_new_window »
main.c:(.text.startup+0x12b) : référence indéfinie vers « mlx_clear_window »
main.c:(.text.startup+0x174) : référence indéfinie vers « mlx_new_image »
main.c:(.text.startup+0x1a1) : référence indéfinie vers « mlx_get_data_addr »
main.c:(.text.startup+0x274) : référence indéfinie vers « mlx_put_image_to_window »
main.c:(.text.startup+0x2b0) : référence indéfinie vers « mlx_destroy_image »
main.c:(.text.startup+0x2f9) : référence indéfinie vers « mlx_new_image »
main.c:(.text.startup+0x32a) : référence indéfinie vers « mlx_get_data_addr »
main.c:(.text.startup+0x3fd) : référence indéfinie vers « mlx_put_image_to_window »
main.c:(.text.startup+0x450) : référence indéfinie vers « mlx_string_put »
main.c:(.text.startup+0x47a) : référence indéfinie vers « mlx_string_put »
main.c:(.text.startup+0x4c4) : référence indéfinie vers « mlx_xpm_file_to_image »
main.c:(.text.startup+0x4f3) : référence indéfinie vers « mlx_get_data_addr »
main.c:(.text.startup+0x575) : référence indéfinie vers « mlx_put_image_to_window »
main.c:(.text.startup+0x59a) : référence indéfinie vers « mlx_put_image_to_window »
main.c:(.text.startup+0x5e0) : référence indéfinie vers « mlx_new_window »
main.c:(.text.startup+0x5fd) : référence indéfinie vers « mlx_new_image »
main.c:(.text.startup+0x62c) : référence indéfinie vers « mlx_get_data_addr »
main.c:(.text.startup+0x691) : référence indéfinie vers « mlx_new_window »
main.c:(.text.startup+0x6ad) : référence indéfinie vers « mlx_expose_hook »
main.c:(.text.startup+0x6c2) : référence indéfinie vers « mlx_mouse_hook »
main.c:(.text.startup+0x6d7) : référence indéfinie vers « mlx_key_hook »
main.c:(.text.startup+0x6ec) : référence indéfinie vers « mlx_expose_hook »
main.c:(.text.startup+0x701) : référence indéfinie vers « mlx_mouse_hook »
main.c:(.text.startup+0x716) : référence indéfinie vers « mlx_key_hook »
main.c:(.text.startup+0x72b) : référence indéfinie vers « mlx_key_hook »
main.c:(.text.startup+0x74b) : référence indéfinie vers « mlx_hook »
main.c:(.text.startup+0x763) : référence indéfinie vers « mlx_loop »
collect2: error: ld returned 1 exit status
Makefile.gen:20: recipe for target 'mlx-test' failed
make[1]: *** [mlx-test] Error 1
make[1] : on quitte le répertoire « /home/teowned/Bureau/fractol/mlx_cust_lib/minilibx/test »
Makefile:17: recipe for target 'do_configure' failed
make: *** [do_configure] Error 2

La premiere ligne étant : Package libbsd was not found in the pkg-config search path.
j'ai pourtant fait 1erement comme indiqué, mit le path du dossier minilibx dans PKG_CONFIG_PATH dans .zshrc

puis j'ai suivis tester ce script d'install :
https://github.com/BinaryBenji/Minilibx_Installer/blob/master/mlx_install.sh
de changer dans le makefile le fait quelle utilisais la minilibx macos mais celle ci que je venais d'installer dans dev/null

puis j'ai essayé PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
puis PKG_CONFIG_PATH=/usr/lib/pkgconfig
J'ai aussi essayé de telecharger libbsd.pc et de le mettre dans le path que j'ai configuré dans .zshrc mais rien ne fait :/

Tu aurais une idée ?

Can't find a suitable X11 include directory

Good day!
I've tried to install mlx into Ubuntu console on Windows. But after executing "make" command i've got this message about X11.
I've already performed sudo apt install libx11-dev but nothing helped.
Can you give me a hint what to do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.