I can get this to work in VisualStudio (only Debug NOT release) by copying the fltk solution and removing everything then adding in my program but I cannot get it to link via the command line.My batch file does a call toC:\"Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
and my link options are those I have copied from VisualStudio..\_LINK\link /OUT:%1.EXE /NOLOGO /LIBPATH:"C:\USERS\ROGER\_DEV1\FLTK-1.3.8\LIB" FLTKD.LIB COMCTL32.LIB C:\USERS\ROGER\_DEV1\SOURCE\LANGUAGEONE\LIB\LANGUAGEONE.LIB LZ32.LIB WS2_32.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 /NODEFAULTLIB:LIBCD /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X64 fV3.04.OBJ V3.04.obj
Thanks Greg, I'll see if I can chip away at it.CheersRogerP.S. I can certainly agree with you on VisualStudio. Your use a simple "Hello World" program and get what seems like 10,000 lines of output.
Oh, and Ian. I'll take a look a look at MSYS2 but sadly I've put in a lot of effort into VisualStudio with my own project.I really couldn't find any other debugger for windows that works. But on Linux DDD as a front end for GDB and your away. so simple.
On 10/18/22 13:09, roger tunnicliffe wrote:
On Tuesday, 18 October 2022 at 06:58:58 UTC+1 roger wrote:
It's important to be sure you use the same compile and link options
that FLTK uses to build its own demos as you use to build your app.
I personally use a Makefile on windows for both 32bit and 64bit, and when
starting out, make sure I use all the same arguments for CL (the compiler)
and LINK (link) that FLTK uses to build successful test programs, and then
be sure to #include/link that same version of FLTK (and not against some
other build of FLTK)
You can find all those flags in the build logs for e.g. the "hello" test demo.
Thanks Greg, I'll see if I can chip away at it.
I did get this working Greg and you were right. I took the code from CL.command.1.tlog
and link.command.1.tlog. I have no idea what the options are but hey, if they work they work.
I thought maybe the people involved with fltk might be interested in
using the results for documentation so I have included the files that have worked for me.
The flags and paths are going to differ for each version of
VS, build option
(release vs debug vs 32bit vs 64bit, architecure variations,
etc), so I don't
think pasting these commands will help people build their own
projects.
This is why the compiler/link flags are never documented.
We use to include static prebuilt VS project files in the FLTK
distributions,
but due to all the VS variations, that became unmaintainable;
too many
separate manually maintained project files for each VS
version.
Whenever a new file was added to FLTK, all those files had to
be adjusted
for each VS version.
Which is why we use cmake now, which creates VS project
files/Makefiles
specific to each user's environment, as well as supporting
other tool chain
and compiler environments for not only Windows, but all the
different platforms.