How to build TkTreeCtrl on Windows 10 using VS 2019 tools? - visual-c++

I'm able to compile both Tcl and Tk just fine on Windows 10 using Visual Studio 2019 developer command prompt. Both have win\makefile.vc file. nmake -f makefile.vc will build them successfully.
However, TkTreeCtrl source code located at the following location doesn't seem to have makefile.vc anywhere.
https://sourceforge.net/projects/tktreectrl/files/tktreectrl/tktreectrl-2.4.1/tktreectrl-2.4.1.tar.gz/download
I had compiled TkTreeCtrl successfully several years ago. But I can't for the life of me remember how I did it!

The fork from https://github.com/apnadkarni/tktreectrl contains the makefile for the new Windows build system of Tcl.

I have just successfully built it under windows10 with MSYS2/Mingw64 from the source https://github.com/apnadkarni/tktreectrl just as the suggestion of #Eric. But need some changes in configure to make it work.
for tktreectrl\configure
- *win32*|*WIN32*|*MINGW32_*)
+ *win32*|*WIN32*|*MINGW32_*|*MINGW64_*)
- vars="gdi32.lib user32.lib"
+ vars="gdi32.lib user32.lib UxTheme.lib"
- RC_DEPARG='"$(shell $(CYGPATH) $<)"'
+ RC_DEPARG='"$<"'
for tktreectrl\shellicon\configure
- *win32*|*WIN32*|*MINGW32_*)
+ *win32*|*WIN32*|*MINGW32_*|*MINGW64_*)
- RC_DEPARG='"$(shell $(CYGPATH) $<)"'
+ RC_DEPARG='"$<"'
Then, you just need to ./configure && make install

Related

Opening the code generated from CMake

I am trying to build Assimp to use in visual studio 2012.
Following the instructions on their website: http://assimp.sourceforge.net/lib_html/cmake_build.htm I have tried to build assimp, however I am stuck on the last step "Open the generated solution/project files and have fun"
This is the build folder which was created by CMake - http://puu.sh/fq8kp/cc16e985c3.png
Following the advice of another tutorial I opened this in the terminal and tried to type "make" and launch it. However there isnt a make file so this didnt work. I also typed "install" as there is an install file, however this also did not work.
The tutorial goes as follows:
Type "make" and launch it; you should see the build progressing without issues
When the build is finished, type "sudo make install"; it will ask for your password and install the library!
Any help would be much appreciated!
the 'generated solution/project' in your case (windows) would be the Assimp.sln file. You generated a visual studio solution, so you have to use Visual Studio to build the application.
According to your screenshot, the Assimp.sln file is the 9 KB sized file underneath the one with size 45,120 KB

I cannot compile Z3 using Visual C++ & gcc

I'm starter Z3 so my question may be too basic.
But If you let me know some information for my question, I'm very happy.
I searched before history in this site.
But I couldn't get detailed information for me. ( because maybe..my question is too basic..)
[using Visual C++]
1) First of all, I downloaded "z3 4.3.0 for window" at codePlex site.
But this file doesn't have example file(test_capi.c).
So I got "z3-89c1785b73225a1b363c0e485f854613121b70a7.zip" for example file.
( I cannot remember what I can get... :( )
I succeeded compiling python file as codeplex site quide.
But I cannot compile test_capi.c using Visual C++.
I also added "test_capi.c" at "z3 4.3.0 for window" folder but I cannot also compile.
Lastly, I just tried using "test_capi.vcxproj" of "z3-src-4.1.1" and this is succeeded.
I cannot understand.
If i want to test "my file", what file is needed at "z3 4.3.0 for window"?
Or
Do I have to use only "z3 4.1.1" for visual c++ and add "my file" at some location of "z3 4.1.1"? ( All files of Z3 4.1.1 is needed?? AND what is the Some location?)
I read other some comment - "Z3 4.3.0" is simplified.
I understood this comment that I can use only "z3 4.3.0" and test successfully.
But as i told you, I cannot compile.
Please give me some information..
[using gcc in ubuntu]
First of all, I downloaded "z3-4.3.2.07d56bdc705c-x86-ubuntu-12.04.zip" from codeplex site.
Because I tried git command for getting source code but i cannot find source code.
( I also don't know the reason..)
Anyway... "z3-4.3.2.07d56bdc705c-x86-ubuntu-12.04.zip" doesn't have any example file and only bin & include folder is existed.
So I also used "z3 4.1.1" but i cannot compile using below command.
gcc -fopenmp -o test_capi -I ../../Include -L ../../lib test_capi.c -lz3-gmp
Error is "cannot find -lz3-gmp."
In some comment, I found "use "sudo install"" but i don't know how i can install lz3.
(Of course only "sudo install" doesn't work and "sudo apt-get install z3" also doesn't work...)
For compiling "test_capi.c" using gcc, could you explain in detail..?
I'm confused many kinds of guide but i couldn't get basic information for me.
Thank you in advance and I hope to get information...even if my question is too basic..
First, you should use only one version of the source code. Version 4.1.1 is very old and newer versions do not come with test_capi.vcxproj anymore, instead everything is done via the Makefile. For the very latest version please use the unstable branch (e.g., by selecting unstable here and then clicking download.)
The examples can be compiled by calling nmake examples (on Windows) or make examples (on Linux) in the build directory. The makefile has a target called _ex_c_example which shows how to call the compiler for the C example. The various variables that this target uses are defined in build/config.mk. Note that these variables are set to different values on Windows and Linux (this file is produced by python scripts/mk_make.py).
The git command on many Linux distributions is not compatible with the codeplex git server (for a fix see here), but of course this is not necessary if you download the source code from the webpage directly.

Setting up Cygwin + Android NDK + cocos2Dx to work with Eclipse

I'm following a tutorial from this website: Monetizing Game Apps by Todd Perkins
Access to all the files are not required for the questions I'm asking. I have done research on how to solve this on stack overflow and discussed it below
I have followed the tutorial and it has asked me to:
Install Cygwin
Download Cocos2dx-2.0.1(I know this is old, but I don't want to deal with deprecating problems until I'm more confident with the environment)
Run create-android-project.bat(works fine).
Open project I created- and move to proj.android and run build_native.sh in Cygwin.
Then I open up cygwin.bat, navigate to myproject/proj.android and run ./build_native.sh
Problem:
$ ./build_native.sh
Using prebuilt externals
./build_native.sh: line 74: /cygdrive/c/android-ndk-r9c-windows-x86_64/ndk-build: No such file or directory
So I looked into the files and double-checked my changes:
In create-android-project.bat I modified the following variables:
set _CYGBIN=c:\Cygwin64\bin
set _ANDROIDTOOLS=c:\Program Files (x86)\ADT\adt-bundle-windows-x86_64-20130219\sdk\tools
set _NDKROOT=c:\android-ndk-r9c-windows-x86_64
Check line 74 that cygwin complained about in myproject/proj.android/build_native.sh:
echo "Using prebuilt externals"
$NDK_ROOT/ndk-build -C $GAME_ANDROID_ROOT \
NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt
Double check what NDK_ROOT is pointing to in build_native.sh:
NDK_ROOT=/cygdrive/c/android-ndk-r9c-windows-x86_64
COCOS2DX_ROOT=/cygdrive/c/Users/DarkRaveDev/Documents/cocos2d-x-2.0.1
GAME_ROOT=$COCOS2DX_ROOT/chaara
GAME_ANDROID_ROOT=$GAME_ROOT/proj.android
RESOURCE_ROOT=$GAME_ROOT/Resources
My Research:
I surfed SO for quite some time and tried the following from SO:
EOL Conversion in Notepad++ so LF works for windows for the build_native.sh
An answer somewhere said I need to install the make package when installing cygwin.. I'm not getting this problem, so I'm not sure if this applies.
I have searched many ways to set path - NDK_ROOT
QUESTION:
What exactly am I doing wrong? Is it the variables are badly set or is cygwin not properly installed?
Thank you to everyone who commented! :)
This is what I ended up doing.
Reinstall Cygwin : When you get to the select packages to install page, make sure to find DEVEL and change the install action from default to install. I know its a lot of megs but it's easier than combing through it. If you do want to comb through it and get only what you need, I suggest using this website: Installing a c++ compiler for windows
Make your paths simple : Like user2359247 suggested.
Finally run the create_android.bat, open your android project. Keep the path location of your build_native.sh file in mind and open your cygwin terminal.
Navigate to the path in cygwin, and run the file with sh build_native.sh: At this point everything was quite smooth sailing.
NOTE:
Also I kept using my version of ndk which is r9 instead of r8 in the tutorial, it didn't give me any hiccups.
Thank you SO!

RDCOMEvents package in R does not load - needed to run Excel / R communication example

Is there a version of the package RDCOMEvents that works in recent versions of R (2.14 or 2.15)?
I've been trying to get the example on the penultimate page of http://www.stat.berkeley.edu/~nolan/stat133/Fall05/lectures/DCOM.pdf to work - the one starting with the lines
library(RDCOMClient)
library(RDCOMEvents)
I can install RDCOMClient without a hitch, but not RDCOMEvents as it says that the package was built before R 2.10.0.
Any tips that can get me up and running very gratefully received... thanks :)
EDIT (16 July 2012):
Tried installing from the source as suggested, but no good (see below). Really disappointing that such an invaluable package seems to have been left to rot!
C:\mypackage>R CMD INSTALL RDCOMEvents_0.3-1.tar.gz
* installing to library 'C:/Users/timp/Documents/R/win-library/2.13'
* installing *source* package 'RDCOMEvents' ...
** libs
running src/Makefile.win ...
c:/MinGW/bin/g++ -g -Id:/duncan/Projects/R/R-check/src/include -D_GNU_ -DNO_PYCO
M_IPROVIDECLASSINFO -DUSE_R -Wno-deprecated -I. -c -o events.o events.cpp
events.cpp:12:18: fatal error: Defn.h: No such file or directory
compilation terminated.
make: *** [events.o] Error 1
ERROR: compilation failed for package 'RDCOMEvents'
* removing 'C:/Users/timp/Documents/R/win-library/2.13/RDCOMEvents'
EDIT 2 (16 July 2012):
RExcel has been suggested as an alternative approach - can anyone point me to an RExcel example where buttons/handlers in the sheet are generated from within R (as in the example quoted above), rather than the spreadsheet designer having to grapple with VBA code within the spreadsheet? Given that this R-centric approach was possible a few years ago, it must surely still be possible now... somehow...
Well, you could try installing the packages from source code which is available for both packages here and here.
Once you've unpacked the archives you can build and install them using R from the command-line, e.g.
R CMD install RDCOMClient
or
R CMD install RDCOMEvents
Unfortunately the build fails on my system (OS X here) as the necessary Microsoft C compiler and libraries aren't available. I guess you'll have to install Visual Studio along with the rest before you can build and install these packages.
Hope it helps anyway!
The last update to RDCOMEvents is 2005. It hasn't been automatically compiled for newer versions of R because it would require the Visual Studio compiler, and is really only useful for the Windows operating system. (I tried compiling it with the ming compiler too, but there are directives in there that are dependent on Visual Studio.)
So, you could grab Visual Studio, and try to get it to compile. I don't envy that task.
However, you may not be aware of the RExcel package. They have also developed a package to get R to talk to Excel (and Word) through the DCOM stuff. It is free for single non-commercial use. I don't think the middleware is open source, but it works. Not an answer to your question, but perhaps good enough?

fatal error C1083: Cannot open include file: 'Windows.h': and scons

Today is officially my first day with C++ :P
I've downloaded Visual C++ 2005 Express Edition and Microsoft Platform SDK for Windows Server 2003 SP1, because I want to get my hands on the open source Enso Project.
So, after installing scons I went to the console and tried to compile it using scons, but I got this error:
C:\oreyes\apps\enso\enso-read-only\src\platform\win32\Include\WinSdk.h(64) : fatal error C1083: Cannot open include file: 'Windows.h': No such file or directory
scons: *** [src\platform\win32\InputManager\AsyncEventProcessorRegistry.obj] Error 2
scons: building terminated because of errors.
After checking these links:
VS ans PSDK
Include tiffi.h
Wndows.h
I've managed to configure my installation like this:
And even run this script
And I managed to compile the file below in the IDE.
// Test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
But I still get that exception in the console. Does anyone have scons experience?
EDIT
Actually (and I forgot to tell you this) I started the command prompt with the link "Visual Studio 2005 Command Prompt".
I assume this will include the paths in environment variables. Well after printing them I find that it didn't:
echo %INCLUDE%
echo %LIB%
echo %PATH%
And they were not present, so I created this .bat file:
set PATH=%PATH%;"C:\Program Files\Microsoft Platform SDK\Bin"
set INCLUDE=%INCLUDE%;"C:\ Program Files\Microsoft Platform SDK\Include"
set LIB=%LIB%;"C:\ Program Files\Microsoft Platform SDK\Lib"
Still, scons seeems not to take the vars... :(
Using the above recommendations will not work with scons: scons does not import the user environment (PATH and other variables). The fundamental problem is that scons does not handle recent versions of SDKs/VS .
I am an occasional contributor to scons, and am working on this feature ATM. Hopefully, it will be included soon in scons, but the feature is much harder to implement reliably than I first expected, partly because every sdk/compiler combination is different (and sometimes even MS does not get it right, some of their .bat files are broken), so I can't give you a date. I hope it will be included in 1.2 (to be released in approximatively one month).
You need to set the include file path (and possibly other things). At the command line this is typically done using a batch file that Visual Studio installs called vsvars32.bat (or vcvars32.bat for compatibility with VC6).
I'm not familiar with scons so I don't know the best way to get these settings configured for that tool, but for standard makefiles there's usually a line in the makefile which sets a macro variable with the include directory path and that macro is used as part of a command line parameter in the command that invokes the compiler.
Another possibility might be to have the scons process invoke vsvars32.bat or run the scons script from a command line that has been configured with the batch file.
In short you need to get the things that vsvars32.bat configures into the scons configuration somehow.
There will be a batch file similar to this one (for MSVC 2005) that sets up the environment variables:
c:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat
Step 1: Find a similar file in the Express installation folders
Step 2: Create a shortcut on the desktop with these target details and a suitably modified path:
cmd.exe /K "c:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
Step 3: Open the DOS prompt via this shortcut
The command line build should now work from within this console window.
You show us how you configured Visual Studio for compilations within Visual Studio but you didn't show us what command line environment you tried. Sorry I haven't tried Express versions so I don't know if they create additional Start menu shortcuts like Pro and above do. If you open a suitable command prompt with its environment variables already set then you can compile on the command line. Otherwise you have to set variables yourself or execute a batch script to set them, each time you open a command prompt.
It'll be nice when scons does this automatically. For now, I use this (run from an SDK command prompt, not sure if there is a difference if run after vsvars32.bat):
import os
env = Environment(ENV={'PATH': os.environ['PATH']})
env['ENV']['TMP'] = os.environ['TMP']
env.AppendUnique(CPPPATH=os.environ['INCLUDE'].split(';'))
env.AppendUnique(LIBPATH=os.environ['LIB'].split(';'))
This works for me while compiling wxwidgets with Visual C++ 2005 Express using the command line prompt:
REM Fix Error error C1083 'windows.h'
(Use /useenv option when compiling.)
set PDSKWIN=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
(Change to the right one.)
set INCLUDE=%PDSKWIN%\Include;%INCLUDE%
set LIB=%PDSKWIN%\Lib;%LIB%
Then I use this line when compiling. I believe just add /useenv to your lines and everything should work fine:
vcbuild /useenv /nohtmllog /nologo name.proj (or any file to compile)

Resources