andreeafurnica

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • andreeafurnica
    Participant

    As I can see in the log, the library that actually fails is called logger.a which is a visual Visual GDB c++ project(static library) created by me that uses the log4cplus library. The project is build with the properties that I showed before(-std=c++11, –start-group, –end-group checked with the log4cplus as included library)

    Seems that the static library does not need the path to the liblog4cplus.a in the linker to compile correctly, it is only necessary to include the library folder in the include library property.

    Now I need to use this library logger.a into a Visual GDB project application and this requires also the path to the liblog4cplus.a in the linker inputs.

    This error does not appear when I build simply the project including the logger.h header. The error appears only when I make a call to a function that is in the library.

    What is very strange I that if I set my project as a “static library” not “executable” I do not have any errors and I can use all the functions but as executable I have this error . Do you know why this can happen?

     

    Below you can see the error messages that appears(verbose mode = diagnostic ).

    ..\..\..\Utilities\solution_linux\Debug\logger.a(Logger.o): In function `std::pair<unsigned char const, log4cplus::Logger>::~pair()’:
    1> d:\sbx\gwtt_tool\nonembedded\visualstudio\dependencies\x64linuxcompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\..\..\..\..\x86_64-nilrt-linux\usr\include\c++\4.7.2\bits\stl_pair.h(88): error : undefined reference to `log4cplus::Logger::~Logger()’
    1> collect2.exe : error : ld returned 1 exit status
    1> make: *** [Debug/gwttl_generic_app] Error 1
    1> ————————————————————-
    1> Command exited with code 2
    1> Executable: C:\Program Files (x86)\Sysprogs\VisualGDB\make.exe
    1> Arguments: CONFIG=Debug
    1> Directory: D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app
    1> VisualGDB : error : Command-line action failed
    1> C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “”C:\Program Files (x86)\Sysprogs\VisualGDB\VisualGDB.exe” /build “D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\gwttl_generic_app.vcxproj” “/solution:D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\gwttl_generic_app.sln” “/config:Debug” “/platform:Win32″” exited with code 1.
    1> Done executing task “Exec” — FAILED.
    1>Done building target “Build” in project “gwttl_generic_app.vcxproj” — FAILED.
    1>
    1>Done building project “gwttl_generic_app.vcxproj” — FAILED.
    1>
    1>Project Performance Summary:
    1> 9308 ms D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\gwttl_generic_app.vcxproj 1 calls
    1>
    1>Target Performance Summary:
    1> 0 ms SetCABuildNativeEnvironmentVariables 1 calls
    1> 0 ms GetTargetPath 1 calls
    1> 0 ms BeforeResolveReferences 1 calls
    1> 0 ms _SplitProjectReferencesByFileExistence 1 calls
    1> 0 ms PrepareProjectReferences 1 calls
    1> 0 ms GetReferenceAssemblyPaths 1 calls
    1> 0 ms ExpandSDKReferences 1 calls
    1> 1 ms PrepareForBuild 1 calls
    1> 1 ms AssignProjectConfiguration 1 calls
    1> 1 ms ResolveReferences 1 calls
    1> 1 ms ResolveSDKReferences 1 calls
    1> 1 ms _GetProjectReferenceTargetFrameworkProperties 1 calls
    1> 1 ms AfterResolveReferences 1 calls
    1> 1 ms SetBuildDefaultEnvironmentVariables 1 calls
    1> 2 ms _CheckForInvalidConfigurationAndPlatform 1 calls
    1> 2 ms PrepareForNMakeBuild 1 calls
    1> 3 ms GetFrameworkPaths 1 calls
    1> 20 ms ResolveProjectReferences 1 calls
    1> 24 ms _HandlePackageFileConflicts 1 calls
    1> 48 ms ResolveAssemblyReferences 1 calls
    1> 9185 ms Build 1 calls
    1>
    1>Task Performance Summary:
    1> 1 ms Message 2 calls
    1> 1 ms FindAppConfigFile 1 calls
    1> 1 ms MakeDir 2 calls
    1> 1 ms AssignProjectConfiguration 1 calls
    1> 1 ms MSBuild 1 calls
    1> 1 ms SetEnv 5 calls
    1> 23 ms ResolvePackageFileConflicts 1 calls
    1> 47 ms ResolveAssemblyReference 1 calls
    1> 9185 ms Exec 1 calls
    1>
    1>Build FAILED.
    1>
    1>D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\..\..\..\Wrappers\_src\Sequencer.h(34,54): warning : ‘visibility’ attribute ignored [-Wattributes]
    1>D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\..\..\..\Wrappers\_src\Sequencer.h(44,46): warning : ‘visibility’ attribute ignored [-Wattributes]
    1>D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\..\..\..\Wrappers\_src\Sequencer.h(91,43): warning : ‘visibility’ attribute ignored [-Wattributes]
    1>D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\..\..\..\Wrappers\_src\LFWrapper.h(26,18): warning : attribute ignored in declaration of ‘struct LFSync’ [enabled by default]
    1>D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\..\..\..\Wrappers\_src\LFWrapper.h(26,18): warning : attribute for ‘struct LFSync’ must follow the ‘struct’ keyword [enabled by default]
    1>d:\sbx\gwtt_tool\nonembedded\visualstudio\dependencies\x64linuxcompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\..\..\..\..\x86_64-nilrt-linux\usr\include\c++\4.7.2\bits\stl_pair.h(88): error : undefined reference to `log4cplus::Logger::~Logger()’
    1>collect2.exe : error : ld returned 1 exit status
    1>VisualGDB : error : Command-line action failed
    1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “”C:\Program Files (x86)\Sysprogs\VisualGDB\VisualGDB.exe” /build “D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\gwttl_generic_app.vcxproj” “/solution:D:\SBX\GWTT_TOOL\NonEmbedded\VisualStudio\Projects\Large\gwttl_generic_app\gwttl_generic_app.sln” “/config:Debug” “/platform:Win32″” exited with code 1.
    1> 5 Warning(s)
    1> 4 Error(s)

    andreeafurnica
    Participant

    Hello,

    Please find attached pictures with all the Makefile settings and Project settings from Visual GDB properties and also for verbose mode.

    I am using GNU Make as build system.

    Could you please tell me If I enabled correctly the verbose build logs? I set it as detailed/diagnostic and I sow the detailed output logs, but I do not know how to interpret the information.

    The –start-group and –end-group property is checked as you can see in the picture, but I am not sure how to check that really all the linker path are between start-group and end-group commands as you said. Should I see in the Additional liker Input this commands as the first and the last command from linker, or that check box does that and only should be checked?

    In the debug.mak file I so that the –start-group and –end-group commands are saved so it should be ok.

    Attachments:
    You must be logged in to view attached files.
    andreeafurnica
    Participant

    Hello,

    Im using -std=c++11 in linker flags but still have the same problem.

    I am using to type of libraries boost 1.62.0 and log4cplus 1.2.1 in the linker inputs which are both compiled with -std=c++11.

    The errors appear for both of them if I give the entire path to the libraries in the linker inputs: ../../../liblog4cplus.a and ../../../libboost_system.a.

    If I am using the command “-L-lboost_system”  for boost library instead of the entire path the error does not appear anymore and I can access all the boost functions.

    If I am using the command -L-log4cplus for log4cplus library I receive the error below:

    undefined reference to `log4cplus::Logger::~Logger()’

    The visual GDB accepts the command which means the library is found(I do not have errors when I put the command in linker), but on build the library is not recognized anymore like I did not linked it.

    Could you please tell me if I am using the right command to link the log4cplus library?

    There is other way to link it?

    Please find attached pictures with the GDB properties.

    Attachments:
    You must be logged in to view attached files.
Viewing 3 posts - 1 through 3 (of 3 total)