What is the problem with linking of Pthreads libraries to .c file in MSVC++6? - visual-c++

Could someone please help me to compile my .c file with MSVC++6 in windows xp? From this morning, I am trying to compile it but it give me the following errors:
--------------------Configuration: server_th - Win32 Debug--------------------
Linking...
server_thread.obj : error LNK2001: unresolved external symbol _ThreadMain
Debug/server_th.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
server_th.exe - 2 error(s), 0 warning(s)
The same file was compiled in Unix but in windows xp, I don't know what is the matter with it. Even when I changed "run-time library" to Debug Multithreaded or Debug Multithreaded DLL, the errors are the same .
So,I would be glad if somneone would help me with it...
Thanks in advance for your, replies

i guess MSVC6 only recognize program execution starting point of either main(intargc,charargv[],charenvp[]) or wmain(intargc,wchar_targv[],wchar_tenvp[]) for wide char version.
perhaps you forgot to link in files containing the _ThreadMain subroutine?

Related

how to compile pymqe.c for Python3?

I managed to process module pymqe.c into pymqe.pyd for Python2 using VC 2017 compiler and my own make file. Unfortunately, it doesn’t work for Python3. If I try compile module pymqe.c from pymqi-1.9.3.tar.gz in the same way, the linking step fails with the error message:
LINK : error LNK2001: unresolved external symbol initpymq
pymqe.lib : fatal error LNK1120: 1 unresolved externals
My make file contains the following instruction to link pymqe.c with the resulting library pymqe.pyd:
/EXPORT:initpymqe pymqe.obj
I assume, the function initpymqe is excluded during compilation for Python3 due to pre-compiler instruction in the source code of the module pymqe.c:
#if PY_MAJOR_VERSION==2
void initpymqe(void) {
…
#else
Does anyone know, how to handle this problem?

Weird linking error

My application is giving me a linking error when I try to build it.
Error 5 error LNK2001: unresolved external symbol "int __cdecl _AfxInitManaged(void)" (?_AfxInitManaged##YAHXZ) mfcs80ud.lib
I am building the application using Visual studio 2005. I am also linking against WINDDK for Server 2003 and Windows 6.1 SDK if this helps.
I Googled around and noticed people saying that its a precompiled header issue and it should be fixed by setting the /Yc switch in the stdafx.cpp Create/Use Precompiled header property. but that did not fix it for me and I'm not sure how to fix this.
Can someone help please.
I had same problem with Visual Studio 2010.
error LNK2001: unresolved external symbol "int __cdecl _AfxInitManaged
It turned out that was from my mistake to include another stdafx.cpp in other project.
Including more than one stdafx.cpp will produce this symptom.
Seems it solved it self once I restarted my machine.. not sure what was causing it in the first place, even restarting VS and cleaning the solution a gazillion times did not work.
Using Visual Studio 2005 to build a .NET 2003 solution, I encountered the described LNK2001 error. The project did not have a stdafx.cpp file. I added a copy of stdafx.cpp to the project and it built successfully.

Error when compiling with luajit and lua-iup libs [visual c++ 2012]

I wrote an app with luajit and lua-iup, and link my app with static libs. But I got the following error:
------ Build started: Project: ConsoleApplication1, Configuration: Release Win32 ------
Creating library C:\Users\root\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Release\ConsoleApplication1.lib and object C:\Users\root\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Release\ConsoleApplication1.exp
iup.lib(iupwindows_main.obj) : error LNK2001: unresolved external symbol _main
C:\Users\root\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Release\ConsoleApplication1.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Am I missing some libs and any idea about this?
As far as I know, IUP's Lua bindings are partially written in Lua. That wouldn't ordinarily be a problem, except that the Lua parts are compiled into the library as pre-compiled bytecode. Lua bytecode and LuaJIT bytecode are different.
The right answer is to change IUP so that it builds with Lua source compiled in rather than bytecode. That will conceivably slow down the startup of an IUP application, but it will make it easier to cross compile IUP and make it possible to use LuaJIT instead of standard Lua.
Here is the answer form the author of IUP, hope this would be helpful to someone that met the same problem as me
It seems that you are building a console application. This means you
need a “main” function. If you try instead to build a Windows
application without a console, then IUP will implement the WinMain
function for you and call your “main” function. In both cases you need
the “main” function.

SFML linker problems on eclipse VC++

I am trying to use the SFML library for audio in my project.
I am developing in eclipse juno for c++ and am using SFML v1.6.
I added sfml-audio-d.lib, sfml-main-d.lib, and sfml-system-d.lib into
C/C++ General > paths and symbols>libraries
I also defined a macro named SFML_DYNAMIC into
C/C++ Build>Settings>C++ Compiler>Preprocessor 'Defines /D' section
I added the directory that contains all the dlls into the PATH environment variable.
In my code I make use of sf::SoundBuffer, but when I try to build the project I get the following linker error:
Chunk.obj : error LNK2001: unresolved external symbol "private: static class sf::SoundBuffer * Chunk::breakBlockSound" (?breakBlockSound#Chunk##0PAVSoundBuffer#sf##A)
MyProject.exe : fatal error LNK1120: 1 unresolved externals
Had to rebuild the project in VS2010 before using it. Works now.

v8 release mode linker error with winsock

This subject became a side subject after I accepted an answer for my last question, so I will put it here as a separate topic for neatness, and I believe this will make it more useful for others.
I am working on MS visual studio 2005.
I am building a project using v8 in release mode, and am receiving a linker error that is related to winsock even though the winsock libraries are already in my additional dependencies.
My additional dependencies list is the same for both release and debug mode. It works perfectly in debug mode, and I am getting the linker errors only in release mode.
here is my additional dependencies string:
Ws2_32.lib wininet.lib rasapi32.lib iphlpapi.lib Psapi.lib winmm.lib wsock32.lib msvcrt.lib $(SolutionDir)\external_libs\debug\v8.lib $(SolutionDir)external_libs\release\v8_base.lib $(SolutionDir)external_libs\release\v8_snapshot.lib
Thanks a lot for any possible help.
Update:
I reduced the dependencies to:
Ws2_32.lib Psapi.lib winmm.lib msvcrt.lib $(SolutionDir)\external_libs\release\v8.lib $(SolutionDir)external_libs\release\v8_base.lib
and still get unresolved externals:
1>v8_base.lib(platform-win32.obj) : error LNK2001: unresolved external symbol __imp__freeaddrinfo#4
1>v8_base.lib(platform-win32.obj) : error LNK2001: unresolved external symbol __imp__getaddrinfo#16
1>v8_base.lib(platform-win32.obj) : error LNK2001: unresolved external symbol __set_abort_behavior
You have paths to both debug and release folders in your dependency list. Try replacing those with $(Configuration).

Resources