LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-21-2012, 10:00 PM   #1
Zssfssz
Member
 
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Rep: Reputation: Disabled
How to tell if a header is tied to the Unix API.


I am wrriting a program and I just found a header that does something that I was going to spend hours writing, but I am not sure if it is tied to Unix or not (I do want it to run on windows) is there an easy way to tell?
If there isn't than it is getopt.h...
 
Old 04-22-2012, 02:38 AM   #2
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,238

Rep: Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299
Yes there is an easy way to tell. Write a minimal sample program that includes the header, and try to compile it in Windows.

Last edited by dugan; 04-22-2012 at 02:40 AM.
 
Old 04-22-2012, 06:57 AM   #3
Erfankam
Member
 
Registered: Jun 2011
Location: Tehran, Islamic Repulic of, Iran
Distribution: Ubuntu, Arch, Suse
Posts: 32

Rep: Reputation: 13
In alomost time I should yes. In most cases a lib for linux has been compiled for both linux and windows even mac. But in some cases you should find another tool like cygwin to compile and run some other linux or unix lib.
 
Old 04-22-2012, 09:23 AM   #4
Zssfssz
Member
 
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Original Poster
Rep: Reputation: Disabled
Ok I'll use cygwin...
I don't have easy accsess to a windows machine and I would rather not install wine.
 
Old 04-23-2012, 05:20 AM   #5
Erfankam
Member
 
Registered: Jun 2011
Location: Tehran, Islamic Repulic of, Iran
Distribution: Ubuntu, Arch, Suse
Posts: 32

Rep: Reputation: 13
Try to use gcc as your compiler. Because cygwin use gcc compiler for c(or g++ for c++) by default.
this make you sure to have most chance to port your program to windows.
 
Old 04-23-2012, 08:22 AM   #6
Zssfssz
Member
 
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Original Poster
Rep: Reputation: Disabled
I know this is going to sound retarded but is it possible to statically link to cygwin? Is there a cygwin1.{lib,a}?

PS The Header Is in Windows.

Last edited by Zssfssz; 04-23-2012 at 08:25 AM.
 
Old 04-23-2012, 09:59 PM   #7
Erfankam
Member
 
Registered: Jun 2011
Location: Tehran, Islamic Repulic of, Iran
Distribution: Ubuntu, Arch, Suse
Posts: 32

Rep: Reputation: 13
if you mean linking program without compile your code on windows platform like, I think impossible..
Because your code must convert to machine code specialized for windows like platform.
But you can use any vmware or vitual box application if you cant change your os immediately.
 
Old 04-23-2012, 11:26 PM   #8
Zssfssz
Member
 
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Original Poster
Rep: Reputation: Disabled
What? No I have the source to my app but the apps I make are desined for ease of use, to an extreme, no configure files, no DLLs, just one executable. I want to statically link to the cygwin libs so the person doesnt have to worry about the dll.
 
Old 04-24-2012, 02:37 AM   #9
Erfankam
Member
 
Registered: Jun 2011
Location: Tehran, Islamic Repulic of, Iran
Distribution: Ubuntu, Arch, Suse
Posts: 32

Rep: Reputation: 13
Oh. Yes of course. You use cygwin library manually and dont need to worry about final user execution.
These lib will bind to your code and will execute same way as your computer during execution.
 
  


Reply

Tags
c++, headers


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
glibc change in header file sysdeps/unix/sysv/linux/bits/socket.h Bambi535 Linux - General 4 08-19-2008 02:45 PM
how to copy binary files using Unix API's rohanak Programming 5 05-09-2008 04:26 PM
LXer: Howto Connect MySQL using C API under Linux / UNIX LXer Syndicated Linux News 0 06-01-2007 07:16 AM
how to create header files in unix? nid_ice@yahoo.co.in Programming 2 06-29-2005 11:21 PM
C++ SOAP API for HP-Unix deiussum Programming 1 09-17-2004 08:56 AM


All times are GMT -5. The time now is 02:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration