Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

c++ link command line..

Status
Not open for further replies.

asoom

Full Member level 1
Joined
Dec 28, 2007
Messages
99
Helped
15
Reputation
30
Reaction score
1
Trophy points
1,298
Location
jordan
Activity points
2,032
cl.exe command line for windows

hi all,

what is the command line used to link files in c++ in windows, i can't find it!

thanx in advance..
best regards
 

c++ link command

cl.exe is the compiler, by default cl.exe will link unless you explicity choose to only create object files and link later.
link.exe is the linker
 

    asoom

    Points: 2
    Helpful Answer Positive Rating
link exe command line

thanx for your help,

actually first i thought it was linking problem, but i figured out that it isn't, am trying to write a code that uses threads in c++, am using the pthread library. the problem is : though am including the pthread library at the top of the code, unresolved external symbol errors appears as follows:

1>p1.obj : error LNK2019: unresolved external symbol __imp__pthread_join referenced in function _main
1>p1.obj : error LNK2019: unresolved external symbol __imp__pthread_create referenced in function _main

i tried to find the reason but i couldn't find any thing wrong..

could it be something with the pthread library itself..

please i need help as soon as possible..
best regards
 

c link command

You need to specify the pthread library name .LIB
Example:

cl myprog.c pthread[VG]{SE,CE,C}c.lib
 

    asoom

    Points: 2
    Helpful Answer Positive Rating
c++ link

thank you.

i discovered that and tried again, it worked but a new error occured:

this application has failed to start because pthread.exe was not found. re-installing the application may fix this problem.

and this is the message that appears in the output window:

'test2.exe': Loaded 'C:\Documents and Settings\AbuElabed\My Documents\Visual Studio 2008\Projects\test2\Debug\test2.exe', Symbols loaded.
'test2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
'test2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
Debugger:: An unhandled non-continuable STATUS_DLL_NOT_FOUND exception was thrown during process load
The program '[3388] test2.exe: Native' has exited with code -1073741515 (0xc0000135).


i read on the net that i have to put the pthread.dll file in the right path, i put it in the system32 folder in the windows folder but it didn't work, any idea where shall i put it?

Added after 5 hours 11 minutes:

i figured it out... finally..:D

thanx alot anyway...
 

cmd line error c:windowssystem32kernel32.dll

am going out of my mind, the problem is appearing again, it is giving me the same error as above.. though yesterday it worked fine and i've checked that all the settings are just like they were yesterday but it is not working..

i've set the path to the dll file both using the environment variable in windows and the options in the tools tab and nothing changed..

i can't understand!! it was working fine yesterday, i've changed nothing!

pleaaaaase help!!!
 

link c++ commands

did you try putting the dll into the same directory as the compiled exe?
 

    asoom

    Points: 2
    Helpful Answer Positive Rating
c++ command line linker vs

thanks alot Jayson.. i solved the problem yesterday but i forgot to post..

yes i've tried that , i've tried every thing but it didn't work until i set the additional dependencies in project>properties>linker>input to pthread.lib..

anyway thanks alot..
best regards

Added after 5 minutes:

by the way, i wonder why couldn't it find the dll file until i set the lib file as an additional dependency?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top