error VGDB1002

Sysprogs forums Forums VisualGDB error VGDB1002

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9105
    akhilavit
    Participant

    Error 27 error VGDB1002: undefined reference to `<SO_Namespace_Name>::DeleteInterface()

    #9106
    akhilavit
    Participant

    Please read these details and reply clearly, as I have to wait for a day for reply, if something is missed out.

    Updated:

    undefined reference to `RevLib::GetRevLibObjectInterface()’

    undefined reference to `RevLib::DeleteRevLibObjectInterface()’

    Here RevLib is namespace in my shared library. GetRevLibObjectInterface() & DeleteRevLibObjectInterface() are declared in RevLibAPI.h and defined in RevLibAPI.cpp (i.e. exported functions of a dll)

    Note:

    Structure of My Project:

    RevLibConApp is a windows application project. I have added LinuxConApp for this and compiled it.

    Then added existing project RevLib (Initially a windows dll project, cross compiled with another Configuration, LinuxConfig) to the solution.

    RevLibConApp is set dependent on RevLib from right_click->Project_dependencies.

    compiled together with LinuxConApp config. Following is the output log:

     

    1>Time Elapsed 00:00:00.61
     2>------ Build started: Project: RevLibConApp, Configuration: LinuxConApp x64 ------
     2>Build started 21-09-2016 19:14:03.
     2>Build:
     2> VisualGDB: Found 236 source files to transfer. Checking the source cache to find modified files...
     2> VisualGDB: No file changes detected. If you believe it's a mistake, please clean the project and build it again.
     2> VisualGDB: Run "make CONFIG=LinuxConApp" in directory "/tmp/VisualGDB/d/User/Akhil/Ubuntu/RevLibConApp/wrk" on ubuntu@192.168.0.54 (SSH)
     2> g++ -o LinuxConApp/RevLibConApp -Wl,-gc-sections -Wl,--start-group LinuxConApp/main.o LinuxConApp/ProgressMonitor.o LinuxConApp/RevLibTest.o ../RevLib/wrk/LinuxConApp/RevLib.so -Wl,--rpath='$ORIGIN' -Wl,--rpath='$ORIGIN/../../RevLib/wrk/LinuxConApp/' -Wl,--end-group
     2> LinuxConApp/RevLibTest.o: In function `RevLibTest::createRevLibObjectInterface()':
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::GetRevLibObjectInterface()'
     2> LinuxConApp/RevLibTest.o: In function `RevLibTest::deleteRevLibObjectInterface()':
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::DeleteRevLibObjectInterface()'
     2> LinuxConApp/RevLibTest.o: In function `RevLibTest::CleanUpMeshSTL(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)':
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::GetRevLibObjectInterface()'
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::DeleteRevLibObjectInterface()'
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::DeleteRevLibObjectInterface()'
     2> LinuxConApp/RevLibTest.o: In function `RevLibTest::cleanUpMeshOFF()':
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::GetRevLibObjectInterface()'
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::DeleteRevLibObjectInterface()'
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::DeleteRevLibObjectInterface()'
     2> LinuxConApp/RevLibTest.o: In function `RevLibTest::ProcessMesh()':
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::GetRevLibObjectInterface()'
     2>RevLibTest.cpp : error VGDB1002: undefined reference to `RevLib::DeleteRevLibObjectInterface()'
     2>collect2 : error : ld returned 1 exit status
     2> make: *** [LinuxConApp/RevLibConApp] Error 1
     2> -------------------------------------------------------------
     2> Command exited with code 2
     2> Executable: make
     2> Arguments: CONFIG=LinuxConApp
     2> Directory: /tmp/VisualGDB/d/User/Akhil/Ubuntu/RevLibConApp/wrk
     2>VisualGDB : error : Command-line action failed
     2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ""C:\Program Files (x86)\Sysprogs\VisualGDB\VisualGDB.exe" /build "D:\User\Akhil\Ubuntu\RevLibConApp\wrk\RevLibConApp.vcxproj" "/solution:D:\User\Akhil\Ubuntu\RevLibConApp\wrk\RevLibConApp.sln" "/config:LinuxConApp" "/platform:x64"" exited with code 1.
     2>
     2>Build FAILED.
     2>
     2>Time Elapsed 00:00:00.76
     ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    • This reply was modified 7 years, 7 months ago by support. Reason: formatting
    • This reply was modified 7 years, 7 months ago by support.
    #9111
    support
    Keymaster

    Hi,

    Looks like your library somehow ended up missing those method definitions. According to your build log, your application is linked against the library:

    g++ -o LinuxConApp/RevLibConApp -Wl,-gc-sections -Wl,--start-group LinuxConApp/main.o LinuxConApp/ProgressMonitor.o LinuxConApp/RevLibTest.o ../RevLib/wrk/LinuxConApp/RevLib.so -Wl,--rpath='$ORIGIN' -Wl,--rpath='$ORIGIN/../../RevLib/wrk/LinuxConApp/' -Wl,--end-group

    You can check the list of functions exported from a library by running the following command on the Linux side:

    nm <full path to .so file> | c++filt

    If it does not mention anything similar to RevLib::GetRevLibObjectInterface(), please locate the .cpp file that defines it, find a matching .o file on your Linux side and run ‘nm’ on it. If the .o file does not contain the method, please double-check your source code. If the .o file does not exist, please double-check the Library Makefile.

    #9112
    akhilavit
    Participant

    user@host:~$ nm /tmp/VisualGDB/d/User/Akhil/Ubuntu/RevLib/wrk/Linux/RevLibAPI.o | c++filt
    U _GLOBAL_OFFSET_TABLE_
    U RevLib::RevLibObject::GetInstance()
    U RevLib::RevLibObject::DeleteInstance()
    0000000000000028 r RevLib::SQR_PNT_TOL
    0000000000000068 r RevLib::NEIGHBOR_SIZE
    0000000000000030 r RevLib::GRID_CELL_SIZE
    0000000000000038 r RevLib::GRID_SPAN_LIMIT
    0000000000000040 r RevLib::SMALL_RANGE_TOL
    0000000000000088 r RevLib::STL_HEADER_SIZE
    000000000000008c r RevLib::MEMORY_BLOCK_SIZE
    0000000000000070 r RevLib::SKEW_DISTANCE_TOL
    0000000000000080 r RevLib::SMALL_CLOUD_LIMIT
    0000000000000078 r RevLib::MESH_PROJECTION_TOL
    0000000000000060 r RevLib::CLOUD_DIVISION_LIMIT
    0000000000000000 t RevLib::GetRevLibObjectInterface()
    000000000000000b t RevLib::DeleteRevLibObjectInterface()
    0000000000000050 r RevLib::MAX_NUM_POINTS_IN_GRID_CELL
    0000000000000048 r RevLib::MIN_NUM_POINTS_IN_GRID_CELL
    0000000000000058 r RevLib::MAX_NUM_POINTS_IN_OCTREE_CELL
    0000000000000018 r RevLib::PI
    0000000000000020 r RevLib::EXP
    0000000000000008 r RevLib::ZERO
    0000000000000090 r RevLib::XMULT
    0000000000000098 r RevLib::YMULT
    00000000000000a0 r RevLib::ZMULT
    0000000000000010 r RevLib::PNT_TOL
    00000000000000a8 r RevLib::TRIXMULT
    00000000000000b0 r RevLib::TRIYMULT
    00000000000000b8 r RevLib::TRIZMULT
    0000000000000001 r std::allocator_arg
    0000000000000000 r std::piecewise_construct
    0000000000000002 r std::ignore

     

    This is what I found on running that command.

    #9118
    support
    Keymaster

    Hi,

    The ‘U’ in front of the symbol means that the symbol is undefined, hence the RevLibApi.o file expects some other file to define RevLib::RevLibObject::GetInstance().

    Please check your source files for the definition (not declaration) of RevLib::RevLibObject::GetInstance() and then check the corresponding .o file.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.