User forums > General (but related to Code::Blocks)

Need help for CB setup under Linux (c++ programming with SDK)

(1/2) > >>

Hi everybody
I have started to (partly) use CB (for plugin development for flight sim XPlane based on its SDK) under Linux (Mint) instead of W10. With some help I could get the SDK with CB running under W10, however, so far I could not manage to get this working under Linux and would be very grateful for some help.

The basic settings I made under W10 are as follows:

for the compiler:
Preferences-Compiler-Linker settings-Link libraries: link to the SDK lib directory
Preferences-Compiler-Linker settings-Other linker options: -lopengl32 (as the plugin uses openGL)
Preferences-Compiler-Search directories-Compiler: link to the SDK headers directories
Preferences-Compiler-Search directories-Linker: link to the SDK headers directories
Preferences-Compiler-Compiler settings-#includes: some variables (IBM=1, XSDK301=1 etc.)

for the project:
Project-Properties-Build targets-Release: DLL

All other (standard) settings of CB are left unchanged

For CB under Linux I have basically used the same settings understanding that there are some differences, e.g. no need of dll-paths.
For test purposes under Linux the SDK provides some ready project(s) containing a cpp-file and a make-file. Need to admit that I am not familiar enough with IDEs/programming to understand the correct use of a make file.

With CB under Linux I have created an empty project and added the content of the cpp-file. Further settings of CB are made as described above except for the dll-paths. The SDK tutorial/instructions for linking under Linux are as follows:

--- Quote ---Linking on Linux
There are no link libraries on Linux for the SDK; instead pass the command-line option
-shared -rdynamic -nodefaultlibs -undefined_warning
to the linker. This will let you link despite not having XPLM symbols defined. To include libraries like OpenGL use this:
-lGL -lGLU
--- End quote ---

Frankly speaking I am not sure where to put the shown command-line option in CB (for Linux). Putting this under Preferences-Compiler-Linker settings-Other linker options does not compile without errors not saying that this is the reason. Perhaps there are some other missing/wrong settings in CB.

Thanks up-front for any help


Please explain why you did not post the error or a full build log?
Without at least one of those all you are going to get are guesses.
You might get a educated guess; me I am a windows person so, I can not even do a good guess.

Note: A link to the project you are trying to compile would also help.

Tim S.

Thank you very much for the quick reply.

The buildlog is in the attachement. I did not alter the code and thus I am quite sure that the error messages are somehow related to the IDE setup. BTW I remember that when setting up CB under W10 there were similar error messages which looked like some errors in the code.
The project can be downloaded here: (the download links for the different OS are under the picture)

Thanks in advance for further help.


Miguel Gimenez:
The error messages suggests you have missed some include file, probably XPLMDisplay.h . The link stage has not started yet.

Regarding the linker options, you should put them in Project -> Build options -> Linker settings -> Other linker options. The openGL libraries should go in the Link libraries control; their names depend on your distro, and you must install the development versions beforehand.

As a general rule you shouldn't edit Preferences -> Compiler but Project -> Build options -> Compiler settings.

I looked at the code less than 5 minutes.

My guess is "IBM" means Windows and "LIN" means Linux.

Instead of IBM=1 I would try LIN=1

Tim S.


[0] Message Index

[#] Next page

Go to full version