Compilation Error on Routing Service when used as library

4 posts / 0 new
Last post
Offline
Last seen: 1 month 2 weeks ago
Joined: 12/20/2022
Posts: 2
Compilation Error on Routing Service when used as library

Hello,

I was trying to use Routing Service as a library. I tried with command line Executable which runs ok, but when I am trying to use routing service as library, it gives me the error. I tried this program

using namespace rti::routing;

ServiceProperty property;
uint32_t running_seconds = 60;
property.cfg_file("my_routing_service_cfg.xml");
property.service_name("my_routing_service");

}

I am able to build the above program, but when I do this

    Service service(property);
    service.start();

It gives me this error

Error LNK2019 unresolved external symbol GetPerformanceInfo referenced in function ROUTERHost_getMemoryUsage ROSRoutingService C:\routing_service_library\build\rtiroutingservicezd.lib(MonitorableApplication.obj) 

Any help would highly be appreciated. Thanks.

Howard's picture
Offline
Last seen: 1 day 1 hour ago
Joined: 11/29/2012
Posts: 469

Hmm, "GetPerformanceInfo" is a function in the Windows Psapi.lib.

https://learn.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getperformanceinfo

Try adding that lib to your linker.  You may also need to add the following macro, –DPSAPI_VERSION=1.

Offline
Last seen: 1 month 2 weeks ago
Joined: 12/20/2022
Posts: 2

oh yes, its working now. Thanks a lot.

Howard's picture
Offline
Last seen: 1 day 1 hour ago
Joined: 11/29/2012
Posts: 469

Thanks for letting me know.