mailRe: Development of the relax-disp branch.


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Troels Emtekær Linnet on May 11, 2013 - 12:42:
Hi Edward.

Sigh.

I have looked around for 
"error LNK2019: unresolved external symbol"
and it seems that many experience the problem.

But there don't seem to be an universal explanation/bug fix.
And if I find a thing I would like to try, I really don't know where to start. ? :-)

- "In Visual-Studio most linkage problems are related to forget adding .cpp files."
- Url 2,  Url3, Url4, Url5, Url6

In the last Url, there is this solution:
---
in the Project properties, set the Platform Toolset to VS2008 (v90) and the correct directories depending on your installation (ie : include => C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;$(IncludePath) and Libraries => C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64;$(LibraryPath)). Don't forget to set the .lib in Link entries.
---

After installation of Visual Studio 2012, I do have the folder:
C:\Program Files (x86)\Windows Kits\8.0

I have  attached a text file, how I have installed until now.

I hope we can break this "annoying behaviour?"
Where should I look, if .ccp files is added ??

Best
Troels
------------------------

C:\Python27\github\relax_disp>scons clean_all
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
clean_manual_files(["manual_clean"], [])

##########################################
# Cleaning up the temporary manual files #
##########################################






clean_files(["clean"], [])

###############################
# Cleaning up temporary files #
###############################



Removing the files ending in ['pyc', 'pyo', 'bak', 'o', 'os', 'obj', 'exp', 'lib
'].

Removing temporary relax save state files (of the form relax_state_xxxxxxxx_xxxx
xx.bz2).

Removing the Python 3 __pycache__ directories.





clean_all_files(["clean_all"], [])

#########################
# Cleaning up all files #
#########################



Removing the files ending in ['so', 'sconsign', 'dll', 'pyd'].





scons: done building targets.

C:\Python27\github\relax_disp>scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...




###########################
# Compiling the C modules #
###########################


Building the relaxation curve fitting module 'target_functions\\relax_fit.pyd'

cl /Fotarget_functions\c_chi2.obj /c target_functions\c_chi2.c /nologo /I"C:\Pyt
hon27\Scripts\..\include"
c_chi2.c
cl /Fotarget_functions\exponential.obj /c target_functions\exponential.c /nologo
 /I"C:\Python27\Scripts\..\include"
exponential.c
cl /Fotarget_functions\relax_fit.obj /c target_functions\relax_fit.c /nologo /I"
C:\Python27\Scripts\..\include"
relax_fit.c
c:\python27\github\relax_disp\target_functions\relax_fit.c(137) : warning C4700:
 uninitialized local variable 'params' used
link /nologo /dll /out:target_functions\relax_fit.pyd /implib:target_functions\r
elax_fit.lib /LIBPATH:C:\Python27\libs target_functions\c_chi2.obj target_functi
ons\exponential.obj target_functions\relax_fit.obj
   Creating library target_functions\relax_fit.lib and object target_functions\r
elax_fit.exp
relax_fit.obj : error LNK2019: unresolved external symbol __imp__PyFloat_FromDou
ble referenced in function _func
relax_fit.obj : error LNK2019: unresolved external symbol __imp__PyFloat_AsDoubl
e referenced in function _setup
relax_fit.obj : error LNK2019: unresolved external symbol __imp__PyList_New refe
renced in function _back_calc_I
relax_fit.obj : error LNK2019: unresolved external symbol __imp__PyList_SetItem
referenced in function _back_calc_I
relax_fit.obj : error LNK2019: unresolved external symbol __imp__PyArg_ParseTupl
e referenced in function _func
relax_fit.obj : error LNK2019: unresolved external symbol __imp__PyArg_ParseTupl
eAndKeywords referenced in function _setup
relax_fit.obj : error LNK2019: unresolved external symbol __imp__Py_InitModule4
referenced in function _initrelax_fit
relax_fit.obj : error LNK2019: unresolved external symbol __imp__PySequence_GetI
tem referenced in function _setup
relax_fit.obj : error LNK2019: unresolved external symbol __imp___Py_NoneStruct
referenced in function _setup
target_functions\relax_fit.pyd : fatal error LNK1120: 9 unresolved externals
scons: *** [target_functions\relax_fit.pyd] Error 1120
scons: building terminated because of errors.

C:\Python27\github\relax_disp>python
Enthought Python Distribution -- www.enthought.com
Version: 7.3-2 (64-bit)

Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 15:20:16) [MSC v.1500 6
4 bit (AMD64)] on win32
Type "credits", "demo" or "enthought" for more information.
>>> import sys
>>> from os import path
>>> print sys.prefix + path.sep + 'include'
C:\Python27\include
>>>
C:\Python27\github\relax_disp>dir C:\Python27\include\Python*
 Directory of C:\Python27\include

15-04-2013  00:37            21.113 Python-ast.h
15-04-2013  00:37             4.329 Python.h
15-04-2013  00:37             7.339 pythonrun.h
               3 File(s)         32.781 bytes
               0 Dir(s)  60.963.274.752 bytes free

C:\Python27\github\relax_disp>
----------------------------
Install python and necessary packages
----------------------------
I recommend to install a python distribution which is packed with several 
packages already.

You could consider winpython, and includes Ipython: 
https://code.google.com/p/winpython/

I personally use EPD.
If you have a uni mail, the Enthought Python Distribution it is free of 
charge, and includes Ipython.
That have solved all my dependency problems since then, and the packages I 
need more, I install with pip, or github.

Register at http://www.enthought.com/. 
When you have registered, and logged in to the homepage, navigate to 
https://www.enthought.com/repo/epd/installers/
Install "EPD", and not the Canopy software. (As of may 2013, Canopy was still 
suffering from being quite new.)

Make sure, that the path to python scripts are included in your PATH, which 
can be changed in computer Environment Variables.
Include in path: C:\Python27;C:\Python27\Scripts

To install packages:
Open a cmd window.
easy_install pip
pip search lmfit
pip install lmfit
pip freeze    (to see installed packages)
If you have problems, check your path, Write in command
path
where python
where easy_install

----------------------------
Install scons for building
----------------------------
Some packages in EPD, can be a version old. So install the newest scons.
Get the Windows Installer from: http://www.scons.org/download.php
As of May 2013, this was version 2.3
Due to a bug, versions of scons <=2.3 should alter a line in:
C:\Python27\Lib\site-packages\scons-2.3.0\SCons\Tool\MSCommon\vc.py
Line 364: if not req_target_platform and target_platform in 
('amd64','x86_64'):
Should be: if target_platform in ('amd64','x86_64'):

----------------------------
Install Visual Studio Express 2012 
----------------------------
From 
http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products
Download: 
http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop
Make sure the path to the compiler "cl" is in your PATH.
Include in path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
For a test, start a cmd. And write:
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall"       
(Sets variables right)
cl    (Just to test)

----------------------------
Install minfx and Subversion checkout of relax
----------------------------
Download "minfx" from http://download.gna.org/minfx/
Unzip latest version.
In the unpacked folder, hold "Shift", right-click, "Open command window here"
python setup.py install

Install a subversion client.
For example: http://tortoisesvn.net/
Right click in any folder, and select:
SVN Checkout. Write the path:
svn://svn.gna.org/svn/relax/trunk
svn://svn.gna.org/svn/relax/branches/relax_disp/

----------------------------
Build relax
----------------------------
Navigate to the folder where you have checked out relax
In the folder, hold "Shift", right-click, "Open command window here"
scons

BUILD PROBLEMS

----------------------------
Coding environment
----------------------------
A lightweight editor, could be pyscripter.
This helps with syntax high-lighting and includes the interpreter.
Install from:
https://code.google.com/p/pyscripter/
Remember to check that indention is set to equal 4 spaces "    ", under 
Tools/Options/Editor Options
Also set: Run/Python Engine/Remote (Tk)  (Matplotlib uses the Tk)

Test that everything is working, for example by this script, and hit the 
green play button.
--
from pylab import *
a = array(range(10))
b = 10*a
plot(a,b)
show()

Related Messages


Powered by MHonArc, Updated Sat May 11 17:00:08 2013