Texas Gov. Rick Perry repeatedly blasted President Obama — while failing to mention any of Perry’s Republican rivals for president — in a speech Wednesday to more than 1,000 GOP activists in the capital of a swing state.

In his remarks, Perry pledged to repeal the federal health-care law on his first day in office and work to make government smaller.

“Our country’s in trouble, I think even those on the left understand that,” Perry said. “I will go to that Oval Office every morning and try to make Washington as inconsequential as I can in your lives.’’

Perry said he provides the right contrast to Obama because he has created jobs, balanced budgets and reduced spending while the president has presided over a historic downgrade of U.S. credit ratings and pushed a failed stimulus package that included food stamps. He received his loudest applause when he called Obama a one-term president.

“I know it’s time for a change in this country,’’ he said. “There is nothing ailing America that can’t be cured with the rebirth of freedom.”

In 2008, Obama became the first Democratic president to carry Virginia in more than four decades, but in the years since, Democrats have lost ground in what some consider a conservative Southern state. The GOP controls most of Richmond and holds a commanding majority of the state’s congressional delegation.

Perry spoke at a lunchtime fundraiser for the Virginia Republican Party that was initially expected to attract a few hundred people but ballooned into 1,080 guests and a campaign-style rally after Perry announced his candidacy last month. Journalists from more than 70 news organizations, including Japanese and British TV and most of the U.S. networks, covered the event.

Gov. Robert F. McDonnell, a close friend of Perry’s, asked the Texas governor this summer to speak at the luncheon. McDonnell, who succeeded Perry as chairman of the Republican Governors Association after he entered the presidential race, said he thought that Perry would have to back out because of his campaign schedule but he didn’t. “He’s a man of his word,’’ McDonnell said.

McDonnell, whose approval ratings place him among the nation’s most popular governors and who is often mentioned as vice presidential contender, has not endorsed a candidate in the race, but he reiterated Wednesday that he thinks the next president should be a governor.

A handful of people in the audience were wearing large ­orange “Perry/McDonnell” buttons. But Perry sidestepped a question later about whether he would consider McDonnell for the No. 2 spot. “That is thinking too far ahead,” he said.

Perry did not speak about the GOP presidential race or his chief rival — former Massachusetts governor Mitt Romney — but when questioned by reporters, he said Romney had been a “great private-sector job creator” but did not do the same in elected office.

“If Americans’ big issue is getting back to work . . . I’m the candidate to do it,” he said.