Skip to content

Commit

Permalink
Merge pull request #1 from winterrace/feat-vs2015
Browse files Browse the repository at this point in the history
Feat vs2015
  • Loading branch information
winterrace authored Aug 9, 2018
2 parents 0fb8849 + d70323f commit d675e3e
Show file tree
Hide file tree
Showing 20 changed files with 641 additions and 2 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
fl2k_win
===========
This is a fork of http://git.osmocom.org/osmo-fl2k which compiles for Win64 under Microsoft Visual Studio (verified with VS 2015). See release section for pre-compiled binaries.

To use the fl2k_win programs on a x64 Windows machine you first have to install the libusb driver for your FL2000-based VGA adapter. I recommend using zadig (http://zadig.akeo.ie/) to do so. Be aware that FL2000 dongles are composite USB devices since they have the (optional) feature to bring their driver in an embedded memory drive. Use the zadig option "list all devices” and disable "ignore hubs or composite parents" to select the composite device (typically id 1D5C-2000) instead of its VGA subdevice (typically id 1D5C-2000-00).

To compile fl2k_win yourself, you first need to acquire the libusb and pthreads-win32 libraries and copy the relevant files (see below) in folders called "libusb" and "pthread" placed parallel to the fl2k_win folder. Suitable sources are https://github.com/libusb/libusb/archive/v1.0.22.zip and the subdirectory "Pre-built.2" from ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip).

The folder structure has to look like this

fl2k_win
include
src
vs15
<and so on>

pthread
include
lib
<and so on>

libusb
libusb
msvc
<and so on>

Next you have to open libusb/msvc/libusb_2015.sln and compile libusb for Win64 (Release and Debug Build).

Then simply open fl2k_win/vs15/fl2k.sln in Visual Studio and select between debug/release build options.

Original readme from http://git.osmocom.org/osmo-fl2k:
===========
# osmo-fl2k
#### turns FL2000-based USB 3.0 to VGA adapters into low cost DACs

Expand Down
2 changes: 1 addition & 1 deletion src/fl2k_fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ int main(int argc, char **argv)
};

while (1) {
opt = getopt_long(argc, argv, "d:c:f:i:s:", long_options, &option_index);
opt = getopt/*_long*/(argc, argv, "d:c:f:i:s:", long_options, &option_index);

/* end of options reached */
if (opt == -1)
Expand Down
2 changes: 1 addition & 1 deletion src/fl2k_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#define sleep_ms(ms) usleep(ms*1000)
#else
#include <windows.h>
#include <winsock2.h>
#include <winsock.h>
#include "getopt/getopt.h"
#define sleep_ms(ms) Sleep(ms)
#endif
Expand Down
40 changes: 40 additions & 0 deletions vs15/fl2k.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fl2k_file", "fl2k_file\fl2k_file.vcxproj", "{99BEB58B-3F7C-4B70-A6BA-A570184B0C0D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fl2k_fm", "fl2k_fm\fl2k_fm.vcxproj", "{F288E25F-4872-4B2F-8DD2-3757B142DBD0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fl2k_tcp", "fl2k_tcp\fl2k_tcp.vcxproj", "{E112A727-7C6C-4924-B8D4-AB2DF29A96FA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fl2k_test", "fl2k_test\fl2k_test.vcxproj", "{864DCAE6-6FD2-4640-A056-7EF7CC74968F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{99BEB58B-3F7C-4B70-A6BA-A570184B0C0D}.Debug|x64.ActiveCfg = Debug|x64
{99BEB58B-3F7C-4B70-A6BA-A570184B0C0D}.Debug|x64.Build.0 = Debug|x64
{99BEB58B-3F7C-4B70-A6BA-A570184B0C0D}.Release|x64.ActiveCfg = Release|x64
{99BEB58B-3F7C-4B70-A6BA-A570184B0C0D}.Release|x64.Build.0 = Release|x64
{F288E25F-4872-4B2F-8DD2-3757B142DBD0}.Debug|x64.ActiveCfg = Debug|x64
{F288E25F-4872-4B2F-8DD2-3757B142DBD0}.Debug|x64.Build.0 = Debug|x64
{F288E25F-4872-4B2F-8DD2-3757B142DBD0}.Release|x64.ActiveCfg = Release|x64
{F288E25F-4872-4B2F-8DD2-3757B142DBD0}.Release|x64.Build.0 = Release|x64
{E112A727-7C6C-4924-B8D4-AB2DF29A96FA}.Debug|x64.ActiveCfg = Debug|x64
{E112A727-7C6C-4924-B8D4-AB2DF29A96FA}.Debug|x64.Build.0 = Debug|x64
{E112A727-7C6C-4924-B8D4-AB2DF29A96FA}.Release|x64.ActiveCfg = Release|x64
{E112A727-7C6C-4924-B8D4-AB2DF29A96FA}.Release|x64.Build.0 = Release|x64
{864DCAE6-6FD2-4640-A056-7EF7CC74968F}.Debug|x64.ActiveCfg = Debug|x64
{864DCAE6-6FD2-4640-A056-7EF7CC74968F}.Debug|x64.Build.0 = Debug|x64
{864DCAE6-6FD2-4640-A056-7EF7CC74968F}.Release|x64.ActiveCfg = Release|x64
{864DCAE6-6FD2-4640-A056-7EF7CC74968F}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
102 changes: 102 additions & 0 deletions vs15/fl2k_file/fl2k_file.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{99BEB58B-3F7C-4B70-A6BA-A570184B0C0D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>fl2k_file</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_TIMESPEC_DEFINED;libosmofl2k_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Debug\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>libusb-1.0.lib;pthreadVC2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMTD</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_TIMESPEC_DEFINED;libosmofl2k_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>libusb-1.0.lib;pthreadVC2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Release\lib</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>LIBCMT</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\fl2k_file.c" />
<ClCompile Include="..\..\src\getopt\getopt.c" />
<ClCompile Include="..\..\src\libosmo-fl2k.c" />
<ClCompile Include="stdafx.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
16 changes: 16 additions & 0 deletions vs15/fl2k_file/stdafx.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet.
// fl2k_file.pch ist der vorkompilierte Header.
// stdafx.obj enthält die vorkompilierten Typinformationen.

#include "stdafx.h"

// TODO: Auf zusätzliche Header verweisen, die in STDAFX.H
// und nicht in dieser Datei erforderlich sind.


#ifdef __cplusplus
FILE iob[] = { *stdin, *stdout, *stderr };
extern "C" {
FILE * __cdecl _iob(void) { return iob; }
}
#endif
15 changes: 15 additions & 0 deletions vs15/fl2k_file/stdafx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// stdafx.h: Includedatei für Standardsystem-Includedateien
// oder häufig verwendete projektspezifische Includedateien,
// die nur in unregelmäßigen Abständen geändert werden.
//

#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>



// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
8 changes: 8 additions & 0 deletions vs15/fl2k_file/targetver.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

// Durch Einbeziehen von"SDKDDKVer.h" wird die höchste verfügbare Windows-Plattform definiert.

// Wenn Sie die Anwendung für eine frühere Windows-Plattform erstellen möchten, schließen Sie "WinSDKVer.h" ein, und
// legen Sie das _WIN32_WINNT-Makro auf die zu unterstützende Plattform fest, bevor Sie "SDKDDKVer.h" einschließen.

#include <SDKDDKVer.h>
105 changes: 105 additions & 0 deletions vs15/fl2k_fm/fl2k_fm.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F288E25F-4872-4B2F-8DD2-3757B142DBD0}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>fl2k_fm</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_TIMESPEC_DEFINED;libosmofl2k_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Debug\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>libusb-1.0.lib;pthreadVC2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMTD</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_TIMESPEC_DEFINED;libosmofl2k_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>libusb-1.0.lib;pthreadVC2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Release\lib</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>LIBCMT</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\include\rds_mod.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\fl2k_fm.c" />
<ClCompile Include="..\..\src\getopt\getopt.c" />
<ClCompile Include="..\..\src\libosmo-fl2k.c" />
<ClCompile Include="..\..\src\rds_mod.c" />
<ClCompile Include="..\..\src\rds_waveforms.c" />
<ClCompile Include="stdafx.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
16 changes: 16 additions & 0 deletions vs15/fl2k_fm/stdafx.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet.
// fl2k_fm.pch ist der vorkompilierte Header.
// stdafx.obj enthält die vorkompilierten Typinformationen.

#include "stdafx.h"

// TODO: Auf zusätzliche Header verweisen, die in STDAFX.H
// und nicht in dieser Datei erforderlich sind.


#ifdef __cplusplus
FILE iob[] = { *stdin, *stdout, *stderr };
extern "C" {
FILE * __cdecl _iob(void) { return iob; }
}
#endif
15 changes: 15 additions & 0 deletions vs15/fl2k_fm/stdafx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// stdafx.h: Includedatei für Standardsystem-Includedateien
// oder häufig verwendete projektspezifische Includedateien,
// die nur in unregelmäßigen Abständen geändert werden.
//

#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>



// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
8 changes: 8 additions & 0 deletions vs15/fl2k_fm/targetver.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

// Durch Einbeziehen von"SDKDDKVer.h" wird die höchste verfügbare Windows-Plattform definiert.

// Wenn Sie die Anwendung für eine frühere Windows-Plattform erstellen möchten, schließen Sie "WinSDKVer.h" ein, und
// legen Sie das _WIN32_WINNT-Makro auf die zu unterstützende Plattform fest, bevor Sie "SDKDDKVer.h" einschließen.

#include <SDKDDKVer.h>
Loading

0 comments on commit d675e3e

Please sign in to comment.