NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

How change linker options?

 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
Nicilled



Joined: 08 Nov 2011
Posts: 2

PostPosted: Tue Nov 08, 2011 5:16 pm    Post subject: How change linker options? Reply with quote

How can i change linker options? I need use object files before i link libraries. I have in command line of linker:
-o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o -lboost_filesystem -lboost_system
and output is:
g++ -o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o -lboost_filesystem -lboost_system -o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o

And i want output like this:
g++ -o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o -lboost_filesystem -lboost_system

What i must change in linker option to get this? Confused

If i have in command line only:
-lboost_filesystem -lboost_system
output is:
g++ -lboost_filesystem -lboost_system -o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o
and this is wrong. Exclamation
Back to top
Vladimir Voskresensky - O
Posted via mailing list.





PostPosted: Wed Nov 09, 2011 9:16 am    Post subject: How change linker options? Reply with quote

you should put
-lboost_filesystem -lboost_system

not into linker "additional options", but click in "Libraries" field, then Add
Option, then Other Option and put

-lboost_filesystem -lboost_system

Hope it helps,
Vladimir.

On 08.11.11 20:16, Nicilled wrote:
Quote:
How can i change linker options? I need use object files before i link libraries. I have in command line of linker:
-o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o -lboost_filesystem -lboost_system
and output is:
g++ -o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o -lboost_filesystem -lboost_system -o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o

And i want output like this:
g++ -o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o -lboost_filesystem -lboost_system

What i must change in linker option to get this? :?

If i have in command line only:
-lboost_filesystem -lboost_system
output is:
g++ -lboost_filesystem -lboost_system -o dist/Debug/GNU-Linux-x86/test-boost build/Debug/GNU-Linux-x86/main.o
and this is wrong. [Exclamation]



Back to top
Nicilled



Joined: 08 Nov 2011
Posts: 2

PostPosted: Wed Nov 09, 2011 2:19 pm    Post subject: Reply with quote

Thanks. It helps. Smile
Back to top
TTorai



Joined: 20 May 2012
Posts: 1

PostPosted: Sun May 20, 2012 4:13 pm    Post subject: Re: How change linker options? Reply with quote

Thank You very much!

Your tip resolved my problem too: undefined reference to `mysql_init'

click in "Libraries" field, then Add
Option, then Other Option and put -lmysqlclient







Vladimir Voskresensky - O wrote:
you should put
-lboost_filesystem -lboost_system

not into linker "additional options", but click in "Libraries" field, then Add
Option, then Other Option and put

-lboost_filesystem -lboost_system
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo