解决链接错误的正确方法是什么?

时间:2015-09-28 01:42:00

标签: cmake makefile

我在Ubuntu 14.04上使用cmake来构建pdf2htmlEx

需要构建poppler版本> = 0.25。我建立了poppler版本0.35.0。

在此之后,由于早期版本的poppler被链接,我收到链接错误。

我通过这样做解决了这个问题:

ln -s /usr/lib/libpoppler.so.54.0.0 /usr/lib/i386-linux-gnu/libpoppler.so

基本上将poppler版本指向新构建的版本。这看起来像个黑客。

我的问题是,如果我有两个版本的同一个库,我该如何确保" cmake"和"制作"和" g ++" (cmake配置为poppler> = 0.25.0)找到正确的版本?你如何正确调试和修复这样的链接错误?

1 个答案:

答案 0 :(得分:1)

正确的方法是修改@Override public Object getItem(int position) { //Return full object, coz we need to access other //member variables too return mData.get(position); } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.list_item_dualline, parent, false); holder = new ViewHolder(); holder.title = (TextView) convertView.findViewById(R.id.item_station); holder.description = (TextView) convertView.findViewById(R.id.item_zone); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } Victoria victoria = (Victoria)getItem(position); holder.title.setText(victoria.getStation()); holder.description.setText(victoria.getZone()); if (victoria.isSelected()) { setItemSelected(convertView); } else { setItemNormal(convertView); } return convertView; } public void setItemSelected(View view) { View rowView = view; view.setBackgroundColor(Color.parseColor("#868F98")); TextView tv0 = (TextView) rowView.findViewById(R.id.item_station); tv0.setTextColor(Color.WHITE); TextView tv1 = (TextView) rowView.findViewById(R.id.item_zone); tv1.setTextColor(Color.WHITE); } public void setItemNormal(View v) { v.setBackgroundColor(Color.TRANSPARENT); TextView tv0 = ((TextView) v.findViewById(R.id.item_station)); tv0.setTextColor(Color.WHITE); TextView tv1 = ((TextView) v.findViewById(R.id.item_zone)); tv1.setTextColor(Color.parseColor("#B5B5B5")); } 中的某个变量(POPPLER_LIBRARY,我猜)。编辑此文件后,请务必使用builddir/CMakeCache.txt重新生成构建文件(实际上,对于“unix makefiles”生成器,运行cmake .也会这样做。)

您还可以使用make app,它允许您使用漂亮的图形界面查看和编辑缓存值。