Trouble building P4Python with P4API - perforce

I'm trying to build P4Python, as described here and a more recent version found here. I have the P4 API located at C:\p4api. I have set the p4_api variable correctly in setup.cfg. While in C:\P4Python-2010.1, which is where P4Python is extracted, I run the command C:\P4Python-2010.1>python setup.py install > log.txt to install it.
However, I get a ton of unresolved externals as shown in log.txt (these are only a few):
P4Result.obj : error LNK2019: unresolved external symbol "private: static char * StrBuf::nullStrBuf" (?nullStrBuf#StrBuf##0PADA) referenced in function __ehhandler$?Fmt#P4Result##AAEXPBDPAU_object##AAVStrBuf###Z
PythonMergeData.obj : error LNK2001: unresolved external symbol "private: static char * StrBuf::nullStrBuf" (?nullStrBuf#StrBuf##0PADA)
P4MapMaker.obj : error LNK2001: unresolved external symbol "private: static char * StrBuf::nullStrBuf" (?nullStrBuf#StrBuf##0PADA)
P4API.obj : error LNK2001: unresolved external symbol "private: static char * StrBuf::nullStrBuf" (?nullStrBuf#StrBuf##0PADA)
I have no idea where it's looking to find these things or where they should be. I added the P4API directory to PATH, and I still get the errors. Any help is greatly appreciated.

In addition to the Python release could you also provide the P4API (exact Version string) you are using?
By thy way, you can make your life easier by going to the Perforce public to find pre-built binary releases here:
http://public.perforce.com:8080/guest/sven_erik_knop/P4Pythonlib/bin/?ac=83
Kind regards
Sven Erik
PS:
You can also contact support#perforce.com for any questions relating to Perforce and the P4API.

Yep: https://swarm.workshop.perforce.com/projects/p4pythonlib/files/p4pythonlib/bin
By the way, p4python is now in the PyPi archives, so you could simply use (for Python 2.7, 3.3 and 3.4, both 32 and 64 bit)
pip install p4python

this is new repo location on github,
https://github.com/perforce/p4python
according to
https://github.com/perforce/p4python/blob/master/RELNOTES.txt
since 2015 it can be installed via pip
Installation via pip
P4Python can be installed via pip from 2015.1 onwards. Simply run the command
pip install p4python

Related

how to compile pymqe.c for Python3?

I managed to process module pymqe.c into pymqe.pyd for Python2 using VC 2017 compiler and my own make file. Unfortunately, it doesn’t work for Python3. If I try compile module pymqe.c from pymqi-1.9.3.tar.gz in the same way, the linking step fails with the error message:
LINK : error LNK2001: unresolved external symbol initpymq
pymqe.lib : fatal error LNK1120: 1 unresolved externals
My make file contains the following instruction to link pymqe.c with the resulting library pymqe.pyd:
/EXPORT:initpymqe pymqe.obj
I assume, the function initpymqe is excluded during compilation for Python3 due to pre-compiler instruction in the source code of the module pymqe.c:
#if PY_MAJOR_VERSION==2
void initpymqe(void) {
…
#else
Does anyone know, how to handle this problem?

How to compile Urho3D's submodule for HoloLens

There is a readme here
But it doesn't cover compilation of the submodule for HoloLens.
The developer lists these steps (from various posts this thread in xamarin forums)
git clone git#github.com:xamarin/urho.git
git submodule update --init
// make sure Urho3D/Source folder is not empty
run 'make HoloLens'
open the solution and build UrhoSharp.HoloLens (Release, x86 configuration)
Doing this mostly works, but the final step results in two unresolved externals:
Error LNK2001 unresolved external symbol "void __cdecl WINRT_InitGameBar(struct SDL_VideoDevice *)" (?WINRT_InitGameBar##YAXPAUSDL_VideoDevice###Z) UrhoSharp.HoloLens C:\urho\Urho3D\Urho3D_HoloLens\UrhoSharp.HoloLens\SDL_winrtvideo.obj
and
Error LNK2001 unresolved external symbol "void __cdecl WINRT_QuitGameBar(struct SDL_VideoDevice *)" (?WINRT_QuitGameBar##YAXPAUSDL_VideoDevice###Z) UrhoSharp.HoloLens C:\urho\Urho3D\Urho3D_HoloLens\UrhoSharp.HoloLens\SDL_winrtvideo.obj
These two functions are in this file.
How do I track down and/or resolve these errors?
I'm not sure how to interpret and/or address the error.
The developer put changes into the code base and this issue no longer occurs.

VS2013 VC++ libcurl LNK2028 LNK2019 linking errors

I'm trying to get Libcurl working in my VC++ project on VS2013 Community. I've been toiling with this for many hours, and I've tried essentially everything on Stack and Google about it, to no avail.
My most recent attempt was sparked by this answer, that mentions libcurl as a Nuget package. This is good, because it comes with all of the .lib files required. I have however run into the same problem as this fellow, in that I'm getting a linker error.
I'm importing the following libraries as 'Additional Dependencies' in the Project Configuration settings under Linker -> Input:
libcurl.lib;libeay32.lib;ssleay32.lib;Ws2_32.lib;libssh2.lib;zlib.lib;wldap32.lib;
Obviously, each one of these .lib files is in a different directory inside the nuget package folder inside the project folder, so under Linker -> General my 'Additional Library Directories' is set to:
"PATHTOPROJECT\packages\curl.7.30.0.2\build\native\lib\v110\x64\Release\static";
"PATHTOPROJECT\packages\zlib.1.2.8.1\build\native\lib\v110\Win32\Release\static\cdecl";
"PATHTOPROJECT\packages\openssl.1.0.1.21\build\native\lib\v110\x64\Release\static\cdecl";
"PATHTOPROJECT\packages\libssh2.1.4.3.1\build\native\lib\v110\x64\Release\static\cdecl";
I am trying to use static libraries, because I don't want to drag .dll's with my project executable if I can avoid it. It's also worth noting that my most recent attempt at using libcurl also includes SSL and whatnot, but I don't actually need those extras. Really, I just need a static libcurl library, but I can't find or compile one it seems.
In my code, I'm also using this include: #include "curl/curl.h"
I've also added the Additional Include directory correctly under 'Additional Include Directories' under C/C++ -> General:
PROJECTPATH\packages\curl.7.30.0.2\build\native\include
Now, this all compiles fine as long as I don't try and use curl in the project code.
So, the errors when I do try and use curl in the code:
CURL *curl;
curl = curl_easy_init();
That piece of code generates these errors:
1>Main.obj : error LNK2028: unresolved token (0A000453) "extern "C" void * __cdecl curl_easy_init(void)" (?curl_easy_init##$$J0YAPAXXZ) referenced in function "private: class System::String ^ __clrcall Project::Main::CurlRequest(class System::String ^,class System::String ^,class System::String ^,class System::String ^)" (?CurlRequest#Main#Project##$$FA$AAMP$AAVString#System##P$AAV34#000#Z)
1>Main.obj : error LNK2019: unresolved external symbol "extern "C" void * __cdecl curl_easy_init(void)" (?curl_easy_init##$$J0YAPAXXZ) referenced in function "private: class System::String ^ __clrcall Project::Main::CurlRequest(class System::String ^,class System::String ^,class System::String ^,class System::String ^)" (?CurlRequest#Main#Project##$$FA$AAMP$AAVString#System##P$AAV34#000#Z)
There is of course more to my curl using code, but that bare minimum shows the basics of the linking error. What can I do to fix this? As I mentioned before I've tried a whole range of solutions, some of which I'll list below:
Many answers to the questions regarding problems using libcurl in VS projects mention downloading libcurl from http://curl.haxx.se/latest.cgi?curl=win32-devel-msvc, but that link doesn't work as of now, so I can't use it.
More answers say to just compile libcurl from source. The source comes with .vcproj files, none of which compile for me without hundreds of errors, so that's out.
Solved.
This Github project is a .bat file that downloads the libcurl source, compiles it, and makes the libraries (both static and dynamic). Importing the static library created by this (libcurl_a.lib) and using it in my project along with the include directory has worked.
I'll leave this question with an unaccepted answer in case someone can provide other helpful steps that would have fixed the problem I had in using the nuget package installation.
Finally.

SFML linker problems on eclipse VC++

I am trying to use the SFML library for audio in my project.
I am developing in eclipse juno for c++ and am using SFML v1.6.
I added sfml-audio-d.lib, sfml-main-d.lib, and sfml-system-d.lib into
C/C++ General > paths and symbols>libraries
I also defined a macro named SFML_DYNAMIC into
C/C++ Build>Settings>C++ Compiler>Preprocessor 'Defines /D' section
I added the directory that contains all the dlls into the PATH environment variable.
In my code I make use of sf::SoundBuffer, but when I try to build the project I get the following linker error:
Chunk.obj : error LNK2001: unresolved external symbol "private: static class sf::SoundBuffer * Chunk::breakBlockSound" (?breakBlockSound#Chunk##0PAVSoundBuffer#sf##A)
MyProject.exe : fatal error LNK1120: 1 unresolved externals
Had to rebuild the project in VS2010 before using it. Works now.

v8 release mode linker error with winsock

This subject became a side subject after I accepted an answer for my last question, so I will put it here as a separate topic for neatness, and I believe this will make it more useful for others.
I am working on MS visual studio 2005.
I am building a project using v8 in release mode, and am receiving a linker error that is related to winsock even though the winsock libraries are already in my additional dependencies.
My additional dependencies list is the same for both release and debug mode. It works perfectly in debug mode, and I am getting the linker errors only in release mode.
here is my additional dependencies string:
Ws2_32.lib wininet.lib rasapi32.lib iphlpapi.lib Psapi.lib winmm.lib wsock32.lib msvcrt.lib $(SolutionDir)\external_libs\debug\v8.lib $(SolutionDir)external_libs\release\v8_base.lib $(SolutionDir)external_libs\release\v8_snapshot.lib
Thanks a lot for any possible help.
Update:
I reduced the dependencies to:
Ws2_32.lib Psapi.lib winmm.lib msvcrt.lib $(SolutionDir)\external_libs\release\v8.lib $(SolutionDir)external_libs\release\v8_base.lib
and still get unresolved externals:
1>v8_base.lib(platform-win32.obj) : error LNK2001: unresolved external symbol __imp__freeaddrinfo#4
1>v8_base.lib(platform-win32.obj) : error LNK2001: unresolved external symbol __imp__getaddrinfo#16
1>v8_base.lib(platform-win32.obj) : error LNK2001: unresolved external symbol __set_abort_behavior
You have paths to both debug and release folders in your dependency list. Try replacing those with $(Configuration).

Resources