Compilation Error on Routing Service when used as library

4 posts / 0 new
Last post
Offline
Last seen: 1 year 8 months ago
Joined: 12/20/2022
Posts: 6
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 18 hours ago
Joined: 11/29/2012
Posts: 605

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 year 8 months ago
Joined: 12/20/2022
Posts: 6

oh yes, its working now. Thanks a lot.

Howard's picture
Offline
Last seen: 1 day 18 hours ago
Joined: 11/29/2012
Posts: 605

Thanks for letting me know.