Stream: brlcad

Topic: compile errors


view this post on Zulip mark999 (May 28 2019 at 01:03):

what gcc versions are known to work? I keep getting compile errors. I've tried 2 gcc versions (7.3,8.3) and 2 brlcad versions (latest release, HEAD) with cmake 3.14.3

mkdir brlcad/build; cd brlcad/build
cmake .. -DBRLCAD_BUNDLED_LIBS=BUNDLED -DBRLCAD_ENABLE_OPENGL=ON -DENABLE_ALL_CXX_COMPILE=ON -DBRLCAD_EXTRADOCS=ON -DCMAKE_BUILD_TYPE=Release -DBRLCAD_ENABLE_QT=ON -DCMAKE_INSTALL_PREFIX=/opt/brlcad/git -DBRLCAD_ENABLE_STRICT=OFF
make
...
[ 33%] Building CXX object src/libbu/CMakeFiles/libbu-obj.dir/uuid.c.o
In file included from /path/to/brlcad/src/libbu/uuid.c:25:
/path/to/brlcad/include/bu/uuid.h:42:27: error: expected primary-expression before 'static'
 #  define STATIC_ARRAY(x) static (x)
                           ^~~~~~
/path/to/brlcad/include/bu/uuid.h:58:29: note: in expansion of macro 'STATIC_ARRAY'
 bu_uuid_create(uint8_t uuid[STATIC_ARRAY(16)], size_t nbytes, const uint8_t *bytes, const uint8_t namespace_uuid[STATIC_ARRAY(16)]);
                             ^~~~~~~~~~~~
/path/to/brlcad/include/bu/uuid.h:58:29: error: expected ']' before 'static'
 bu_uuid_create(uint8_t uuid[STATIC_ARRAY(16)], size_t nbytes, const uint8_t *bytes, const uint8_t namespace_uuid[STATIC_ARRAY(16)]);
                             ^
                             ]
/path/to/brlcad/include/bu/uuid.h:58:29: error: expected ')' before 'static'
 bu_uuid_create(uint8_t uuid[STATIC_ARRAY(16)], size_t nbytes, const uint8_t *bytes, const uint8_t namespace_uuid[STATIC_ARRAY(16)]);
               ~             ^
                             )
/path/to/brlcad/include/bu/uuid.h:42:27: error: expected initializer before 'static'
 #  define STATIC_ARRAY(x) static (x)
                           ^~~~~~
/path/to/brlcad/include/bu/uuid.h:58:29: note: in expansion of macro 'STATIC_ARRAY'
 bu_uuid_create(uint8_t uuid[STATIC_ARRAY(16)], size_t nbytes, const uint8_t *bytes, const uint8_t namespace_uuid[STATIC_ARRAY(16)]);
                             ^~~~~~~~~~~~
...

view this post on Zulip Daniel Rossberg (May 28 2019 at 19:20):

@mark999 Set -DENABLE_ALL_CXX_COMPILE=OFF. It's courageous to compile the C code as if it would be C++ ;)

view this post on Zulip mark999 (May 30 2019 at 17:00):

Ah, didn't realize what that flag did. I assumed it enabled extra stuff that was c++, as opposed to building everything as if it's c++. No wonder the compiler got indigestion :)

view this post on Zulip Sean (May 31 2019 at 13:39):

@mark999 Was your compile successful? (that's pretty funny -- we should perhaps document that option better)

view this post on Zulip Daniel Rossberg (Oct 14 2019 at 14:24):

At least for MS Visual Studio 2019, src/libbu/process.h conflicts with a system header with same name.

view this post on Zulip Daniel Rossberg (Oct 15 2019 at 13:58):

The current trunk compiles now with MS Visual Studio 2019 - except the libbrep test brep_cdt_mesh. This program uses a private (not DLL-exported) class, which results in linkage errors.

view this post on Zulip scorp08 (Oct 19 2019 at 14:59):

I defined somefunctions and declared in a .h (extern or extern "C") file , include & built both .dll and .lib to use from another project. Altough I did all the linking libs (librt) and sent dll files to myproject.exe dir, could not build myproject. If I link static.libs , I got so many unresolved linkage errors & I do not know which libraries to link. If I add non_static libs, myproject.exe returns with runtime error.
What am I missing ?

view this post on Zulip Daniel Rossberg (Oct 19 2019 at 18:27):

Your application is probably missing a DLL. I.e., the DLL are all created, but are in a directory where your executable can't find them. Copying all (*.exe and *.dll) into the same directory could help.

However, if you want simply write a program, which can create, read, write, explore and change a BRL-CAD database on Windows, you could consider to use the brlcad.dll. See http://brlcad.org/wiki/BRL-CAD%27s_core_C%2B%2B_interface for a quick start. The devel file in https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Runtime%20Libraries/7.26.0/ contains everything you need. It contains the already compiles brlcad.dll for 32 and 64 bit programs.

view this post on Zulip scorp08 (Oct 20 2019 at 07:01):

yes, that would help but I was thinking to add some functions to fortray, compile and use from another app. I added all the required dll files. Linking librt.lib and got 0xc000007b error. I read it is related with x64,x86 difference of compilers but I build both brlcad and clientapp as x64.

view this post on Zulip scorp08 (Oct 21 2019 at 10:43):

tried in another computer and it worked :))

view this post on Zulip scorp08 (Oct 22 2019 at 05:44):

did not understand bu_list functionality in structs. When bu_list_append, seems like is appending as circular fashion but what it stores (address of e.g. xrays)?

view this post on Zulip Sean (Oct 23 2019 at 02:08):

@scorp08 it stores whatever you list element you provide to it. bu_lists are a bit "backwards" in traditional list sense in that they leverage a feature of C that isn't utilized very often any more (type punning). You can turn any C struct into a singly or doubly linked list trivially, very easily.

view this post on Zulip Sean (Oct 23 2019 at 02:10):

the lists are circular whether you need them to be or not. it all depends on which functions you use to access the list which determines whether it's a single linked list, a double, a deque, a queue, etc.

view this post on Zulip scorp08 (Oct 25 2019 at 08:17):

thanks. Why buparallel takes "0" as ncpu in rtshootrays ?

view this post on Zulip Erik (Oct 25 2019 at 12:15):

autodetects the number of cores

view this post on Zulip Sean (Oct 25 2019 at 17:49):

yes, you can either provide the number of cores of parallelism you want it to use or you can specify "0" to use all of them

view this post on Zulip scorp08 (Oct 31 2019 at 07:17):

@Sean is the magic numbers used to prevent memory leaks, could not understand exactly their purpose ?

view this post on Zulip Sean (Nov 04 2019 at 21:15):

@scorp08 They are a platform agnostic way of detecting memory errors, ideally before corruption affects data, so applications can quit as quickly as possible if there is a problem.


Last updated: Oct 09 2024 at 00:44 UTC