Note that there are some explanatory texts on larger screens.

plurals
  1. POMSVC: Using link.exe manually
    primarykey
    data
    text
    <p>I'm attempting to set up a build system named Waf with a test C++ OpenGL/SDL project, and am running into a few issues with the linking process. As far as I can tell, all of the libraries are being found properly, and being added into the linking command, and yet the linking process seems to be acting as if the libraries aren't linked. </p> <p>In order to attempt to debug the process, I was trying to run the compilation/link process manually in order to understand exactly how it works with MSVC, but I'm still getting issues. When I run the following LINK.exe command:</p> <pre><code>PS C:\Users\covertcj\Documents\projects\test&gt; &amp; "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\LINK.exe" /NOLOGO /MANIFEST /SUBSYSTEM:CONSOLE /MACHINE:x64 /VERBOSE .\build\src\main.cpp.1.o /OUT:.\build\test.exe /LIBPATH:C:\Users\covertcj\Documents\projects\test\lib /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64" opengl32.lib sdl.lib sdlmain.lib </code></pre> <p>I get the same error as usual:</p> <pre><code>main.cpp.1.o : error LNK2019: unresolved external symbol SDL_CreateWindow referenced in function SDL_main main.cpp.1.o : error LNK2019: unresolved external symbol SDL_DestroyWindow referenced in function SDL_main main.cpp.1.o : error LNK2019: unresolved external symbol SDL_GL_CreateContext referenced in function SDL_main main.cpp.1.o : error LNK2019: unresolved external symbol SDL_GL_SwapWindow referenced in function SDL_main main.cpp.1.o : error LNK2019: unresolved external symbol SDL_GL_DeleteContext referenced in function SDL_main main.cpp.1.o : error LNK2019: unresolved external symbol SDL_PollEvent referenced in function SDL_main main.cpp.1.o : error LNK2019: unresolved external symbol SDL_Delay referenced in function SDL_main main.cpp.1.o : error LNK2019: unresolved external symbol SDL_Init referenced in function SDL_main main.cpp.1.o : error LNK2019: unresolved external symbol SDL_Quit referenced in function SDL_main LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup </code></pre> <p>However, I also get some interesting verbose output:</p> <pre><code>Searching libraries Searching C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64\opengl32.lib: Searching C:\Users\covertcj\Documents\projects\dungeonhg\lib\sdl.lib: Searching C:\Users\covertcj\Documents\projects\dungeonhg\lib\sdlmain.lib: Searching C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64\LIBCMT.lib: Found _load_config_used Loaded LIBCMT.lib(loadcfg.obj) Searching C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64\OLDNAMES.lib: Searching C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64\kernel32.lib: Finished searching libraries Unused libraries: C:\Users\covertcj\Documents\projects\dungeonhg\lib\sdl.lib C:\Users\covertcj\Documents\projects\dungeonhg\lib\sdlmain.lib C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64\OLDNAMES.lib </code></pre> <p>However, my code most definitely uses SDL and SDLmain:</p> <p>main.cpp</p> <pre><code>#include &lt;SDL2/SDL.h&gt; #include &lt;SDL2/SDL_opengl.h&gt; int main(int argc, char *argv[]) { SDL_Init(SDL_INIT_VIDEO); // Init SDL2 // Create a window. Window mode MUST include SDL_WINDOW_OPENGL for use with OpenGL. SDL_Window *window = SDL_CreateWindow( "SDL2/OpenGL Demo", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE ); ... </code></pre> <p>Anybody know what I'm doing wrong here?</p> <p>EDIT: I have also verified that the same waf script works on both linux and osx, so it seems to be windows specific.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload