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)]); ^~~~~~~~~~~~ ...
@mark999 Set -DENABLE_ALL_CXX_COMPILE=OFF
. It's courageous to compile the C code as if it would be C++ ;)
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 :)
@mark999 Was your compile successful? (that's pretty funny -- we should perhaps document that option better)
At least for MS Visual Studio 2019, src/libbu/process.h conflicts with a system header with same name.
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.
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 ?
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.
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.
tried in another computer and it worked :))
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)?
@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.
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.
thanks. Why buparallel takes "0" as ncpu in rtshootrays ?
autodetects the number of cores
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
@Sean is the magic numbers used to prevent memory leaks, could not understand exactly their purpose ?
@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: Jan 09 2025 at 00:46 UTC