g ++:不带-l标志进行编译 [英] g++: Compiling without -l flags

查看:103
本文介绍了g ++:不带-l标志进行编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题-在编译期间这些方法是否不必调用库?我的意思是,我只想简单地调用g ++ main.cpp而不调用g ++ main.cpp -lGL -lGLU -lGLEW -lSTL -lMyMother等...我知道,makefile文件或简单的shell脚本,但是我想优雅的方式-在cpp代码中调用这些库-类似于使用GL;".

Simple question- are these any way to not have to call libraries during the compiling? I mean, I would like to simply call g++ main.cpp without calling g++ main.cpp -lGL -lGLU -lGLEW -lSTL -lMyMother and so on... I know, makefiles or simple shell scripting, but I would like to make it elegant way - call these libraries inside cpp code - something like 'using GL;'.

推荐答案

由于使用的是GCC,因此您可以创建/修改

Since you're using GCC, you could create/modify a specs file to add the flags you want.

但是,如果您不喜欢输入标志,则确实应该使用makefile.

If you don't like typing flags, you really should be using a makefile, though.

这篇关于g ++:不带-l标志进行编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆