News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Open Cascade 7.0.0 setup for Code::Blocks

Started by StarBootics, October 16, 2016, 07:19:21 PM

Previous topic - Next topic

StarBootics

Hello everyone,

I'm currently studying Open Cascade library and installing it but so far it didn't work. According to their website https://www.opencascade.com/content/latest-release pre-generated projects are provided for Code::Blocks IDE

I have to confess I have no knowledge about *.sh files but when I read "codeblocks.sh" file I seems to be created for MacOS.
#!/bin/bash

export TARGET="cbp"

source ./env.sh "$1" "$TARGET"

if [ -e "/Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks" ]; then
  /Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks ./adm/$WOKSTATION/cbp/OCCT.workspace
else
  codeblocks ./adm/$WOKSTATION/cbp/OCCT.workspace
fi


So my question is :

How to install this library under Linux OS (Ubuntu 16.04 x64) for using it with Code::Blocks ?

Thanks beforehand
StarBootics

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

StarBootics

Quote from: oBFusCATed on October 16, 2016, 07:33:59 PM
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_What_do_I_need_to_know_when_using_3rd_party_libs.3F
Thanks

I don't know why but I had to add some Search Directories in the "Global compiler settings" even if the files are in the "/usr/include/...". I was sure when the files are in that folder we don't need to specify them, the compiler are capable to find them all by it's self.

Anyway, I still have an issue but it's more related to compiling a library than setting up Code::Blocks to do it.

Best regards
StarBootics

oBFusCATed

Only /usr/include is known by default.
Any subfolder should be added manually.
Generally it is very bad idea to add paths to the global compiler settings.
It is better to add them to your project settings.
Use pkg-config or global variables.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

StarBootics

Quote from: oBFusCATed on October 17, 2016, 12:54:30 AM
Only /usr/include is known by default.
Any subfolder should be added manually.
Generally it is very bad idea to add paths to the global compiler settings.
It is better to add them to your project settings.
Use pkg-config or global variables.

Ok I have change that, these folder are now in my project file.

Best regards
StarBootics

StarBootics

#5
Hello everyone,

I need some help again about something I don't understand. I'm still trying to compile successfully OpenCascade but so far it fail saying :

Quote(0 error, 372 warning)  built fail with error 7

This is what I don't understand you can't have "no error" and "an error" at the same time. So my question is : What kind of errors are being reported by Code::Blocks ?

I guess, syntax errors only

And if, by chance, someone know what error 7 from GCC compiler mean, this will be very helpful.

Thanks beforehand
StarBootics






StarBootics

I am running Code::Blocks version 16.01 rev 10692 on Ubuntu Gnome x64 (version 16.10).
The compiler I use is GNU GCC version (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005.

When I try to compile OpenCascade library, the compilation fail with 0 error 362 warning Built failed with error 7.

Build log : (Sorry too large to post it directly but for those who want to see it https://www.dropbox.com/s/sej40qsxlr2f4nq/Occt_Kernel_Build_log.zip?dl=0
bin/Release/libOcctKernel.so -s) failed with error 7!
Process terminated with status -1 (110 minute(s), 15 second(s))
0 error(s), 362 warning(s) (110 minute(s), 15 second(s))


Crash report: No crash

I didn't make a lot of test since the compilation time is very very long. But I have already tried :
To compile with C++14 instead of C++11
To built the library by dropping some portions out of it (bad idea even if the *.so library is created : undefinied references ...)
but none of them worked.

BlueHazzard

#8
i think this error comes from
execvp(/bin/sh, -c, g++ .............
and means:
Quote#define E2BIG        7  /* Argument list too long */

so the problem seems to be that there are too many .o files to link into one library at the same time. This is not a problem of the compiler but of the ?OS? or the way how codeblocks calls the compiler... This is a problem of the project file, not specially a hard bug in c::b, but c::b should be a able to handle this correctly...

someone an idea how to fix this?

StarBootics

Perhaps compiling the library with CMake directly ?

stahta01

Good idea; to be safest I would use make files created via CMake.
But, you could try to create CB projects using CMake to see if the CB projects were created wrong or not.
But, the OP would be safer to create make files.

My guess the OP is using CB Projects created for the wrong Operating System.

Tim S.

Quote from: StarBootics on October 28, 2016, 06:39:12 PM
Perhaps compiling the library with CMake directly ?
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

StarBootics

#11
Problem solved !

I'm compiling as I'm writing here. I after a serious search of the opencascade-7.0.0 source code folder I have found the OCCT workspace file. The source generate several libraries instead of a single one. That was the mistake I made, trying to compile a single library...

Anyway in my experience I have exceed the limit in size but it will be nice for the future to know what is the maximum size for a library.

Best regards
StarBootics

BlueHazzard

Quote from: StarBootics on October 29, 2016, 12:44:57 AM
Anyway in my experience I have exceed the limit in size but it will be nice for the future to know what is the maximum size for a library.

i think too that this is a problem (or a bug) in codeblocks.... The maximum size is os or even distribution dependent...

Jenna

Quote from: BlueHazzard on October 29, 2016, 02:50:53 PM
Quote from: StarBootics on October 29, 2016, 12:44:57 AM
Anyway in my experience I have exceed the limit in size but it will be nice for the future to know what is the maximum size for a library.

i think too that this is a problem (or a bug) in codeblocks.... The maximum size is os or even distribution dependent...
It's wxExecute, which limits the size (or has limited) as far as I know.
Besides any OS-limits, of course.