Export for CodeBlocks Linux - wrong path used


#1

Hey there
when I set up a CodeBlocks configuration in Projucer and then open my project in CodeBlocks, it won’t build because of a path error :
fatal error: juce_audio_basics/juce_audio_basics.cpp: No such file or directory
However the path seems to be exported all right, what seems to make the build fail is that it tries to find juce_audio_basics.cpp inside a folder named juce_audio_basics (same configuration as in the JUCE folder); however in my project all the cpp files have been copied directly to a JuceLibraryCode folder root, without the intermediary juce_audio_basics folder (and without the other folders being at the same level in the original JUCE library folder).
How can I fix this in Projucer? Is this a bug or me doing something silly?
Thanks in advance! :slight_smile:


#2

Two things to check:

  • Are you using the develop branch? I’ve recently fixed some include path issues.
  • Are the paths to the modules in the modules pane of the Projucer correct? These should all look like {some_path}/JUCE/modules.

#3

The paths are correct.Do you mean I should use the github version rather than the downloads on juce.com? I’ll give it a try, thanks.


#4

ok,
just to let you know, I’ve built the Projucer from the github repository and the problem remains the same.I’ve copied the content of JUCE/modules inside of MyProject/JuceLibraryCode and the bug seems fixed by this. :slight_smile:


#5

Did you checkout the develop branch? By default you will get the master branch.

All our development work goes on the develop branch which is periodically merged into the master branch. A few Linux Code::Blocks fixes haven’t made it to the master branch yet, so I would advise using the develop branch. I’ve just tested it and I didn’t experience any path errors.


#6

however, the copied folders disappear each time I relaunch Projucer. :/Also, the compilation fails in CodeBlocks (should I open a new thread for that?) :

/home/cyrill/Project1/Source/PluginProcessor.cpp:142:16: warning: unused variable ‘channelData’ [-Wunused-variable]
float* channelData = buffer.getWritePointer (channel);
^
g++ -shared obj/Debug/Project1/JuceLibraryCode/juce_audio_basics.o obj/Debug/Project1/JuceLibraryCode/juce_audio_devices.o obj/Debug/Project1/JuceLibraryCode/juce_audio_formats.o obj/Debug/Project1/JuceLibraryCode/juce_audio_plugin_client_utils.o obj/Debug/Project1/JuceLibraryCode/juce_audio_processors.o obj/Debug/Project1/JuceLibraryCode/juce_core.o obj/Debug/Project1/JuceLibraryCode/juce_cryptography.o obj/Debug/Project1/JuceLibraryCode/juce_data_structures.o obj/Debug/Project1/JuceLibraryCode/juce_events.o obj/Debug/Project1/JuceLibraryCode/juce_graphics.o obj/Debug/Project1/JuceLibraryCode/juce_gui_basics.o obj/Debug/Project1/JuceLibraryCode/juce_gui_extra.o obj/Debug/Project1/JuceLibraryCode/juce_opengl.o obj/Debug/Project1/JuceLibraryCode/juce_video.o obj/Debug/Project1/Source/PluginEditor.o obj/Debug/Project1/Source/PluginProcessor.o -o bin/Debug/libProject1.so -Wl,–no-undefined -lGL -ldl -lpthread -lrt
/usr/bin/ld: obj/Debug/Project1/JuceLibraryCode/juce_audio_basics.o: relocation R_X86_64_32 against `.rodata’ can not be used when making a shared object; recompile with -fPIC
obj/Debug/Project1/JuceLibraryCode/juce_audio_basics.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 46 second(s))
0 error(s), 1 warning(s) (0 minute(s), 46 second(s))


#7

That looks like a new, non-path-related, bug. I’ll investigate.


#8

sorry, my bad, I was on the master branch.


#9

ok, I’m now on the “develop” branch, and I still get the same compilation error message.


#10

This is now fixed on the develop branch.


#11

Thanks!
the ld error remains, though :
/usr/bin/ld: obj/Debug/Project1/JuceLibraryCode/juce_audio_basics.o: relocation R_X86_64_32 against `.rodata’ can not be used when making a shared object; recompile with -fPIC
obj/Debug/Project1/JuceLibraryCode/juce_audio_basics.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status


#12

Have you tried a clean build of your project?


#13

Yes, I cleaned both in Projucer and in CodeBlocks.


#14

Did you also recompile the Projucer? The fix was in the project exporter part of the Projucer source code.


#15

Ah, my bad, I forgot to do that.

Now that it is done, I have another error :

g++ -shared obj/Debug/Project1/JuceLibraryCode/juce_audio_basics.o obj/Debug/Project1/JuceLibraryCode/juce_audio_devices.o obj/Debug/Project1/JuceLibraryCode/juce_audio_formats.o obj/Debug/Project1/JuceLibraryCode/juce_audio_plugin_client_utils.o obj/Debug/Project1/JuceLibraryCode/juce_audio_processors.o obj/Debug/Project1/JuceLibraryCode/juce_core.o obj/Debug/Project1/JuceLibraryCode/juce_cryptography.o obj/Debug/Project1/JuceLibraryCode/juce_data_structures.o obj/Debug/Project1/JuceLibraryCode/juce_events.o obj/Debug/Project1/JuceLibraryCode/juce_graphics.o obj/Debug/Project1/JuceLibraryCode/juce_gui_basics.o obj/Debug/Project1/JuceLibraryCode/juce_gui_extra.o obj/Debug/Project1/JuceLibraryCode/juce_opengl.o obj/Debug/Project1/JuceLibraryCode/juce_video.o obj/Debug/Project1/Source/PluginEditor.o obj/Debug/Project1/Source/PluginProcessor.o -o bin/Debug/libProject1.so -Wl,–no-undefined -shared -lasound -lfreetype -lcurl -lX11 -lXext -lXinerama -lGL -ldl -lpthread -lrt
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status


#16

Well, that error means that the linker can’t find libGL in any of the standard library locations. Is it there? Have you installed a GL package? (There are a few different ones, so I don’t know which to suggest).


#17

I have a few libGL packages installed, however I had to symlink it
sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 /usr/lib/libGL.so
and now it seems to work, the output of CodeBlock is
g++ -shared obj/Debug/Project1/JuceLibraryCode/juce_audio_basics.o obj/Debug/Project1/JuceLibraryCode/juce_audio_devices.o obj/Debug/Project1/JuceLibraryCode/juce_audio_formats.o obj/Debug/Project1/JuceLibraryCode/juce_audio_plugin_client_utils.o obj/Debug/Project1/JuceLibraryCode/juce_audio_processors.o obj/Debug/Project1/JuceLibraryCode/juce_core.o obj/Debug/Project1/JuceLibraryCode/juce_cryptography.o obj/Debug/Project1/JuceLibraryCode/juce_data_structures.o obj/Debug/Project1/JuceLibraryCode/juce_events.o obj/Debug/Project1/JuceLibraryCode/juce_graphics.o obj/Debug/Project1/JuceLibraryCode/juce_gui_basics.o obj/Debug/Project1/JuceLibraryCode/juce_gui_extra.o obj/Debug/Project1/JuceLibraryCode/juce_opengl.o obj/Debug/Project1/JuceLibraryCode/juce_video.o obj/Debug/Project1/Source/PluginEditor.o obj/Debug/Project1/Source/PluginProcessor.o -o bin/Debug/libProject1.so -Wl,–no-undefined -shared -lasound -lfreetype -lcurl -lX11 -lXext -lXinerama -lGL -ldl -lpthread -lrt
Output file is bin/Debug/libProject1.so with size 32.69 MB
Process terminated with status 0 (0 minute(s), 49 second(s))
0 error(s), 1 warning(s) (0 minute(s), 49 second(s))
Thanks a lot for your help! :slight_smile: