PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Unresolved external symbol __environ

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
braden



Joined: 18 Jun 2012
Posts: 1

PostPosted: Mon Jun 18, 2012 2:49 pm    Post subject: Unresolved external symbol __environ Reply with quote

Hi all,

Let me preface by saying I'm not a Fortran guy. This is my first time even using PGI. I have some code that was developed by someone else and I'm trying to integrate it into a MFC C++ application. I've created a static library (compiled with pgf90) but I'm having an issue with linkage. I finally managed to track down almost all the libraries I was missing, but now I seem to be left with the following errors (VS2008):

error LNK2019: unresolved external symbol __environ referenced in function _pgf90_compiled
error LNK2001: unresolved external symbol __environ

I found only one similar problem on the forums here: http://www.pgroup.com/userforum/viewtopic.php?t=2527&sid=60baba80803b7dce6ec62038286a025a

Much like the OP in that posting, I originally had a name mangling problem. I was able to correct that both using the -Miface=unix and by fixing it from the calling code. Like him, I also hit a lot of unresolved externals that were mostly cleaned up by linking in libpgsse1 and libpgsse2. I don't really understand how to fix this issue, though.

Any help would be greatly appreciated.
Back to top
View user's profile
toepfer



Joined: 04 Dec 2007
Posts: 50

PostPosted: Tue Jun 19, 2012 10:00 am    Post subject: Reply with quote

The __environ is a global from the MS C run-time and is expected to be resolved
from some MS static library (could be libcmt.lib). It appears that whatever linking process
is being used it doesn't include the static version of that library, but rather its corresponding DLL. You might try creating a DLL version of the pgf90 code which should cause the __environ extern to be imported from the appropriate MS DLL.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
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


Powered by phpBB © phpBB Group