Warning: corrupt .drectve at end of def file - opengl

I installed glew, glfw and glm in eclipse cdt(c++) with the gcc/mingw, all statically.
All works fine, but I don't like the warning in the output console of eclipse:
Warning: corrupt .drectve at end of def file
How I can fix and hide this warning ?
What does it mean ?
And what I noticed is, that this warning comes only, if I call the 'glewInit' function.

When I ran into this problem it was because I was linking against incompatible MSVC libs. A comment by keltar helped me through this problem.
SDL 2.0: linking error

The message
Warning: corrupt .drectve at end of def file
could also mean, that the project is being built with MinGW but the library it uses is created for Visual Studio.
MinGW and Visual Studio builds are not interchangeable.

I had this error in CLion for MinGW toolchain, but when I switched to VisualStudio toolchain, it disappeared.

Related

CMake MySQL Connector C++ fails when initializing get_driver_instance() [duplicate]

I installed glew, glfw and glm in eclipse cdt(c++) with the gcc/mingw, all statically.
All works fine, but I don't like the warning in the output console of eclipse:
Warning: corrupt .drectve at end of def file
How I can fix and hide this warning ?
What does it mean ?
And what I noticed is, that this warning comes only, if I call the 'glewInit' function.
When I ran into this problem it was because I was linking against incompatible MSVC libs. A comment by keltar helped me through this problem.
SDL 2.0: linking error
The message
Warning: corrupt .drectve at end of def file
could also mean, that the project is being built with MinGW but the library it uses is created for Visual Studio.
MinGW and Visual Studio builds are not interchangeable.
I had this error in CLion for MinGW toolchain, but when I switched to VisualStudio toolchain, it disappeared.

Command to Read file in CMake

Does anyone know of a way to read from a file in CMake, that works in Visual Studio? I have a cross-platform App. in Visual Studio 2017 that compiles with a toolchain in Linux, running in Hyper-V.
I have a simple defined version number in one of my H-files that I would like to read, parse, and append version number to the name of the compiled program (e.g., company_app_1.2.3).
I can't seem to get the file(READ) command to work. Visual Studio is using CMake version 3.11. I assume CMake can do this regardless of the g++ toolchain being used.
Command I tried:
#Read version
-file(READ FileNameHere $sValue)
Visual Studio Error I get:
1>/bin/sh: -c: line 0: syntax error near unexpected token `READ'
The MakeFile does not have a .txt extension, of follow Visual Studio's naming convention, but I would be willing to rename it if there was an advantage (intellisense available, or some more info about the error).
Thanks in advance for any replies.

Using WebRTC library with Visual c++

I have built the WebRTC library by using this tutorial:
https://webrtc.org/native-code/development/
Then I try to run this simple program on both Visual Studio 2013 Community and Visual Studio 2017 Professional:
image here
However in both cases I have the same error:
Error LNK1107 invalid or corrupt file: cannot read at 0x159BE command_line_parser.lib
I have tried to link to any possible webrtc *.lib files, but the problem still remains.
What is the correct way to link webrtc library to visual C++?
You need cl.exe as compiler. Default by gn build prosess for generating the ninja files is set 'is_clang = true' and the clang.exe compiler is used.
please set in 'gn args --lists out/debug ' the parameter 'is_clang = false'.
The problem is with the linker, not with the compiler. you can link the webrtc .obj files but you can't link the webrtc .lib files.
I solve it with the GN build option "use_lld=false".

visual c++ - missing unrelated DLLs

I just brought a project I was working on from linux with cmake and g++ to windows visual studio. I just copied the source files and did some changes to the code to fit windows and got the code to compile on windows. My problem is that when I try to run it it gives me missing dll run time errors. At first it gave me libgmp-10.dll missing which seems to be for minGW or gcc. I downloaded that one and put it besides my executable. Now it says libgcc_s_dw2-1.dll is missing. Aren't these dlls for gcc? Shouldn't visual studio not need these?
Check with liner->input options. It might be referring to .libs of these dlls. Replace them with windows equivalents.

VS2010 Link Warning

I am running VS2010 Express for C++ on Windows 7.
Everything was compiling and linking fine until the latest round of updates.
Now I get a series of link warnings of the form:
libcpmt.lib(xgetwctype.obj) : warning LNK4099: PDB 'libcpmt.pdb' was not found with 'libcpmt.lib(xgetwctype.obj)'
libcpmt.lib & libcpmt.pdb are in in the Visual Studio lib directory, so I can only speculate that there is some type of path problem. Has anybody else had/solved this problem?
I solved this problem by reinstalling VS2010 and then applying the service pack again.
I assume that it is better to install VS2010 after the initial onslaught of newly installed Windows 7 updates.