Ubuntu 安装 QT;常见错误的解决;When executing step 'Make' ;cannot find -lgl

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/xiaoxiao133/article/details/49822897

1、安装教程如下:
http://www.cnblogs.com/Bonker/p/4053764.html
注意:我把QT安装到 /opt目录下面
2、把安装目录下:
点击“home” 按一下 Ctrl+H 显示隐藏 把路径:/opt/Qt5.5.1/5.5/gcc_64/bin添加到.bashrc

和.profile下面 添加方式如下:在最后一行 加上:
export PATH="/opt/Qt5.5.1/5.5/gcc_64/bin:$PATH"
qmake 命令就可以用啦!

3、出现错误When executing step 'Make'

sudo apt-get install build-essential
如果提示g++错误终端运行: sudo apt-get install g++
如果出现cannot find -lgl 错误在终端运行:sudo apt-get install libqt4-dev 即可

展开阅读全文

ubantu14.01LTS安装Qt出现编译问题,大家帮忙看看:-1: error: cannot find -lGL

03-18

root@ubuntu:~# sudo apt-get install libqt4-devrn正在读取软件包列表... 完成rn正在分析软件包的依赖关系树 rn正在读取状态信息... 完成 rn有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是rn因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件rn包尚未被创建或是它们已被从新到(Incoming)目录移出。rn下列信息可能会对解决问题有所帮助:rnrn下列软件包有未满足的依赖关系:rn libqt4-dev : 依赖: libqt4-dbus (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-declarative (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-designer (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-dev-bin (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是它将不会被安装rn 依赖: libqt4-help (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-network (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-qt3support (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是它将不会被安装rn 依赖: libqt4-script (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-scripttools (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-sql (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-svg (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-test (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-xml (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqt4-xmlpatterns (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqtcore4 (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: libqtgui4 (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 正要被安装rn 依赖: qt4-linguist-tools (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是它将不会被安装rn 推荐: libqt4-opengl-dev (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) 但是它将不会被安装rn 推荐: libqtwebkit-dev (>= 2.0~) 但是它将不会被安装rnE: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。 论坛

linux下运行make,出现错误cannot find -lcurl

08-10

错误如下rnrn/usr/bin/ld: cannot find -lcurlrncollect2: ld returned 1 exit statusrnmake: *** [bin/mod_billing.so] Error 1rnrn这是一个服务器的源代码rn我把Makefile文件如下rn源代码我传云盘上rn链接:http://pan.baidu.com/s/1bnkAyNt 密码:c7curnrn.PHONY: all clean cleanall res thirdlibrn #-Wpointer-arith -WinlinernCFLAGS=-g -Wall -Wno-deprecated -WerrorrnSHARED=-fPIC -sharedrnrnbin_dir=binrnmod_dir=modrn#mod_src=$(wildcard $(mod_dir)/*.c)rn#mod_so=$(patsubst %.c,%.so,$(notdir $(mod_src)))rnrnLDFLAGS=-Wl,-rpath,. -Lbinrnrnbase_src=\rn base/freeid.h \rn base/hashid.h \rn base/stringtable.h \rn base/args.c \rn base/args.h \rn base/gen_uuid.c \rn base/pack.c \rn base/unpack.c \rn base/uuid.h \rn base/util.c \rn base/util.hrnrnmod_so=\rn $(bin_dir)/mod_echo.so \rn $(bin_dir)/mod_gate.so \rn $(bin_dir)/mod_cmds.so \rn $(bin_dir)/mod_cmdctl.so \rn $(bin_dir)/mod_keepalivec.so \rn $(bin_dir)/mod_keepalived.sornrnall_t=\rn $(bin_dir)/libbase.so \rn $(bin_dir)/libtinyxml.so \rn $(mod_so) \rn $(bin_dir)/mod_robotcli.so \rn $(bin_dir)/mod_billing.so \rn $(bin_dir)/mod_db.so \rn $(bin_dir)/mod_game.sornrnall: $(all_t)rn rnrelease: CFLAGS += -O2 -fno-strict-aliasingrnrelease: allrnrn$(bin_dir)/libbase.so: $(base_src)rn @rm -f $@rn gcc $(CFLAGS) $(SHARED) -o $@ $^ -DHAVE_STDLIB_H -DHAVE_UNISTD_H -DHAVE_GETRLIMITrnrn$(mod_so): $(bin_dir)/%.so: $(mod_dir)/%.crn @rm -f $@rn gcc $(CFLAGS) $(SHARED) -o $@ $< -Iinclude/libshaco -Inet -Ibase -Imsgrnrn$(bin_dir)/mod_test.so: $(mod_dir)/mod_test.cpprn @rm -f $@rn gcc $(CFLAGS) $(SHARED) -o $@ $^ -Iinclude/libshaco -Inet -Ibase -Imsg -Iworldrnrn$(bin_dir)/mod_billing.so: $(mod_dir)/mod_billing.cpprn @rm -f $@rn g++ $(CFLAGS) $(SHARED) -o $@ $^ -Iinclude/libshaco -Inet -Ibase -Imod -Imsg -Imsg/Message -I3rd/curl $(LDFLAGS) -lcurlrnrn$(bin_dir)/mod_db.so: $(mod_dir)/mod_db.cpp \rn mod_db/db.h \rn mod_db/db_game.cpp \rn mod_db/db_log.cpp \rn mod_db/db_server_note.cpp \rn mod_db/CMysql.cpp \rn mod_db/CMysql.h \rn mod_db/GlobalUtilityFunction.cpp \rn mod_db/GlobalUtilityFunction.hrn @rm -f $@rn g++ $(CFLAGS) $(SHARED) -o $@ $^ -Iinclude/libshaco -Inet -Ibase -Imod -Imsg -Imsg/Message -Imod_db -I3rd/mysql -I3rd/mysql/mysql++ -I3rd $(LDFLAGS) -lmysqlpprnrnGAME_INC_PATH :=\rn -Iinclude/libshaco -Inet -Ibase -Itplt -Imod -Imsg -Imsg/Message -Imod_game -I3rd -I3rd/tinyXml -Imsg/iconv -Idatadefine -IpersistrnrnOBJS = $(patsubst mod_game/%.cpp,mod_game/%.o,$(wildcard mod_game/*.cpp))rn$(OBJS): mod_game/%.o: mod_game/%.cpprn g++ -o $@ -c $(CFLAGS) -fPIC $(GAME_INC_PATH) $< rnrn$(mod_dir)/mod_game.o: $(mod_dir)/mod_game.cpprn g++ -o $@ -c $(CFLAGS) -fPIC $(GAME_INC_PATH) $< rnrnpersist/mysqlc.o: persist/mysqlc.c persist/mysqlc.h rn g++ -o $@ -c $(CFLAGS) -fPIC $(GAME_INC_PATH) $< rnrn$(bin_dir)/mod_game.so: $(OBJS) $(mod_dir)/mod_game.o persist/mysqlc.orn @rm -rf $@rn g++ $(CFLAGS) $(SHARED) -o $@ $^ $(GAME_INC_PATH) $(LDFLAGS) -liconv -ltplt -ltinyxml -lbase -lmysqlclientrnrn#$(bin_dir)/mod_game.so :$(mod_dir)/mod_game.cpp \rn #mod_game/game_tplt.cpp \rn #mod_game/game_tplt.h \rn #mod_game/game_cmdctl.cpp \rn #mod_game/game_cmdctl.h \rn #mod_game/UserMgr.cpp \rn #mod_game/handle_db.cpp \rn #mod_game/handle_gate.cpp \rn #mod_game/UserMgr.h \rn #mod_game/GameLineMgr.cpp \rn #mod_game/TowerMgr.cpp \rn #mod_game/TeamMgr.cpp \rn #mod_game/SweepMgr.cpp \rn #mod_game/RankMgr.cpp \rn #mod_game/User.cpp \rn #mod_game/SkillMgr.cpp \rn #mod_game/Role_MsgSender.cpp \rn #mod_game/Role_GCAskHandler.cpp \rn #mod_game/Scene.h \rn #mod_game/Scene.cpp \rn #mod_game/FuncOpenMgr.cpp \rn #mod_game/WorldBossActivitySingleton.cpp \rn #mod_game/Role.cpp \rn #mod_game/Team.cpp \rn #mod_game/WorldBossActivity.cpp \rn #mod_game/ActivityBase.cpp \rn #mod_game/GMCmd.cpp \rn #mod_game/Role.h \rn #mod_game/User.h \rn #mod_game/GuildNetMsg.cpp \rn #mod_game/game_api.h \rn #mod_game/game_api.cpp \rn #mod_game/game.h \rn #mod_game/handle_billing.cpp \rn #mod_game/TeamMgr.h \rn #mod_game/ActivityMgr.cpp \rn #mod_game/role_cache.h \rn #mod_game/RankMgr.h \rn #mod_game/role_cache.cpp \rn #mod_game/handle_db.h \rn #mod_game/GuildMgr.h \rn #mod_game/FriendListMgr.cpp \rn #mod_game/ArenaMgr.cpp \rn #mod_game/GlobalUtilityFunction.h \rn #mod_game/GlobalUtilityFunction.cpp \rn #mod_game/GuildMemberMgr.cpp \rn #mod_game/XuanShang.cpp \rn #mod_game/WorldBoss.cpp \rn #mod_game/WingMgr.cpp \rn #mod_game/VIPMgr.cpp \rn #mod_game/TemplateMgr.cpp \rn #mod_game/TeamMember.cpp \rn #mod_game/TaskMgr.cpp \rn #mod_game/StateMachine.cpp \rn #mod_game/State.cpp \rn #mod_game/SceneMgr.cpp \rn #mod_game/PetManager.cpp \rn #mod_game/NPC.cpp \rn #mod_game/MonsterStateMachine.cpp \rn #mod_game/MonsterState.cpp \rn #mod_game/MonsterMgr.cpp \rn #mod_game/Monster.cpp \rn #mod_game/MedalMgr.cpp \rn #mod_game/ItemMgr.cpp \rn #mod_game/GuildMgr.cpp \rn #mod_game/GemMgr.cpp \rn #mod_game/FightReferee.cpp \rn #mod_game/FightMgr.cpp \rn #mod_game/EquipMgr.cpp \rn #mod_game/handle_billing.h \rn #mod_game/handle_gate.h \rn #mod_game/ActivityMgr.h \rn #mod_game/ActivityBase.h \rn #mod_game/FightMgr.h \rn #mod_game/MedalMgr.h \rn #mod_game/MonsterState.h \rn #mod_game/TowerMgr.h \rn #mod_game/ArenaMgr.h \rn #mod_game/EquipMgr.h \rn #mod_game/FightReferee.h \rn #mod_game/GMCmd.h \rn #mod_game/ItemMgr.h \rn #mod_game/Monster.h \rn #mod_game/MonsterMgr.h \rn #mod_game/StateMachine.h \rn #mod_game/SweepMgr.h \rn #mod_game/TaskMgr.h \rn #mod_game/TeamMember.h \rn #mod_game/TemplateMgr.h \rn #mod_game/WingMgr.h \rn #mod_game/WorldBossActivity.h \rn #mod_game/WorldBossActivitySingleton.h \rn #mod_game/WorldBoss.h \rn #mod_game/FriendListMgr.h \rn #mod_game/GameLineMgr.h \rn #mod_game/GemMgr.h \rn #mod_game/MonsterStateMachine.h \rn #mod_game/PetManager.h \rn #mod_game/SceneMgr.h \rn #mod_game/SkillMgr.h \rn #mod_game/Team.h \rn #mod_game/VIPMgr.h \rn #mod_game/XuanShang.h \rn #mod_game/FuncOpenMgr.h \rn #mod_game/NPC.h \rn #mod_game/State.h \rn #mod_game/CharsetConverter.cpp \rn #mod_game/CharsetConverter.hrn #@rm -f $@rn #g++ $(CFLAGS) $(SHARED) -o $@ $^ -Iinclude/libshaco -Inet -Ibase -Itplt -Imod -Imsg -Imsg/Message -Imod_game -I3rd -I3rd/tinyXml -Imsg/iconv $(LDFLAGS) -liconv -ltplt -ltinyxmlrnrn$(bin_dir)/mod_robotcli.so: $(mod_dir)/mod_robotcli.cpprn g++ $(CFLAGS) $(SHARED) -o $@ $^ -Iinclude/libshaco -Inet -Ibase -Imod -Imsg -Imsg/Messagernrn$(bin_dir)/libtinyxml.so: \rn 3rd/tinyXml/tinystr.h \rn 3rd/tinyXml/tinyxml.h \rn 3rd/tinyXml/tinystr.cpp \rn 3rd/tinyXml/tinyxml.cpp \rn 3rd/tinyXml/tinyxmlerror.cpp \rn 3rd/tinyXml/tinyxmlparser.cpprn @rm -f $@ rn g++ $(CFLAGS) $(SHARED) -o $@ $^ -Imsgrnrnt: main/test.c persist/mysqlc.c persist/mysqlc.hrn gcc $(CFLAGS) -o $@ $^ -Iinclude/libshaco -Imsg -Inet -Ibase -Ielog -Ipersist -I3rd $(LDFLAGS) -lrt -lbase -lshaco -lnet -llua -lmysqlclientrnrn#robot: main/robot.c cnet/cnet.c cnet/cnet.h net.sorn #gcc $(CFLAGS) -o $@ $^ -Icnet -Inet -Ibase -Imsg -Wl,-rpath,. net.sornrn# resrnres:rn @rm -rf $(HOME)/.shaco/excelrn @mkdir -pv $(HOME)/.shaco/excelrn @mkdir -pv ./resrn @rm -rf ./res/tblrn @mkdir -pv ./res/tblrn @rm -rf ./res/tpltrn @mkdir -pv ./res/tpltrn @mkdir -pv ./datadefinern @rm -rf ./datadefine/tplt_struct.hrn @rm -rf $(HOME)/.shaco/excel/*rn @svn export $(SHACO_SVN_RES)/02.项目数值 $(HOME)/.shaco/excel/02.项目数值 --forcern @svn export $(SHACO_SVN_RES)/工具 $(HOME)/.shaco/excel/tool --forcern @PWD_PATH=`pwd`rn @cd $(HOME)/.shaco/excel/tool && python CreateXmlFromExcel.pyrn @du -ah $(HOME)/.shaco/excel/02.项目数值 |grep xlsx$$ | awk 'print "cp -f " $$2 " $(HOME)/.shaco/excel"'|bashrn# @rm -rf $(HOME)/.shaco/excel/tmprn# @svn export $(SHACO_SVN_RES)/工具/ServerExcelFiles $(HOME)/.shaco/excel --forcern# @svn export $(SHACO_SVN_RES)/工具/Database.xml $(HOME)/.shaco/excel/excelmake_server.xml --forcern @cp $(HOME)/.shaco/excel/tool/Database.xml $(HOME)/.shaco/excel/excelmake_server.xml rn @cd $(PWD_PATH)rn @cd tool && \rn python convert_excel.py \rn $(HOME)/.shaco/excel/excelmake_server.xml \rn $(HOME)/.shaco/excel tbl=../res/tbl:c=../res/tplt && \rn python concat.py ../res/tplt ../datadefine/tplt_struct.h && \rn rm -rf ../res/tpltrnrn# thirdlibrnthirdlib:rn @__=`pwd` && cd third && $(MAKE) dist DIST_PATH=$$__/thirdlibrnrn# for clientrnclient: cnet.dll tplt.dllrnrnclient_bin=\rn cnet.dll \rn cnet.lib \rn tplt.dll \rn tplt.lib \rn tplt.defrnrncnet_src=\rn cnet/cnet.c \rn cnet/cnet.hrnrncnet.dll: $(net_src) $(cnet_src)rn gcc $(CFLAGS) -shared -o $@ $^ -Inet -Imsg -lws2_32 \rn -Wl,--output-def,cnet.def,--out-implib,cnet.librn LIB /MACHINE:IX86 /DEF:cnet.defrnrntplt.dll: $(tplt_src)rn gcc $(CFLAGS) -shared -o $@ $^ -Itplt \rn -Wl,--output-def,tplt.def,--out-implib,tplt.librn LIB /MACHINE:IX86 /DEF:tplt.defrnrntestclient: main/testclient.c $(tplt_src) datadefine/tplt_struct.hrn gcc $(CFLAGS) -o $@ $^ -Itplt -Idatadefinernrnclient_dir=D:/wa-client/trunkrninstall_dir=$(client_dir)/driller/proj.win32/Debug.win32rninstall_dir_rel=$(client_dir)/driller/proj.win32/Release.win32rnsource_dir=$(client_dir)/driller/Classesrntool_dir=$(client_dir)/toolrninstall:rn cp $(client_bin) $(install_dir)rn cp $(client_bin) $(install_dir_rel)rn cp -r net $(source_dir) rn cp -r cnet $(source_dir)rn cp -r main/robot.c $(source_dir)/cnetrn mkdir -pv .mod_roomrn for file in `ls mod_room`; do iconv -f utf-8 -t gbk mod_room/$$file > .mod_room/$$file; done rn cp -r .mod_room/* $(source_dir)/maprn rm -rf .mod_roomrn #cp -r msg $(source_dir)rn mkdir -pv .msgrn for file in `ls msg`; do iconv -f utf-8 -t gbk msg/$$file > .msg/$$file; done rn cp -r .msg/* $(source_dir)/messagern rm -rf .msgrn cp -r tplt $(source_dir)rn cp -r tool/concat.py tool/convert_excel.py tool/excelto $(tool_dir)rnrn# cleanrnclean:rn rm -f $(all_t) mod_game/*.ornrncleanall: cleanrn rm -rf cscope.* tagsrn rm -rf resrn rm -rf datadefinern find . -name "*.pyc" | xargs -i rm -f rnrn 论坛

没有更多推荐了,返回首页