Reputation: 43
I'm trying to build a project with the MSVC compiler (cl.exe), the command is
start /b /wait "" "cl.exe" %build_options% %compile_flags% ..\src\win32_main.cpp /link /LIBPATH:..\src\ %link_flags% /out:%application_name%
I have set LIBPATH to where the cpp implementations to my headers are but all I get is an unresolved external. Note, I have no problem running my project without cpp files (meaning everything being inside a header, included in my main and worked through there, the problem is that the linker can't find the implementation of .h files).
Any help would be appreciated, thanks! my files are structured like so
Upvotes: 0
Views: 451
Reputation: 180020
The direct problem that you have is that you need to link *.obj
files, or possibly *.lib
files built from those .obj
files, but definitely not .cpp
files.
I suggest that you stick with Visual Studio. The root cause of your problem is that you're reinventing the wheel. The MSVC compiler is designed to be called by a build environment.
Upvotes: 1