diff --git a/README.md b/README.md index de725fd..db45237 100644 --- a/README.md +++ b/README.md @@ -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 + + + pthread + include + lib + + + libusb + libusb + msvc + + +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 diff --git a/src/fl2k_fm.c b/src/fl2k_fm.c index 4aae95b..c356a44 100644 --- a/src/fl2k_fm.c +++ b/src/fl2k_fm.c @@ -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) diff --git a/src/fl2k_tcp.c b/src/fl2k_tcp.c index bd01758..ddd0299 100644 --- a/src/fl2k_tcp.c +++ b/src/fl2k_tcp.c @@ -39,7 +39,7 @@ #define sleep_ms(ms) usleep(ms*1000) #else #include -#include +#include #include "getopt/getopt.h" #define sleep_ms(ms) Sleep(ms) #endif diff --git a/vs15/fl2k.sln b/vs15/fl2k.sln new file mode 100644 index 0000000..b7af2c9 --- /dev/null +++ b/vs15/fl2k.sln @@ -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 diff --git a/vs15/fl2k_file/fl2k_file.vcxproj b/vs15/fl2k_file/fl2k_file.vcxproj new file mode 100644 index 0000000..f8502e7 --- /dev/null +++ b/vs15/fl2k_file/fl2k_file.vcxproj @@ -0,0 +1,102 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {99BEB58B-3F7C-4B70-A6BA-A570184B0C0D} + Win32Proj + fl2k_file + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + _TIMESPEC_DEFINED;libosmofl2k_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include + + + Console + true + ..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Debug\lib + 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) + LIBCMTD + + + + + Level3 + + + MaxSpeed + true + true + _TIMESPEC_DEFINED;libosmofl2k_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include + + + Console + true + true + true + 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) + ..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Release\lib + LIBCMT + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vs15/fl2k_file/stdafx.cpp b/vs15/fl2k_file/stdafx.cpp new file mode 100644 index 0000000..74f7c94 --- /dev/null +++ b/vs15/fl2k_file/stdafx.cpp @@ -0,0 +1,16 @@ +// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet. +// fl2k_file.pch ist der vorkompilierte Header. +// stdafx.obj enthlt die vorkompilierten Typinformationen. + +#include "stdafx.h" + +// TODO: Auf zustzliche 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 diff --git a/vs15/fl2k_file/stdafx.h b/vs15/fl2k_file/stdafx.h new file mode 100644 index 0000000..8d827e8 --- /dev/null +++ b/vs15/fl2k_file/stdafx.h @@ -0,0 +1,15 @@ +// stdafx.h: Includedatei fr Standardsystem-Includedateien +// oder hufig verwendete projektspezifische Includedateien, +// die nur in unregelmigen Abstnden gendert werden. +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: Hier auf zustzliche Header, die das Programm erfordert, verweisen. diff --git a/vs15/fl2k_file/targetver.h b/vs15/fl2k_file/targetver.h new file mode 100644 index 0000000..a765413 --- /dev/null +++ b/vs15/fl2k_file/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Durch Einbeziehen von"SDKDDKVer.h" wird die hchste verfgbare Windows-Plattform definiert. + +// Wenn Sie die Anwendung fr eine frhere Windows-Plattform erstellen mchten, schlieen Sie "WinSDKVer.h" ein, und +// legen Sie das _WIN32_WINNT-Makro auf die zu untersttzende Plattform fest, bevor Sie "SDKDDKVer.h" einschlieen. + +#include diff --git a/vs15/fl2k_fm/fl2k_fm.vcxproj b/vs15/fl2k_fm/fl2k_fm.vcxproj new file mode 100644 index 0000000..24638fd --- /dev/null +++ b/vs15/fl2k_fm/fl2k_fm.vcxproj @@ -0,0 +1,105 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {F288E25F-4872-4B2F-8DD2-3757B142DBD0} + Win32Proj + fl2k_fm + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + _TIMESPEC_DEFINED;libosmofl2k_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include + + + Console + true + ..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Debug\lib + 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) + LIBCMTD + + + + + Level3 + + + MaxSpeed + true + true + _TIMESPEC_DEFINED;libosmofl2k_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include + + + Console + true + true + true + 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) + ..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Release\lib + LIBCMT + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vs15/fl2k_fm/stdafx.cpp b/vs15/fl2k_fm/stdafx.cpp new file mode 100644 index 0000000..a97c2ab --- /dev/null +++ b/vs15/fl2k_fm/stdafx.cpp @@ -0,0 +1,16 @@ +// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet. +// fl2k_fm.pch ist der vorkompilierte Header. +// stdafx.obj enthlt die vorkompilierten Typinformationen. + +#include "stdafx.h" + +// TODO: Auf zustzliche 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 diff --git a/vs15/fl2k_fm/stdafx.h b/vs15/fl2k_fm/stdafx.h new file mode 100644 index 0000000..8d827e8 --- /dev/null +++ b/vs15/fl2k_fm/stdafx.h @@ -0,0 +1,15 @@ +// stdafx.h: Includedatei fr Standardsystem-Includedateien +// oder hufig verwendete projektspezifische Includedateien, +// die nur in unregelmigen Abstnden gendert werden. +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: Hier auf zustzliche Header, die das Programm erfordert, verweisen. diff --git a/vs15/fl2k_fm/targetver.h b/vs15/fl2k_fm/targetver.h new file mode 100644 index 0000000..a765413 --- /dev/null +++ b/vs15/fl2k_fm/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Durch Einbeziehen von"SDKDDKVer.h" wird die hchste verfgbare Windows-Plattform definiert. + +// Wenn Sie die Anwendung fr eine frhere Windows-Plattform erstellen mchten, schlieen Sie "WinSDKVer.h" ein, und +// legen Sie das _WIN32_WINNT-Makro auf die zu untersttzende Plattform fest, bevor Sie "SDKDDKVer.h" einschlieen. + +#include diff --git a/vs15/fl2k_tcp/fl2k_tcp.vcxproj b/vs15/fl2k_tcp/fl2k_tcp.vcxproj new file mode 100644 index 0000000..8dc2514 --- /dev/null +++ b/vs15/fl2k_tcp/fl2k_tcp.vcxproj @@ -0,0 +1,102 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {E112A727-7C6C-4924-B8D4-AB2DF29A96FA} + Win32Proj + fl2k_tcp + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + _TIMESPEC_DEFINED;libosmofl2k_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include + + + Console + true + ..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Debug\lib + 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) + LIBCMTD + + + + + Level3 + + + MaxSpeed + true + true + _TIMESPEC_DEFINED;libosmofl2k_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include + + + Console + true + true + true + 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) + ..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Release\lib + LIBCMT + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vs15/fl2k_tcp/stdafx.cpp b/vs15/fl2k_tcp/stdafx.cpp new file mode 100644 index 0000000..c070b5a --- /dev/null +++ b/vs15/fl2k_tcp/stdafx.cpp @@ -0,0 +1,16 @@ +// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet. +// fl2k_tcp.pch ist der vorkompilierte Header. +// stdafx.obj enthlt die vorkompilierten Typinformationen. + +#include "stdafx.h" + +// TODO: Auf zustzliche 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 diff --git a/vs15/fl2k_tcp/stdafx.h b/vs15/fl2k_tcp/stdafx.h new file mode 100644 index 0000000..8d827e8 --- /dev/null +++ b/vs15/fl2k_tcp/stdafx.h @@ -0,0 +1,15 @@ +// stdafx.h: Includedatei fr Standardsystem-Includedateien +// oder hufig verwendete projektspezifische Includedateien, +// die nur in unregelmigen Abstnden gendert werden. +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: Hier auf zustzliche Header, die das Programm erfordert, verweisen. diff --git a/vs15/fl2k_tcp/targetver.h b/vs15/fl2k_tcp/targetver.h new file mode 100644 index 0000000..a765413 --- /dev/null +++ b/vs15/fl2k_tcp/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Durch Einbeziehen von"SDKDDKVer.h" wird die hchste verfgbare Windows-Plattform definiert. + +// Wenn Sie die Anwendung fr eine frhere Windows-Plattform erstellen mchten, schlieen Sie "WinSDKVer.h" ein, und +// legen Sie das _WIN32_WINNT-Makro auf die zu untersttzende Plattform fest, bevor Sie "SDKDDKVer.h" einschlieen. + +#include diff --git a/vs15/fl2k_test/fl2k_test.vcxproj b/vs15/fl2k_test/fl2k_test.vcxproj new file mode 100644 index 0000000..576460a --- /dev/null +++ b/vs15/fl2k_test/fl2k_test.vcxproj @@ -0,0 +1,102 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {864DCAE6-6FD2-4640-A056-7EF7CC74968F} + Win32Proj + fl2k_test + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + _TIMESPEC_DEFINED;libosmofl2k_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include + + + Console + true + ..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Debug\lib + 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) + LIBCMTD + + + + + Level3 + + + MaxSpeed + true + true + _TIMESPEC_DEFINED;libosmofl2k_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\include;..\..\..\libusb\libusb;..\..\..\pthread\include + + + Console + true + true + true + ..\..\..\pthread\lib\x64;..\..\..\libusb\x64\Release\lib + 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) + LIBCMT + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vs15/fl2k_test/stdafx.cpp b/vs15/fl2k_test/stdafx.cpp new file mode 100644 index 0000000..27ab857 --- /dev/null +++ b/vs15/fl2k_test/stdafx.cpp @@ -0,0 +1,16 @@ +// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet. +// fl2k_test.pch ist der vorkompilierte Header. +// stdafx.obj enthlt die vorkompilierten Typinformationen. + +#include "stdafx.h" + +// TODO: Auf zustzliche 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 diff --git a/vs15/fl2k_test/stdafx.h b/vs15/fl2k_test/stdafx.h new file mode 100644 index 0000000..8d827e8 --- /dev/null +++ b/vs15/fl2k_test/stdafx.h @@ -0,0 +1,15 @@ +// stdafx.h: Includedatei fr Standardsystem-Includedateien +// oder hufig verwendete projektspezifische Includedateien, +// die nur in unregelmigen Abstnden gendert werden. +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: Hier auf zustzliche Header, die das Programm erfordert, verweisen. diff --git a/vs15/fl2k_test/targetver.h b/vs15/fl2k_test/targetver.h new file mode 100644 index 0000000..a765413 --- /dev/null +++ b/vs15/fl2k_test/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Durch Einbeziehen von"SDKDDKVer.h" wird die hchste verfgbare Windows-Plattform definiert. + +// Wenn Sie die Anwendung fr eine frhere Windows-Plattform erstellen mchten, schlieen Sie "WinSDKVer.h" ein, und +// legen Sie das _WIN32_WINNT-Makro auf die zu untersttzende Plattform fest, bevor Sie "SDKDDKVer.h" einschlieen. + +#include