Thread: Can't compile simpe program using mini-LZO library

  1. #1
    Registered User
    Join Date
    Dec 2018
    Posts
    2

    Can't compile simpe program using mini-LZO library

    Hello guys,

    I'm trying to use miniLZO library for a project that I just started. I'm testing its functionality and got stuck at the start.

    I'm coding a:
    * Shared C library
    * Using CLion as IDE
    * On Windows (7 and 10 x64), using MinGW to compile

    miniLZO uses 4 files, 1 *.c and 3 *.h files.

    The first thing that has to be done to use LZO is cast lzo_init(), which is a macro defined in "lzoconf.h".

    The IDE warns me about something, before compiling.

    Can't compile simpe program using mini-LZO library-0-png

    Looks like there's something wrong in the definition of lzo_init() or something else.

    When I try to compile this simple program:

    Can't compile simpe program using mini-LZO library-1-jpg

    Blows here:

    Can't compile simpe program using mini-LZO library-2-png

    And here:

    Can't compile simpe program using mini-LZO library-3-jpg

    I'm attaching all the images because some of them got cutted.

    Do you know what can be going wrong here? I'm not an experienced C programmer to understand what is happening. I've tried several workaround but nothing worked, looks like the problem is in the definition of the macro, line 337. I'll appreciate your help, thanks in advance.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,523
    Your attempt to call lzo_init() at line 8 in library.c needs to be inside a function.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Dec 2018
    Posts
    2
    Hello Salem, yeap, newbie error. Thanks for the answer!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to create a mini-benchmarking program?
    By sebasura in forum C Programming
    Replies: 3
    Last Post: 09-16-2016, 01:18 PM
  2. Mini program that i can't solve (one-dimensional)
    By irmate210 in forum C Programming
    Replies: 2
    Last Post: 01-28-2015, 12:21 PM
  3. a bug in my mini program!
    By Perspolice1993 in forum C Programming
    Replies: 3
    Last Post: 09-28-2011, 09:51 PM
  4. Log Library (Mini-Review?)
    By Scarvenger in forum C++ Programming
    Replies: 5
    Last Post: 01-07-2009, 03:35 PM
  5. Simpe graphics in C
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 10-07-2001, 08:27 PM

Tags for this Thread