The program does not start on Linux

Hi,

I built my program on Linux Debian, but it won’t start. Checked on HelloWorldDemo - it starts. What could be the problem? Everything works on Windows. Unlike HelloWorldDemo, I used an ImageButton and an two-dimensional array of images.

And when building, programs are assigned a library assignment and not an executable. But HelloWorldDemo works.

I checked. The problem is not with the ImageButton and not with the images.

use the debugger… it is an important tool to software development. :slight_smile:

1 Like

Everything has already been debugged on Windows.

If it builds a library, it is probably a plugin (they are libraries after all).
If you find the application try to run it from the terminal.
There was some quirk with nautilus IIRC. Have a look in the forum search.

Good luck

I don’t understand your response. Your problem is on Linux, debugging on Windows may provide insight, but certainly won’t help you diagnose the issue on Linux

Does it crash, stall? Is it even launched (seems to be built as a lib)? Is it on Ubuntu?

Found a bug. The problem is in the random function rand(), which I used. On Windows it gives a maximum of 32767, and on Linux about 2147483639. Because of this, the number exceeded the size of the array.

PS
I know Juce has its own random function.

1 Like

By the way, why does rand() give such a large number on Linux?

Better chance to find a response on SO! :grinning_face_with_smiling_eyes:

1 Like

OK. I found an external random and made my own RAND_MAX for it.

#define RAND_MAX2 32767

University of California
Posix rand_r function added by Wes Peters
http://sources.freebsd.org/RELENG_8/src/lib/libc/stdlib/rand.c

Why don’t you use juce::Random? it’s designed to be fast for audio.

1 Like

And me not for the sound. I need a seed to repeat the pseudo random numbers.

JUCE’s random can be seeded also (IIRC it uses rand48 that is a not bad fast PRNG).

https://docs.juce.com/master/classRandom.html

1 Like

Ok, but with “my” code I will feel calmer. In general, I combine the classic rand() and juce random.
Thanks!