Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: PIe on March 12, 2017, 03:13:27 pm
-
When I try to build wxLauncher in Eclipse, it compiles fine but linking fails with a bunch of undefined references.
I know Eclipse isn't officially supported, but I can't and don't want to use Visual Studio.
I installed wxWidgets 3.1.0 and built it with "mingw32-make -f makefile.gcc", and the WXWIN environment variable set to the root directory. CMake is set to build a binary zip.
Here is what shows up during linking: http://pastebin.com/aNu48JQd
Has anyone else had this problem on Windows and/or Eclipse, and how did you fix it?
-
I haven't used Eclipse on Windows, but I did have a heap of similar issue building with with MSVC/cmake/etc, I can't remember the precise details but I had to fiddle around with library settings in cmake before it started building & linking correctly.
-
Do you remember whether you had to go into advanced settings? Whenever I change one of the non-advanced library paths, it pops up an error when I configure.
-
I think I did go into the advanced settings; but I don't recall if that was really necessary. Sorry! Not very helpful, I'll see if I can have a look at my saved cmake config & get back to you.
-
Any luck niffiwan?
-
Without seeing your compile options, it looks like you either are building release but have selected a debug wxWidgets.
Based on this you also may not be linking the CRT (or are liking a mismatch debug/release version)
C:\wxWidgets-3.1.0\build\msw/../../src/msw/dlmsw.cpp:65: undefined reference to `GetFileVersionInfoSizeW'
C:\wxWidgets-3.1.0\build\msw/../../src/msw/dlmsw.cpp:69: undefined reference to `GetFileVersionInfoW'
C:\wxWidgets-3.1.0\build\msw/../../src/msw/dlmsw.cpp:73: undefined reference to `VerQueryValueW'
Having said that, I haven't tried building wxWidgets with anything other than VisualC on Windows so I have no idea what other incompatibilities you may run into. In particular make sure that cmake has not detected you as being linux (IS_WIN32 vs IS_LINUX). Please pastebin your CMakeCache.txt.
-
CMakeCache.txt at http://pastebin.com/sZiqFZ76.
I don't have either IS_WIN32 or IS_LINUX.
I've tried building with wxWidgets release and with wxWidgets_CONFIGURATION to mswu, but got the same results.
-
I made sure I was using wxWidgets release and mswu configuration. Then I tried including C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um from inside Eclipse and adding an environment variable, but it still failed. Maybe this path needs to be set inside CMake, but I don't know where.
-
I found this thread https://forums.wxwidgets.org/viewtopic.php?t=42617#p172992 where the solution was to add libshlwapi.a and libversion.a (MinGW equivalents to Windows SDK files) to the linker input files. I assume this means CMakeLists.txt, and I'm now trying to figure out how to do that.
-
I found this thread https://forums.wxwidgets.org/viewtopic.php?t=42617#p172992 where the solution was to add libshlwapi.a and libversion.a (MinGW equivalents to Windows SDK files) to the linker input files. I assume this means CMakeLists.txt, and I'm now trying to figure out how to do that.
This line would be what you are looking for: https://github.com/scp-fs2open/wxLauncher/blob/master/CMakeLists.txt#L394
-
I added C:\Program Files\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\x86_64-w64-mingw32\lib as an environment variable and edited CMakeLists.txt as follows:
find_library(SHLWAPI libshlwapi.a)
find_library(MINCORE libversion.a)
target_link_libraries(wxlauncher ${wxWidgets_LIBRARIES} ${SDL2_LIBRARIES} ${SHLWAPI} ${MINCORE})
This made two new variables in the CMake gui called SHLWAPI and MINCORE, which I manually set to C:\\Program\ Files\\mingw-w64\\x86_64-6.3.0-posix-seh-rt_v5-rev1\\mingw64\\x86_64-w64-mingw32\\lib\\libshlwapi.a and C:\\Program\ Files\\mingw-w64\\x86_64-6.3.0-posix-seh-rt_v5-rev1\\mingw64\\x86_64-w64-mingw32\\lib\\libversion.a respectively.
The Windows library errors are gone but I still have the reference problems with wxWidgets.
-
Reference problems?
Please paste an updated output
-
I had to link the libraries in the correct order, so I replaced
target_link_libraries(wxlauncher ${wxWidgets_LIBRARIES} ${SDL2_LIBRARIES} ${SHLWAPI} ${MINCORE})
with
target_link_libraries(wxlauncher ${wxWidgets_LIBRARIES} ${MINCORE})
target_link_libraries(wxlauncher ${wxWidgets_LIBRARIES} ${SHLWAPI})
target_link_libraries(wxlauncher ${SDL2_LIBRARIES} ${MINCORE})
target_link_libraries(wxlauncher ${SDL2_LIBRARIES} ${SHLWAPI})
target_link_libraries(wxlauncher ${wxWidgets_LIBRARIES} ${SDL2_LIBRARIES})
It now builds properly, but doesn't run.
-
No exceptions? No log? Nothing on the console? No Dr Watson?
-
Both double-clicking and running from command prompt produce the attached popup box, with no output on the console. Also, DrWatson doesn't show up.
Edit: I think I built a 64-bit wxL, which would conflict with my existing 32-bit installation.
[attachment stolen by Russian hackers]
-
I built the Install target and it works, except for actually launching FSO. I get an error about creating a registry key. Also, I have to click through some errors and it looks a little weird, but everything except playing the game seems to work
Thanks so much Iss. I really appreciate it.
[attachment stolen by Russian hackers]
-
The second error is caused by a bug in wxWidgets and an invalid mod.ini file. If you update to wxWidgets 3.1 it should be fixed. The second issue would probably be fixed by using a nightly build of FSO. The previous versions depended on some weird registry hacking which probably doesn't work with MinGW.
-
The second error is caused by a bug in wxWidgets and an invalid mod.ini file. If you update to wxWidgets 3.1 it should be fixed. The second issue would probably be fixed by using a nightly build of FSO. The previous versions depended on some weird registry hacking which probably doesn't work with MinGW.
I tried removing all my mods and I'm already using 3.1, but the error is still there. Using a nightly did make it playable, thanks.