Author Topic: Visual Studio 2013 64 bit?  (Read 18660 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #15 on: May 09, 2014, 08:34:54 AM »
Here is a Qt demo that is very cool and performs about the same as my laptop version of it. This is a native compiled Android Linux demo.



This is a BaCon SDL example Peter wrote that I compiled native on Android with C4droid. (runs great)



The Ubuntu examples I demonstrated prior are running in a chroot process along side Android Linux. It's using a VNC client for the X11 GUI support. It's usable but not something I would invest much time in. I'm waiting for Ubuntu Touch to become stable before putting much more effort into the tablet platform. I have a complete gcc environment created on a non-rooted tablet with SB, BaCon and SDL / APK packaging if I wish to share.
« Last Edit: May 09, 2014, 08:53:02 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #16 on: May 09, 2014, 08:30:24 PM »
I have been searching the web for a 64 bit Windows libcurl download and only was able to find a build for MinGW64. I'm on the fence with using Microsoft VS2013 with 64 bit Windows builds. It seems MinGW64 is a safer bet at this point for cross platform libraries. I can understand the open source community not wanting to invest is VC  based libraries when they now have a gcc compiler that works well on both 32 & 64 bit Windows. It's a sad fact but Microsoft once again missed the boat and got a late start on the 64 bit bandwagon. And they wonder what happened to there server business. (> 90%  are 64 bit Linux servers)

FWIW All the core SB binaries and SB specific extension modules compiled 64 bit with VS2013. Finding open source 64 bit VC libraries is the trick.
« Last Edit: May 09, 2014, 08:44:29 PM by John »

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: Visual Studio 2013 64 bit?
« Reply #17 on: May 09, 2014, 10:06:47 PM »
Got this link from the Curl site. http://www.confusedbycode.com/curl/

Download the zip file, not the msi file, and just extract what you need.

The "Build Notes.txt" file says:
Quote
Built with Microsoft Visual Studio Express 2013 on April 10, 2014

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #18 on: May 09, 2014, 10:34:17 PM »
Thanks AIR!

Good find. I used the Windows 64 bit MSI from cURL project site download wizard. (which spit out a MinGW64 surprise)
« Last Edit: May 09, 2014, 10:40:47 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #19 on: May 09, 2014, 11:56:18 PM »
I had to manually hack the makefile to get it to work.

Code: [Select]
all : C:\sb22_64\source\bin\vc7\mod\lib\curl.lib C:\sb22_64\source\bin\vc7\mod\dll\curl.dll C:\sb22_64\source\bin\texi\mod_curl.texi




C:\sb22_64\source\bin\vc7\mod\lib\curl.lib : C:\sb22_64\source\bin\vc7\mod\obj\curl\s_interface.obj
lib /nologo /OUT:C:\sb22_64\source\bin\vc7\mod\lib\curl.lib C:\sb22_64\source\bin\vc7\mod\obj\curl\s_interface.obj libcurl.lib

C:\sb22_64\source\bin\vc7\mod\dll\curl.dll : C:\sb22_64\source\bin\vc7\mod\obj\curl\interface.obj
cl /LD /nologo /FeC:\sb22_64\source\bin\vc7\mod\dll\curl.dll C:\sb22_64\source\bin\vc7\mod\obj\curl\interface.obj libcurl.lib

C:\sb22_64\source\bin\vc7\mod\obj\curl\interface.obj : interface.c
cl /Ox /DWIN32 /MT /nologo /W0 /c /FoC:\sb22_64\source\bin\vc7\mod\obj\curl\interface.obj interface.c

C:\sb22_64\source\bin\vc7\mod\obj\curl\s_interface.obj : interface.c
cl /Ox /DWIN32 /MT /nologo /W0 -DSTATIC_LINK=1 /c /FoC:\sb22_64\source\bin\vc7\mod\obj\curl\s_interface.obj interface.c

C:\sb22_64\source\bin\texi\mod_curl.texi : manual.texi.jam
perl C:\sb22_64\source\jamal.pl manual.texi.jam C:\sb22_64\source\bin\texi\mod_curl.texi
perl C:\sb22_64\source\t2h.pl C:\sb22_64\source\bin\texi\mod_curl.texi
hhc C:\sb22_64\source\bin\texi\mod_curl.hhp & set ERRORLEVEL=0

Code: [Select]
C:\sb22_64\source\extensions\curl>nmake /A /B /f makefile.vc7

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl /Ox /DWIN32 /MT /nologo /W0 -DSTATIC_LINK=1 /c /FoC:\sb22_64\source\bin\vc7\mod\obj\curl\s_interface.obj interface.c
interface.c
        lib /nologo /OUT:C:\sb22_64\source\bin\vc7\mod\lib\curl.lib C:\sb22_64\source\bin\vc7\mod\obj\curl\s_interface.obj libcurl.lib
        cl /Ox /DWIN32 /MT /nologo /W0 /c /FoC:\sb22_64\source\bin\vc7\mod\obj\curl\interface.obj interface.c
interface.c
        cl /LD /nologo /FeC:\sb22_64\source\bin\vc7\mod\dll\curl.dll C:\sb22_64\source\bin\vc7\mod\obj\curl\interface.obj libcurl.lib
   Creating library C:\sb22_64\source\bin\vc7\mod\dll\curl.lib and object C:\sb22_64\source\bin\vc7\mod\dll\curl.exp
        perl C:\sb22_64\source\jamal.pl manual.texi.jam C:\sb22_64\source\bin\texi\mod_curl.texi
        perl C:\sb22_64\source\t2h.pl C:\sb22_64\source\bin\texi\mod_curl.texi
        hhc C:\sb22_64\source\bin\texi\mod_curl.hhp & set ERRORLEVEL=0
Microsoft HTML Help Compiler 4.74.8702

Compiling c:\sb22_64\source\bin\texi\mod_curl.chm


Compile time: 0 minutes, 2 seconds
95      Topics
560     Local links
0       Internet links
0       Graphics


Created c:\sb22_64\source\bin\texi\mod_curl.chm, 57,119 bytes
Compression decreased file by 87,598 bytes.

C:\sb22_64\source\extensions\curl>

Code: [Select]
C:\sb22_64\source\bin\vc7\mod\dll>dumpbin /HEADERS curl.dll
Microsoft (R) COFF/PE Dumper Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Last Edit: Today at 11:41:40 PM

Dump of file curl.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
            8664 machine (x64)
               5 number of sections
        536DCCC3 time date stamp Fri May 09 23:52:51 2014
               0 file pointer to symbol table
               0 number of symbols
              F0 size of optional header
            2022 characteristics
                   Executable
                   Application can handle large (>2GB) addresses
                   DLL

OPTIONAL HEADER VALUES
             20B magic # (PE32+)
           12.00 linker version
           10C00 size of code
            C000 size of initialized data
               0 size of uninitialized data
            6A5C entry point (0000000180006A5C)
            1000 base of code
       180000000 image base (0000000180000000 to 000000018001FFFF)
            1000 section alignment
             200 file alignment
            6.00 operating system version
            0.00 image version
            6.00 subsystem version
               0 Win32 version
           20000 size of image
             400 size of headers
               0 checksum
               2 subsystem (Windows GUI)
             160 DLL characteristics
                   High Entropy Virtual Addresses
                   Dynamic base
                   NX compatible
          100000 size of stack reserve
            1000 size of stack commit
          100000 size of heap reserve
            1000 size of heap commit
               0 loader flags
              10 number of directories
           18040 [     189] RVA [size] of Export Directory
           181CC [      3C] RVA [size] of Import Directory
               0 [       0] RVA [size] of Resource Directory
           1E000 [     B10] RVA [size] of Exception Directory
               0 [       0] RVA [size] of Certificates Directory
           1F000 [     568] RVA [size] of Base Relocation Directory
               0 [       0] RVA [size] of Debug Directory
               0 [       0] RVA [size] of Architecture Directory
               0 [       0] RVA [size] of Global Pointer Directory
               0 [       0] RVA [size] of Thread Storage Directory
           17420 [      70] RVA [size] of Load Configuration Directory
               0 [       0] RVA [size] of Bound Import Directory
           12000 [     298] RVA [size] of Import Address Table Directory
               0 [       0] RVA [size] of Delay Import Directory
               0 [       0] RVA [size] of COM Descriptor Directory
               0 [       0] RVA [size] of Reserved Directory

C:\sb22_64\source\bin\vc7\mod\dll>dumpbin /EXPORTS curl.dll
Microsoft (R) COFF/PE Dumper Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file curl.dll

File Type: DLL

  Section contains the following exports for curl.dll

    00000000 characteristics
    536DCCC3 time date stamp Fri May 09 23:52:51 2014
        0.00 version
           1 ordinal base
          15 number of functions
          15 number of names

    ordinal hint RVA      name

          1    0 00005DC0 DllMain
          2    1 00001040 bootmodu
          3    2 00001100 finimodu
          4    3 00005840 sb_curl_error
          5    4 00005970 sb_curl_escape
          6    5 00005460 sb_curl_finish
          7    6 00005C10 sb_curl_getdate
          8    7 00004E60 sb_curl_info
          9    8 000011E0 sb_curl_init
         10    9 00001440 sb_curl_option
         11    A 00004C50 sb_curl_perform
         12    B 00005AC0 sb_curl_unescape
         13    C 00005D30 sb_curl_version
         14    D 00001020 shutmodu
         15    E 00001010 versmodu

  Summary

        5000 .data
        1000 .pdata
        7000 .rdata
        1000 .reloc
       11000 .text

C:\sb22_64\source\bin\vc7\mod\dll>

Thanks again for saving the day.
« Last Edit: May 10, 2014, 12:44:56 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #20 on: May 10, 2014, 12:55:12 AM »
The 64 bit ODBC extension module compiled fine.

Code: [Select]
C:\sb22_64\source\extensions\odbc>nmake /A /B /f makefile.vc7

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl /Ox /DWIN32 /MT /nologo /W0 -DSTATIC_LINK=1 /c /FoC:\sb22_64\source\bin\vc7\mod\obj\odbc\s_interface.obj interface.c
interface.c
        lib /nologo /OUT:C:\sb22_64\source\bin\vc7\mod\lib\odbc.lib C:\sb22_64\source\bin\vc7\mod\obj\odbc\s_interface.obj  odbc32.l
ib odbccp32.lib
        cl /Ox /DWIN32 /MT /nologo /W0 /c /FoC:\sb22_64\source\bin\vc7\mod\obj\odbc\interface.obj interface.c
interface.c
        cl /LD /nologo /FeC:\sb22_64\source\bin\vc7\mod\dll\odbc.dll C:\sb22_64\source\bin\vc7\mod\obj\odbc\interface.obj odbc32.lib
 odbccp32.lib
   Creating library C:\sb22_64\source\bin\vc7\mod\dll\odbc.lib and object C:\sb22_64\source\bin\vc7\mod\dll\odbc.exp
        perl C:\sb22_64\source\jamal.pl manual.texi.jam C:\sb22_64\source\bin\texi\mod_odbc.texi
        perl C:\sb22_64\source\t2h.pl C:\sb22_64\source\bin\texi\mod_odbc.texi
        hhc C:\sb22_64\source\bin\texi\mod_odbc.hhp & set ERRORLEVEL=0
Microsoft HTML Help Compiler 4.74.8702

Compiling c:\sb22_64\source\bin\texi\mod_odbc.chm


Compile time: 0 minutes, 2 seconds
11      Topics
80      Local links
0       Internet links
0       Graphics


Created c:\sb22_64\source\bin\texi\mod_odbc.chm, 20,371 bytes
Compression decreased file by 1,624 bytes.

C:\sb22_64\source\extensions\odbc>

Mike Lobanovsky

  • Guest
Re: Visual Studio 2013 64 bit?
« Reply #21 on: May 10, 2014, 06:38:40 AM »
Hi John,

A couple of questions, please:

1. How does the size of your 32-bit scribaw.exe built under MS VS 2013 compare to your earlier GCC builds?

2. What DLL dependencies does your new scribaw.exe use? You can check that in Dependency Walker.

Thanks.

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #22 on: May 10, 2014, 08:47:34 AM »
Quote from: Mike Lobanovsky
1. How does the size of your 32-bit scribaw.exe built under MS VS 2013 compare to your earlier GCC builds?

The manifest resources are found with the source distribution of IUP. There are docs on the IUP site for compiling in resources. AIR built the last holy grail compiled resource for MinGW. It seems you beat me to the question.  :D

Quote from: Mike Lobanovsky
2. What DLL dependencies does your new scribaw.exe use? You can check that in Dependency Walker.

scriba doesn't require any other dependencies. You can run any script I've posted not using an extension module with scriba alone. Or you can create a custom scriba of your own.

Code: [Select]
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include "scriba.h"
#include "cbasic.h"

MAIN
BEGIN_FUNCTION
  DIM AS pSbProgram pProgram;
  pProgram = scriba_new(malloc,free);
  scriba_LoadConfiguration(pProgram, "/home/jrs/sb/sb22/bin/basic.conf");
  scriba_SetFileName(pProgram, argv[1]);
  scriba_LoadSourceProgram(pProgram);
  scriba_Run(pProgram, argv[2]);
  scriba_destroy(pProgram);
  RETURN_FUNCTION(0);
END_FUNCTION

« Last Edit: May 10, 2014, 01:41:19 PM by John »

Mike Lobanovsky

  • Guest
Re: Visual Studio 2013 64 bit?
« Reply #23 on: May 10, 2014, 03:20:12 PM »
OK John,

Perhaps I didn't put the binary's name correctly. Obviously it should've been sbiup.exe, not scribaw.exe. I'm sorry for that. Nonetheless, the dependency question stays put:

Quote
scriba doesn't require any other dependencies.

This is not so. Here's how your 32-bit GCC version of scriba.exe looks in Dependency Walker (attached below). It enumerates the entire range of DLL dependencies that get mapped into the process memory when the program is launched for execution.

Dependency Walker is a small and handy utility to have on one's MS Windows PC. I'd recommend you to install a copy on yours by all means.

In case you don't want to do it, can I have a copy of your 32-bit VS 2013 scriba.exe zipped and uploaded here?

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #24 on: May 10, 2014, 03:27:00 PM »
Sorry, I misunderstood your question. What I meant is that scriba doesn't require any non-standard Windows system resources.

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #25 on: May 10, 2014, 09:35:07 PM »
I was able to get the 64 bit version of the Script BASIC IUP/CD extension module built. I haven't got theme support working yet.  :-\

The 64 bit cURL module seems to be working with the limited tests I did.

Update:

I added the iup.res and the comctl32.lib to the make_vc7.jim file and scriba,exe appeared to have taken on the resource. (IUP icon for scriba.exe) When I try to use this version of scriba, it complains the IUP (pui.dll) module couldn't be loaded.  :o

{#define StandardLibraries=ws2_32.lib advapi32.lib comctl32.lib iup.res}

I used air.o as my IUP resource and it's now working.  (see attached)
« Last Edit: May 10, 2014, 10:51:43 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #26 on: May 10, 2014, 11:45:32 PM »
Does anyone know how to disable the console and make scriba a windows application with VS2013 / VC12 console C++?  I didn't have any issues with this using MinGW64.

This or just about any combination of case didn't work for me.

/SUBSYSTEM:windows
« Last Edit: May 10, 2014, 11:47:25 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #27 on: May 11, 2014, 01:01:19 PM »
I'm using the Visual Studio 2013 IDE to build the 64 bit version of SDL_gfx.dll. All went well but it didn't create a SDL_gfx.lib which I need for the Script BASIC GFX extension module. I'm just getting up to speed using VS2013 and this seems to elude me at the moment.

Still no luck with getting a sbw64.exe built that doesn't pop the console window.

I have MySQL and SQLite3 64 bit compiled and working. Once I get the GFX extension module working, I'll post a binary zip for others to try and hopefully chime in with some feedback.

Update

I figured out how to build the SDL_gfx.lib file so that looks like one issue behind me.

1>  SDL_gfx.vcxproj -> C:\SDL_gfx-2.0.25\x64\Release\SDL_gfx.lib
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

« Last Edit: May 11, 2014, 01:53:51 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #28 on: May 11, 2014, 02:36:44 PM »
While trying to compile the Script BASIC GFX extension module I ran into this strange error preventing the module to compile. Any ideas?

Code: [Select]
C:\sb22_64\source\extensions\gfx>nmake /A /B /f makefile.vc7

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl /Ox /DWIN32 /MT /nologo /W0 -DSTATIC_LINK=1 /c /FoC:\sb22_64\source\bin\vc7\mod\obj\gfx\s_interface.obj interface.c
interface.c
        lib /nologo /OUT:C:\sb22_64\source\bin\vc7\mod\lib\gfx.lib C:\sb22_64\source\bin\vc7\mod\obj\gfx\s_interface.obj  SDL.lib SD
L_gfx.lib
SDL_gfx.lib(SDL_framerate.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the lin
k command line to improve linker performance
        cl /Ox /DWIN32 /MT /nologo /W0 /c /FoC:\sb22_64\source\bin\vc7\mod\obj\gfx\interface.obj interface.c
interface.c
        cl /LD /nologo /FeC:\sb22_64\source\bin\vc7\mod\dll\gfx.dll C:\sb22_64\source\bin\vc7\mod\obj\gfx\interface.obj SDL.lib SDL_
gfx.lib
SDL_gfx.lib(SDL_framerate.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the lin
k command line to improve linker performance
   Creating library C:\sb22_64\source\bin\vc7\mod\dll\gfx.lib and object C:\sb22_64\source\bin\vc7\mod\dll\gfx.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
Generating code
Finished generating code
MSVCRT.lib(MSVCR120.dll) : error LNK2005: free already defined in LIBCMT.lib(free.obj)
MSVCRT.lib(MSVCR120.dll) : error LNK2005: malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCR120.dll) : error LNK2005: realloc already defined in LIBCMT.lib(realloc.obj)
C:\sb22_64\source\bin\vc7\mod\dll\gfx.dll : fatal error LNK1169: one or more multiply defined symbols found
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.

C:\sb22_64\source\extensions\gfx>

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Visual Studio 2013 64 bit?
« Reply #29 on: May 11, 2014, 03:28:41 PM »
I was able to get the Script BASIC GFX extension module to work by using the MinGW64 versions of gfx.dll and SDL_gfx.dll. I'm still using the VC version of SDL.dll. (see attached)