Skip to content

Commit

Permalink
Fixed undefined symbol: fmpc_world_model_mod_init issue. Added header…
Browse files Browse the repository at this point in the history
… guards.
  • Loading branch information
blumenthal committed Nov 5, 2014
1 parent 2caa940 commit 091e0a8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ include_directories(
LINK_DIRECTORIES(${BRICS_3D_LINK_DIRECTORIES})

# Compile library fmpcwmlib
add_library(fmpcwmlib SHARED ..//ubx_rsg_fmpc/src/fmpc_world_model.cpp
..//ubx_rsg_fmpc/modules/fmpcwmlib_module.c
add_library(fmpcwmlib SHARED
src/fmpc_world_model.cpp
modules/fmpcwmlib_module.c
)
set_target_properties(fmpcwmlib PROPERTIES PREFIX "")
target_link_libraries(fmpcwmlib ${BRICS_3D_LIBRARIES} ${UBX_LIBRARIES})
Expand Down
4 changes: 2 additions & 2 deletions modules/fmpcwmlib_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
int fmpcwmlib_mod_init(ubx_node_info_t* ni)
{
int ret;
ret=fmpc_world_model_mod_init(ni);
// ret=fmpc_world_model_mod_init(ni);
if(ret!=0)
goto out;

Expand All @@ -17,6 +17,6 @@ int fmpcwmlib_mod_init(ubx_node_info_t* ni)

void fmpcwmlib_mod_cleanup(ubx_node_info_t* ni)
{
fmpc_world_model_mod_cleanup(ni);
// fmpc_world_model_mod_cleanup(ni);
}

6 changes: 3 additions & 3 deletions modules/fmpcwmlib_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void fmpcwmlib_mod_cleanup(ubx_node_info_t* ni);
/* declare module init and cleanup functions, so that the ubx core can
* find these when the module is loaded/unloaded.
* Please edit your license in macro LICENSE_SPDX */
UBX_MODULE_INIT(fmpcwmlib_mod_init)
UBX_MODULE_CLEANUP(fmpcwmlib_mod_cleanup)
UBX_MODULE_LICENSE_SPDX(GPL-2.0+)
//UBX_MODULE_INIT(fmpcwmlib_mod_init) // causes undefinded symbols over here
//UBX_MODULE_CLEANUP(fmpcwmlib_mod_cleanup)
UBX_MODULE_LICENSE_SPDX(BSD-3-Clause)

13 changes: 13 additions & 0 deletions src/fmpc_world_model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* fmpc_world_model microblx function block (autogenerated, don't edit)
*/

#ifndef FMPC_MORLD_MODEL_HPP_
#define FMPC_MORLD_MODEL_HPP_

#include <ubx.h>

/* includes types and type metadata */
Expand Down Expand Up @@ -102,3 +105,13 @@ void fmpc_world_model_mod_cleanup(ubx_node_info_t *ni)
ubx_block_unregister(ni, "fmpc_world_model");
}

UBX_MODULE_INIT(fmpc_world_model_mod_init)
UBX_MODULE_CLEANUP(fmpc_world_model_mod_cleanup)

#endif /* FMPC_MORLD_MODEL_HPP_ */



/* EOF */


0 comments on commit 091e0a8

Please sign in to comment.