LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 04-28-2010, 04:47 AM   #1
venkat_k
Member
 
Registered: Sep 2008
Posts: 36

Rep: Reputation: 15
Link errors: "ld: fatal: option -dn and -P are incompatible"


I am trying port a linux application to Solaris.
Getting the following error messages during linking
-------
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status
------------

Please tell me whats wrong with it?
 
Old 04-28-2010, 10:45 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Perhaps these options are designed to work with a different linker than the Solaris one. In any case, you need to remove one of them for the command to succeed with Solaris ld.
 
Old 04-28-2010, 11:15 PM   #3
venkat_k
Member
 
Registered: Sep 2008
Posts: 36

Original Poster
Rep: Reputation: 15
The issue is i am not at all using those options.
I have a Makefile to build the application in Linux, i am trying to use the same to build on Solaris. I am not using either -dn or -P options as part of this.
 
Old 04-29-2010, 12:17 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
You mean these options do not appear in the Makefile ??
 
Old 04-29-2010, 12:26 AM   #5
venkat_k
Member
 
Registered: Sep 2008
Posts: 36

Original Poster
Rep: Reputation: 15
Yes.
 
Old 04-29-2010, 12:59 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Then it does probably appear in other Makefiles or whatever files are used to build your application.
 
Old 04-29-2010, 04:45 AM   #7
venkat_k
Member
 
Registered: Sep 2008
Posts: 36

Original Poster
Rep: Reputation: 15
Even i tried to ran the same manually from the command line.

Here is the command:
gcc *.o -o app.exe -lstdc++ -lpthread -Wl,-rpath

This is giving the error message "ld: fatal: option -dn and -P are incompatible"

Please have a look at the command. Am i doing any thing wrong over there?
 
Old 04-29-2010, 05:01 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Well, you are using a C compiler but link with the C++ library and give a DOS extension to your binary. While the latter is not a real issue but just confusing, you should be consistent with the language used.

Is your source code C or C++ ?
What Solaris release are you using ?
What Gnu compiler version ?
Are there specific environment variables set in your shell like LD_OPTIONS ?
 
Old 10-14-2010, 07:31 AM   #9
pramodsw
LQ Newbie
 
Registered: Oct 2010
Posts: 1

Rep: Reputation: 0
I am also facing the same issue.
i.e:
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status


How did you solve this ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
"Shutdown" and "Restart" option missing after upgrade hansalfredche Mandriva 8 11-02-2006 07:23 AM
"NIM thread blocked" & "Deadman Switch (DMS) close to trigger" errors sosborne Linux - Networking 1 06-28-2006 02:07 PM
FATAL error: "Thermal" and "Fan" ibex Linux - Hardware 1 06-22-2006 06:31 AM
anging "Protocol" option to "IMPS/2" in XF86Config-4 causes problems zstingx Linux - General 2 10-27-2003 09:47 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 04:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration